From 4d849ec50a85129aa5259be84f4ffb3dbdd579e4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 22 Jul 2009 08:11:10 +0200 Subject: [PATCH] =?utf8?q?Implement=20the=20=E2=80=9CReceivedBookmarkFeed?= =?utf8?q?=E2=80=9D=20message.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/net/pterodactylus/fcp/FcpAdapter.java | 7 ++ src/net/pterodactylus/fcp/FcpConnection.java | 2 + src/net/pterodactylus/fcp/FcpListener.java | 10 +++ src/net/pterodactylus/fcp/FcpListenerManager.java | 15 +++++ .../pterodactylus/fcp/ReceivedBookmarkFeed.java | 78 ++++++++++++++++++++++ 5 files changed, 112 insertions(+) create mode 100644 src/net/pterodactylus/fcp/ReceivedBookmarkFeed.java diff --git a/src/net/pterodactylus/fcp/FcpAdapter.java b/src/net/pterodactylus/fcp/FcpAdapter.java index ae32e62..09ff696 100644 --- a/src/net/pterodactylus/fcp/FcpAdapter.java +++ b/src/net/pterodactylus/fcp/FcpAdapter.java @@ -278,6 +278,13 @@ public class FcpAdapter implements FcpListener { /** * {@inheritDoc} */ + public void receivedBookmarkFeed(FcpConnection fcpConnection, ReceivedBookmarkFeed receivedBookmarkFeed) { + /* empty. */ + } + + /** + * {@inheritDoc} + */ public void receivedMessage(FcpConnection fcpConnection, FcpMessage fcpMessage) { /* empty. */ } diff --git a/src/net/pterodactylus/fcp/FcpConnection.java b/src/net/pterodactylus/fcp/FcpConnection.java index 3329063..d4271a5 100644 --- a/src/net/pterodactylus/fcp/FcpConnection.java +++ b/src/net/pterodactylus/fcp/FcpConnection.java @@ -309,6 +309,8 @@ public class FcpConnection implements Closeable { fcpListenerManager.fireReceivedNodeHello(new NodeHello(fcpMessage)); } else if ("CloseConnectionDuplicateClientName".equals(messageName)) { fcpListenerManager.fireReceivedCloseConnectionDuplicateClientName(new CloseConnectionDuplicateClientName(fcpMessage)); + } else if ("ReceivedBookmarkFeed".equals(messageName)) { + fcpListenerManager.fireReceivedBookmarkFeed(new ReceivedBookmarkFeed(fcpMessage)); } else { fcpListenerManager.fireMessageReceived(fcpMessage); } diff --git a/src/net/pterodactylus/fcp/FcpListener.java b/src/net/pterodactylus/fcp/FcpListener.java index 20b4d9b..151fcfe 100644 --- a/src/net/pterodactylus/fcp/FcpListener.java +++ b/src/net/pterodactylus/fcp/FcpListener.java @@ -372,6 +372,16 @@ public interface FcpListener extends EventListener { public void receivedPutFetchable(FcpConnection fcpConnection, PutFetchable putFetchable); /** + * Notifies a listener that a bookmark was updated. + * + * @param fcpConnection + * The connection that received the message + * @param receivedBookmarkFeed + * The “ReceivedBookmarkFeed” message + */ + public void receivedBookmarkFeed(FcpConnection fcpConnection, ReceivedBookmarkFeed receivedBookmarkFeed); + + /** * Notifies a listener that a “ProtocolError” was received. * * @param fcpConnection diff --git a/src/net/pterodactylus/fcp/FcpListenerManager.java b/src/net/pterodactylus/fcp/FcpListenerManager.java index 1a8a13c..f2d8133 100644 --- a/src/net/pterodactylus/fcp/FcpListenerManager.java +++ b/src/net/pterodactylus/fcp/FcpListenerManager.java @@ -512,6 +512,21 @@ public class FcpListenerManager extends AbstractListenerManager