add ListPersistentRequests and WatchGlobal command
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 10 Apr 2008 11:24:51 +0000 (11:24 +0000)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 10 Apr 2008 11:24:51 +0000 (11:24 +0000)
git-svn-id: http://trooper/svn/projects/jSite/trunk@690 c3eda9e8-030b-0410-8277-bc7414b0a119

src/net/pterodactylus/util/fcp/ListPersistentRequests.java [new file with mode: 0644]
src/net/pterodactylus/util/fcp/WatchGlobal.java [new file with mode: 0644]

diff --git a/src/net/pterodactylus/util/fcp/ListPersistentRequests.java b/src/net/pterodactylus/util/fcp/ListPersistentRequests.java
new file mode 100644 (file)
index 0000000..4e72a2c
--- /dev/null
@@ -0,0 +1,24 @@
+/**
+ * © 2008 INA Service GmbH
+ */
+package net.pterodactylus.util.fcp;
+
+/**
+ * Command to tell the node to list all persistent requests from the current
+ * queue, which is either the global queue or the client-local queue, depending
+ * on your {@link WatchGlobal} status.
+ * 
+ * @author <a href="mailto:dr@ina-germany.de">David Roden</a>
+ * @version $Id$
+ */
+public class ListPersistentRequests extends FcpMessage {
+
+       /**
+        * Creates a new “ListPersistentRequests” command that lists all persistent
+        * requests in the current queue.
+        */
+       public ListPersistentRequests() {
+               super("ListPersistentRequests");
+       }
+
+}
diff --git a/src/net/pterodactylus/util/fcp/WatchGlobal.java b/src/net/pterodactylus/util/fcp/WatchGlobal.java
new file mode 100644 (file)
index 0000000..79698c5
--- /dev/null
@@ -0,0 +1,44 @@
+/**
+ * © 2008 INA Service GmbH
+ */
+package net.pterodactylus.util.fcp;
+
+/**
+ * The “WatchGlobal” messages enables clients to watch the global queue in
+ * addition to the client-local queue.
+ * 
+ * @author <a href="mailto:dr@ina-germany.de">David Roden</a>
+ * @version $Id$
+ */
+public class WatchGlobal extends FcpMessage {
+
+       /**
+        * Enables or disables watching the global queue.
+        * 
+        * @param enabled
+        *            <code>true</code> to watch the global queue and the
+        *            client-local queue, <code>false</code> to watch only the
+        *            client-local queue
+        */
+       public WatchGlobal(boolean enabled) {
+               this(enabled, Verbosity.ALL);
+       }
+
+       /**
+        * Enables or disables watching the global queue, optionally masking out
+        * certain events.
+        * 
+        * @param enabled
+        *            <code>true</code> to watch the global queue and the
+        *            client-local queue, <code>false</code> to watch only the
+        *            client-local queue
+        * @param verbosityMask
+        *            A verbosity mask that determines which events are received
+        */
+       public WatchGlobal(boolean enabled, Verbosity verbosityMask) {
+               super("WatchGlobal");
+               setField("Enabled", String.valueOf(enabled));
+               setField("VerbosityMask", String.valueOf(verbosityMask));
+       }
+
+}