add identifier to requests
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Tue, 15 Apr 2008 06:41:15 +0000 (06:41 +0000)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Tue, 15 Apr 2008 06:41:15 +0000 (06:41 +0000)
git-svn-id: http://trooper/svn/projects/jFCPlib/branch/high-level-client@820 c3eda9e8-030b-0410-8277-bc7414b0a119

src/net/pterodactylus/fcp/EndListPeers.java
src/net/pterodactylus/fcp/ListPeers.java
src/net/pterodactylus/fcp/Peer.java

index 12dedbe..6e23341 100644 (file)
@@ -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");
+       }
+
 }
index 3ae3637..acd2b1f 100644 (file)
@@ -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 <code>true</code> metadata of the peers is included in
         *            the reply
@@ -45,8 +50,9 @@ public class ListPeers extends FcpMessage {
         *            if <code>true</code> 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));
        }
index e45d563..4a21f5c 100644 (file)
@@ -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.
         *