From 82f2b7afec13281760509365f39900affa9a5598 Mon Sep 17 00:00:00 2001 From: David Roden Date: Tue, 15 Apr 2008 06:46:12 +0000 Subject: [PATCH] r13@natrium: bombe | 2008-04-15 08:41:15 +0200 add identifier to requests git-svn-id: file:///home/toad/git-migration/temprepository/trunk/apps/jFCPlib@19343 67a373e5-eb02-0410-a15c-ee090a768436 --- src/net/pterodactylus/fcp/EndListPeers.java | 9 +++++++++ src/net/pterodactylus/fcp/ListPeers.java | 12 +++++++++--- src/net/pterodactylus/fcp/Peer.java | 9 +++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/src/net/pterodactylus/fcp/EndListPeers.java b/src/net/pterodactylus/fcp/EndListPeers.java index 12dedbe..6e23341 100644 --- a/src/net/pterodactylus/fcp/EndListPeers.java +++ b/src/net/pterodactylus/fcp/EndListPeers.java @@ -37,4 +37,13 @@ public class EndListPeers extends BaseMessage { super(receivedMessage); } + /** + * Returns the identifier of the request. + * + * @return The identifier of the request + */ + public String getIdentifier() { + return getField("Identifier"); + } + } diff --git a/src/net/pterodactylus/fcp/ListPeers.java b/src/net/pterodactylus/fcp/ListPeers.java index 3ae3637..acd2b1f 100644 --- a/src/net/pterodactylus/fcp/ListPeers.java +++ b/src/net/pterodactylus/fcp/ListPeers.java @@ -30,14 +30,19 @@ public class ListPeers extends FcpMessage { /** * Creates a new “ListPeers” request that only includes basic data of the * peers. + * + * @param identifier + * The identifier of the request */ - public ListPeers() { - this(false, false); + public ListPeers(String identifier) { + this(identifier, false, false); } /** * Creates a new “ListPeers” request that includes wanted data of the peers. * + * @param identifier + * The identifier of the request * @param withMetadata * If true metadata of the peers is included in * the reply @@ -45,8 +50,9 @@ public class ListPeers extends FcpMessage { * if true volatile data of the peers is included * in the reply */ - public ListPeers(boolean withMetadata, boolean withVolatile) { + public ListPeers(String identifier, boolean withMetadata, boolean withVolatile) { super("ListPeers"); + setField("Identifier", identifier); setField("WithMetadata", String.valueOf(withMetadata)); setField("WithVolatile", String.valueOf(withVolatile)); } diff --git a/src/net/pterodactylus/fcp/Peer.java b/src/net/pterodactylus/fcp/Peer.java index e45d563..4a21f5c 100644 --- a/src/net/pterodactylus/fcp/Peer.java +++ b/src/net/pterodactylus/fcp/Peer.java @@ -59,6 +59,15 @@ public class Peer extends BaseMessage { } /** + * Returns the identifier of the request. + * + * @return The identifier of the request + */ + public String getIdentifier() { + return getField("Identifier"); + } + + /** * Returns the “physical.udp” line from the message. It contains all IP * addresses and port numbers of the peer. * -- 2.7.4