From 01c480d8bcae761577688a0518fd9038f69221b9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 12 Apr 2008 18:50:29 +0000 Subject: [PATCH] add ModifyPersistentRequest git-svn-id: http://trooper/svn/projects/jSite/trunk@736 c3eda9e8-030b-0410-8277-bc7414b0a119 --- TODO | 1 - .../util/fcp/ModifyPersistentRequest.java | 67 ++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 src/net/pterodactylus/util/fcp/ModifyPersistentRequest.java diff --git a/TODO b/TODO index ae8fe9e..8154ddc 100644 --- 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 index 0000000..f0dc83b --- /dev/null +++ b/src/net/pterodactylus/util/fcp/ModifyPersistentRequest.java @@ -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 <bombe@freenetproject.org> + * @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 + * true if the request is on the global queue, + * false 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)); + } + +} -- 2.7.4