add ModifyPersistentRequest
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 12 Apr 2008 18:50:29 +0000 (18:50 +0000)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 12 Apr 2008 18:50:29 +0000 (18:50 +0000)
git-svn-id: http://trooper/svn/projects/jSite/trunk@736 c3eda9e8-030b-0410-8277-bc7414b0a119

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

diff --git a/TODO b/TODO
index ae8fe9e..8154ddc 100644 (file)
--- a/TODO
+++ b/TODO
@@ -3,7 +3,6 @@ ClientPutDiskDir
 GetPluginInfo (since 1075)
 GetRequestStatus
 ModifyConfig (since 1027)
-ModifyPersistentRequest
 PutFetchable
 PutSuccessful
 RemovePersistentRequest
diff --git a/src/net/pterodactylus/util/fcp/ModifyPersistentRequest.java b/src/net/pterodactylus/util/fcp/ModifyPersistentRequest.java
new file mode 100644 (file)
index 0000000..f0dc83b
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * jSite2 - ModifyPersistentRequest.java -
+ * Copyright © 2008 David Roden
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+package net.pterodactylus.util.fcp;
+
+/**
+ * A “ModifyPersistentRequest” is used to modify certain properties of a
+ * persistent request while it is running.
+ * 
+ * @author David ‘Bombe’ Roden &lt;bombe@freenetproject.org&gt;
+ * @version $Id$
+ */
+public class ModifyPersistentRequest extends FcpMessage {
+
+       /**
+        * Creates a new “ModifyPersistentRequest” that changes the specified
+        * request.
+        * 
+        * @param requestIdentifier
+        *            The identifier of the request
+        * @param global
+        *            <code>true</code> if the request is on the global queue,
+        *            <code>false</code> if it is on the client-local queue
+        */
+       public ModifyPersistentRequest(String requestIdentifier, boolean global) {
+               super("ModifyPersistentRequest");
+               setField("Identifier", requestIdentifier);
+               setField("Global", String.valueOf(global));
+       }
+
+       /**
+        * Sets the new client token of the request.
+        * 
+        * @param newClientToken
+        *            The new client token of the request
+        */
+       public void setClientToken(String newClientToken) {
+               setField("ClientToken", newClientToken);
+       }
+
+       /**
+        * Sets the new priority of the request.
+        * 
+        * @param newPriority
+        *            The new priority of the request
+        */
+       public void setPriority(Priority newPriority) {
+               setField("PriorityClass", String.valueOf(newPriority));
+       }
+
+}