add EndListPersistentRequests
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 10 Apr 2008 11:30:35 +0000 (11:30 +0000)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 10 Apr 2008 11:30:35 +0000 (11:30 +0000)
git-svn-id: http://trooper/svn/projects/jSite/trunk@691 c3eda9e8-030b-0410-8277-bc7414b0a119

src/net/pterodactylus/util/fcp/EndListPersistentRequests.java [new file with mode: 0644]
src/net/pterodactylus/util/fcp/FcpAdapter.java
src/net/pterodactylus/util/fcp/FcpConnection.java
src/net/pterodactylus/util/fcp/FcpListener.java

diff --git a/src/net/pterodactylus/util/fcp/EndListPersistentRequests.java b/src/net/pterodactylus/util/fcp/EndListPersistentRequests.java
new file mode 100644 (file)
index 0000000..b43abe7
--- /dev/null
@@ -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 <a href="mailto:dr@ina-germany.de">David Roden</a>
+ * @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);
+       }
+
+}
index a1bec35..3ffe986 100644 (file)
@@ -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)
         */
index 157093a..9c88ea9 100644 (file)
@@ -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)) {
index 928cdc9..70e834a 100644 (file)
@@ -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