From: David ‘Bombe’ Roden Date: Thu, 10 Apr 2008 11:30:35 +0000 (+0000) Subject: add EndListPersistentRequests X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=40e956e19d54642145c71764cdc0eeea89d97607;p=jSite2.git add EndListPersistentRequests git-svn-id: http://trooper/svn/projects/jSite/trunk@691 c3eda9e8-030b-0410-8277-bc7414b0a119 --- diff --git a/src/net/pterodactylus/util/fcp/EndListPersistentRequests.java b/src/net/pterodactylus/util/fcp/EndListPersistentRequests.java new file mode 100644 index 0000000..b43abe7 --- /dev/null +++ b/src/net/pterodactylus/util/fcp/EndListPersistentRequests.java @@ -0,0 +1,26 @@ +/** + * © 2008 INA Service GmbH + */ +package net.pterodactylus.util.fcp; + +/** + * The “EndListPersistentRequests” message signals the end of a list of + * {@link PersistentGet} and {@link PersistentPut} requests. + * + * @author David Roden + * @version $Id$ + */ +public class EndListPersistentRequests extends BaseMessage { + + /** + * Creates a new “EndListPersistentRequests” message that wraps the received + * message. + * + * @param receivedMessage + * The received message + */ + public EndListPersistentRequests(FcpMessage receivedMessage) { + super(receivedMessage); + } + +} diff --git a/src/net/pterodactylus/util/fcp/FcpAdapter.java b/src/net/pterodactylus/util/fcp/FcpAdapter.java index a1bec35..3ffe986 100644 --- a/src/net/pterodactylus/util/fcp/FcpAdapter.java +++ b/src/net/pterodactylus/util/fcp/FcpAdapter.java @@ -112,6 +112,14 @@ public class FcpAdapter implements FcpListener { } /** + * @see net.pterodactylus.util.fcp.FcpListener#receivedEndListPersistentRequests(net.pterodactylus.util.fcp.FcpConnection, + * net.pterodactylus.util.fcp.EndListPersistentRequests) + */ + public void receivedEndListPersistentRequests(FcpConnection fcpConnection, EndListPersistentRequests endListPersistentRequests) { + /* empty. */ + } + + /** * @see net.pterodactylus.util.fcp.FcpListener#receivedProtocolError(net.pterodactylus.util.fcp.FcpConnection, * net.pterodactylus.util.fcp.ProtocolError) */ diff --git a/src/net/pterodactylus/util/fcp/FcpConnection.java b/src/net/pterodactylus/util/fcp/FcpConnection.java index 157093a..9c88ea9 100644 --- a/src/net/pterodactylus/util/fcp/FcpConnection.java +++ b/src/net/pterodactylus/util/fcp/FcpConnection.java @@ -298,6 +298,19 @@ public class FcpConnection { } /** + * Notifies all listeners that a “EndListPersistentRequests” message was + * received. + * + * @param endListPersistentRequests + * The “EndListPersistentRequests” message + */ + private void fireReceivedEndListPersistentRequests(EndListPersistentRequests endListPersistentRequests) { + for (FcpListener fcpListener: fcpListeners) { + fcpListener.receivedEndListPersistentRequests(this, endListPersistentRequests); + } + } + + /** * Notifies all listeners that a “ProtocolError” message was received. * * @param protocolError @@ -387,6 +400,8 @@ public class FcpConnection { fireReceivedProtocolError(new ProtocolError(fcpMessage)); } else if ("PersistentPut".equals(messageName)) { fireReceivedPersistentPut(new PersistentPut(fcpMessage)); + } else if ("EndListPersistentRequests".equals(messageName)) { + fireReceivedEndListPersistentRequests(new EndListPersistentRequests(fcpMessage)); } else if ("Peer".equals(messageName)) { fireReceivedPeer(new Peer(fcpMessage)); } else if ("PeerNote".equals(messageName)) { diff --git a/src/net/pterodactylus/util/fcp/FcpListener.java b/src/net/pterodactylus/util/fcp/FcpListener.java index 928cdc9..70e834a 100644 --- a/src/net/pterodactylus/util/fcp/FcpListener.java +++ b/src/net/pterodactylus/util/fcp/FcpListener.java @@ -151,6 +151,16 @@ public interface FcpListener extends EventListener { public void receivedPersistentPut(FcpConnection fcpConnection, PersistentPut persistentPut); /** + * Notifies a listener that a “EndListPersistentRequests” was received. + * + * @param fcpConnection + * The connection that received the message + * @param endListPersistentRequests + * The “EndListPersistentRequests” message + */ + public void receivedEndListPersistentRequests(FcpConnection fcpConnection, EndListPersistentRequests endListPersistentRequests); + + /** * Notifies a listener that a “ProtocolError” was received. * * @param fcpConnection