diff --git a/pom.xml b/pom.xml index 93e0157..b9b1e11 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.thjomnx java-systemd - 2.2.0-SNAPSHOT + 2.2.0-eks jar ${project.artifactId} @@ -47,7 +47,7 @@ com.github.hypfvieh dbus-java - 3.3.0 + 3.3.1 javax.xml.bind @@ -57,29 +57,29 @@ org.slf4j slf4j-api - 1.7.30 + 1.7.36 org.slf4j slf4j-simple - 1.7.30 + 1.7.36 org.testng testng - 7.4.0 + 7.5 test org.mockito mockito-inline - 3.8.0 + 4.3.1 test org.awaitility awaitility - 4.0.3 + 4.2.0 test diff --git a/src/main/java/de/thjom/java/systemd/Manager.java b/src/main/java/de/thjom/java/systemd/Manager.java index cfdb442..b84a875 100644 --- a/src/main/java/de/thjom/java/systemd/Manager.java +++ b/src/main/java/de/thjom/java/systemd/Manager.java @@ -11,23 +11,24 @@ package de.thjom.java.systemd; -import java.math.BigInteger; -import java.util.List; - -import org.freedesktop.dbus.DBusPath; -import org.freedesktop.dbus.connections.impl.DBusConnection; -import org.freedesktop.dbus.exceptions.DBusException; -import org.freedesktop.dbus.interfaces.Introspectable; - import de.thjom.java.systemd.Unit.Mode; import de.thjom.java.systemd.Unit.Who; import de.thjom.java.systemd.interfaces.ManagerInterface; import de.thjom.java.systemd.types.DynamicUser; +import de.thjom.java.systemd.types.Pair; +import de.thjom.java.systemd.types.StructForUnitEnableAndDisable; import de.thjom.java.systemd.types.UnitFileChange; import de.thjom.java.systemd.types.UnitFileInstallChange; import de.thjom.java.systemd.types.UnitFileType; import de.thjom.java.systemd.types.UnitProcessType; import de.thjom.java.systemd.types.UnitType; +import org.freedesktop.dbus.DBusPath; +import org.freedesktop.dbus.connections.impl.DBusConnection; +import org.freedesktop.dbus.exceptions.DBusException; +import org.freedesktop.dbus.interfaces.Introspectable; + +import java.math.BigInteger; +import java.util.List; public class Manager extends InterfaceAdapter { @@ -195,7 +196,7 @@ public void clearJobs() { getInterface().clearJobs(); } - public List disableUnitFiles(final List names, final boolean runtime) { + public List disableUnitFiles(final List names, final boolean runtime) { return getInterface().disableUnitFiles(names, runtime); } @@ -203,7 +204,7 @@ public String dump() { return getInterface().dump(); } - public List enableUnitFiles(final List names, final boolean runtime, final boolean force) { + public Pair> enableUnitFiles(final List names, final boolean runtime, final boolean force) { return getInterface().enableUnitFiles(names, runtime, force); } @@ -355,7 +356,7 @@ public DBusPath restartUnit(final String name, final String mode) { return getInterface().restartUnit(name, mode); } - public List revertUnitFiles(final List names){ + public List revertUnitFiles(final List names) { return getInterface().revertUnitFiles(names); } diff --git a/src/main/java/de/thjom/java/systemd/interfaces/ManagerInterface.java b/src/main/java/de/thjom/java/systemd/interfaces/ManagerInterface.java index 5b0ec7a..1e05567 100644 --- a/src/main/java/de/thjom/java/systemd/interfaces/ManagerInterface.java +++ b/src/main/java/de/thjom/java/systemd/interfaces/ManagerInterface.java @@ -11,7 +11,9 @@ package de.thjom.java.systemd.interfaces; +import de.thjom.java.systemd.types.Pair; import de.thjom.java.systemd.Signal; +import de.thjom.java.systemd.types.StructForUnitEnableAndDisable; import de.thjom.java.systemd.types.*; import org.freedesktop.dbus.DBusPath; import org.freedesktop.dbus.annotations.DBusInterfaceName; @@ -37,13 +39,13 @@ public interface ManagerInterface extends DBusInterface { void clearJobs(); @DBusMemberName(value = "DisableUnitFiles") - List disableUnitFiles(List names, boolean runtime); + List disableUnitFiles(List names, boolean runtime); @DBusMemberName(value = "Dump") String dump(); @DBusMemberName(value = "EnableUnitFiles") - List enableUnitFiles(List names, boolean runtime, boolean force); + Pair> enableUnitFiles(List names, boolean runtime, boolean force); @DBusMemberName(value = "Exit") void exit(); diff --git a/src/main/java/de/thjom/java/systemd/types/Pair.java b/src/main/java/de/thjom/java/systemd/types/Pair.java new file mode 100644 index 0000000..a506019 --- /dev/null +++ b/src/main/java/de/thjom/java/systemd/types/Pair.java @@ -0,0 +1,28 @@ +/* + * Java-systemd implementation + * Copyright (c) 2016 Markus Enax + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of either the GNU Lesser General Public License Version 2 or the + * Academic Free Licence Version 3.0. + * + * Full licence texts are included in the COPYING file with this program. + */ + +package de.thjom.java.systemd.types; + +import org.freedesktop.dbus.Tuple; +import org.freedesktop.dbus.annotations.Position; + +public final class Pair extends Tuple { + + @Position(0) + public final A a; + @Position(1) + public final B b; + + public Pair(A a, B b) { + this.a = a; + this.b = b; + } +} \ No newline at end of file diff --git a/src/main/java/de/thjom/java/systemd/types/StructForUnitEnableAndDisable.java b/src/main/java/de/thjom/java/systemd/types/StructForUnitEnableAndDisable.java new file mode 100644 index 0000000..4abe495 --- /dev/null +++ b/src/main/java/de/thjom/java/systemd/types/StructForUnitEnableAndDisable.java @@ -0,0 +1,30 @@ +/* + * Java-systemd implementation + * Copyright (c) 2016 Markus Enax + * + * This program is free software; you can redistribute it and/or modify it under + * the terms of either the GNU Lesser General Public License Version 2 or the + * Academic Free Licence Version 3.0. + * + * Full licence texts are included in the COPYING file with this program. + */ + +package de.thjom.java.systemd.types; + +import org.freedesktop.dbus.Struct; +import org.freedesktop.dbus.annotations.Position; + +public final class StructForUnitEnableAndDisable extends Struct { + @Position(0) + public final String a; + @Position(1) + public final String b; + @Position(2) + public final String c; + + public StructForUnitEnableAndDisable(String a, String b, String c) { + this.a = a; + this.b = b; + this.c = c; + } +} \ No newline at end of file