From: David ‘Bombe’ Roden Date: Thu, 23 Jul 2009 06:43:04 +0000 (+0200) Subject: Implement “SentFeed” response message. X-Git-Tag: v0.1.1~9 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=82f9e000ee9103bd912275b012ac7002764aaead;p=jFCPlib.git Implement “SentFeed” response message. --- diff --git a/src/net/pterodactylus/fcp/FcpAdapter.java b/src/net/pterodactylus/fcp/FcpAdapter.java index 6bb2f50..a358d4c 100644 --- a/src/net/pterodactylus/fcp/FcpAdapter.java +++ b/src/net/pterodactylus/fcp/FcpAdapter.java @@ -277,6 +277,13 @@ public class FcpAdapter implements FcpListener { /** * {@inheritDoc} */ + public void receivedSentFeed(FcpConnection source, SentFeed sentFeed) { + /* empty. */ + } + + /** + * {@inheritDoc} + */ public void receivedBookmarkFeed(FcpConnection fcpConnection, ReceivedBookmarkFeed receivedBookmarkFeed) { /* empty. */ } diff --git a/src/net/pterodactylus/fcp/FcpConnection.java b/src/net/pterodactylus/fcp/FcpConnection.java index b7129b7..2f40785 100644 --- a/src/net/pterodactylus/fcp/FcpConnection.java +++ b/src/net/pterodactylus/fcp/FcpConnection.java @@ -308,6 +308,8 @@ public class FcpConnection implements Closeable { fcpListenerManager.fireReceivedNodeHello(new NodeHello(fcpMessage)); } else if ("CloseConnectionDuplicateClientName".equals(messageName)) { fcpListenerManager.fireReceivedCloseConnectionDuplicateClientName(new CloseConnectionDuplicateClientName(fcpMessage)); + } else if ("SentFeed".equals(messageName)) { + fcpListenerManager.fireSentFeed(new SentFeed(fcpMessage)); } else if ("ReceivedBookmarkFeed".equals(messageName)) { fcpListenerManager.fireReceivedBookmarkFeed(new ReceivedBookmarkFeed(fcpMessage)); } else { diff --git a/src/net/pterodactylus/fcp/FcpListener.java b/src/net/pterodactylus/fcp/FcpListener.java index a23b7ee..4f0c77a 100644 --- a/src/net/pterodactylus/fcp/FcpListener.java +++ b/src/net/pterodactylus/fcp/FcpListener.java @@ -371,6 +371,16 @@ public interface FcpListener extends EventListener { public void receivedPutFetchable(FcpConnection fcpConnection, PutFetchable putFetchable); /** + * Notifies a listener that a feed was sent to a peer. + * + * @param source + * The connection that received the message + * @param sentFeed + * The “SentFeed” message + */ + public void receivedSentFeed(FcpConnection source, SentFeed sentFeed); + + /** * Notifies a listener that a bookmark was updated. * * @param fcpConnection diff --git a/src/net/pterodactylus/fcp/FcpListenerManager.java b/src/net/pterodactylus/fcp/FcpListenerManager.java index 11509bf..4e1cce6 100644 --- a/src/net/pterodactylus/fcp/FcpListenerManager.java +++ b/src/net/pterodactylus/fcp/FcpListenerManager.java @@ -511,6 +511,19 @@ public class FcpListenerManager extends AbstractListenerManager + *
    + *
  1. Connected
  2. + *
  3. Backed off
  4. + *
  5. Version too new
  6. + *
  7. Version too old
  8. + *
  9. Disconnected
  10. + *
  11. Never connected
  12. + *
  13. Disabled
  14. + *
  15. Bursting
  16. + *
  17. Listening
  18. + *
  19. Listening only
  20. + *
  21. Clock problem
  22. + *
  23. Connection error
  24. + *
  25. Disconnecting
  26. + *
  27. Routing disabled
  28. + *
+ * + * @return The node’s status + */ + public int getNodeStatus() { + return FcpUtils.safeParseInt(getField("NodeStatus")); + } + +}