From e84ef1adb8ff0d3b121ea12b2d3e15fa52eb2f00 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 6 Jan 2021 15:20:40 +0100 Subject: Splitting Main into two runs, Vpn and AcmeApps. --- module/acme/src/main/java/io/trygvis/acme/AcmeAppsMain.java | 13 +++++++++++++ module/acme/src/main/java/io/trygvis/acme/VpnMain.java | 6 ++---- module/acme/src/main/resources/META-INF/kmodule.xml | 10 ++++++---- 3 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 module/acme/src/main/java/io/trygvis/acme/AcmeAppsMain.java (limited to 'module/acme/src/main') diff --git a/module/acme/src/main/java/io/trygvis/acme/AcmeAppsMain.java b/module/acme/src/main/java/io/trygvis/acme/AcmeAppsMain.java new file mode 100644 index 0000000..f21ebc3 --- /dev/null +++ b/module/acme/src/main/java/io/trygvis/acme/AcmeAppsMain.java @@ -0,0 +1,13 @@ +package io.trygvis.acme; + +import io.trygvis.rules.engine.Engine; + +import java.io.IOException; + +public class AcmeAppsMain { + public static void main(String[] args) throws IOException { + try (var engine = new Engine("acme-apps", "acme.yaml")) { + engine.io.dump("acme/apps", engine.session.getFactHandles()); + } + } +} diff --git a/module/acme/src/main/java/io/trygvis/acme/VpnMain.java b/module/acme/src/main/java/io/trygvis/acme/VpnMain.java index d5f986d..d6c8061 100644 --- a/module/acme/src/main/java/io/trygvis/acme/VpnMain.java +++ b/module/acme/src/main/java/io/trygvis/acme/VpnMain.java @@ -10,10 +10,8 @@ import java.io.IOException; public class VpnMain { public static void main(String[] args) throws IOException { - try (var engine = new Engine("acme.yaml")) { - engine.io.dump("phase-1", engine.session.getFactHandles()); - - engine.io.dump("vpn0", engine.session.getFactHandles(), (Object o) -> + try (var engine = new Engine("acme-wireguard", "acme.yaml")) { + engine.io.dump("acme/wireguard", engine.session.getFactHandles(), (Object o) -> o.getClass().getName().contains("Wg") || o instanceof Machine || o instanceof DnsEntry diff --git a/module/acme/src/main/resources/META-INF/kmodule.xml b/module/acme/src/main/resources/META-INF/kmodule.xml index 351a25e..da34a59 100644 --- a/module/acme/src/main/resources/META-INF/kmodule.xml +++ b/module/acme/src/main/resources/META-INF/kmodule.xml @@ -3,9 +3,11 @@ xmlns="http://www.drools.org/xsd/kmodule" xsi:schemaLocation="http://www.drools.org/xsd/kmodule https://www.drools.org/xsd/kmodule_7_1.xsd"> - - - + + + + + + -- cgit v1.2.3