X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Ffcp%2FPeer.java;h=9fd966518e05fbaa2bb39da7b34b88dbd59d9e4e;hb=15f2240c29062e572f512e703a06e414bb3d5d37;hp=e45d563489255e16a6aa268d3879514e0e0e31bc;hpb=f553531be78d6d6d95dc152728f2b8d40242b57d;p=jFCPlib.git
diff --git a/src/net/pterodactylus/fcp/Peer.java b/src/net/pterodactylus/fcp/Peer.java
index e45d563..9fd9665 100644
--- a/src/net/pterodactylus/fcp/Peer.java
+++ b/src/net/pterodactylus/fcp/Peer.java
@@ -23,7 +23,6 @@ package net.pterodactylus.fcp;
* The âPeerâ reply by the node contains information about a peer.
*
* @author David âBombeâ Roden <bombe@freenetproject.org>
- * @version $Id$
*/
public class Peer extends BaseMessage {
@@ -59,6 +58,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.
*
@@ -174,4 +182,33 @@ public class Peer extends BaseMessage {
return FcpUtils.decodeMultiIntegerField(getField("auth.negTypes"));
}
+ /**
+ * Returns one of the volatile fields from the message. The given field name
+ * is prepended with âvolatile.â so if you want to get the value of the
+ * field with the name âvolatile.statusâ you only need to specify âstatusâ.
+ *
+ * @param field
+ * The name of the field
+ * @return The value of the field, or null
if there is no
+ * such field
+ */
+ public String getVolatile(String field) {
+ return getField("volatile." + field);
+ }
+
+ /**
+ * Returns one of the metadata fields from the message. The given field name
+ * is prepended with âmetadata.â so if you want to get the value of the
+ * field with the name âmetadata.timeLastRoutableâ you only need to specify
+ * âtimeLastRoutableâ.
+ *
+ * @param field
+ * The name of the field
+ * @return The value of the field, or null
if there is no
+ * such field
+ */
+ public String getMetadata(String field) {
+ return getField("metadata." + field);
+ }
+
}