remove $Id$ keyword
[jFCPlib.git] / src / net / pterodactylus / fcp / FcpConnection.java
index d1a1be7..efba297 100644 (file)
@@ -36,9 +36,8 @@ import java.util.logging.Logger;
 
 /**
  * An FCP connection to a Freenet node.
- *
+ * 
  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
- * @version $Id$
  */
 public class FcpConnection implements Closeable {
 
@@ -75,7 +74,7 @@ public class FcpConnection implements Closeable {
        /**
         * Creates a new FCP connection to the freenet node running on localhost,
         * using the default port.
-        *
+        * 
         * @throws UnknownHostException
         *             if the hostname can not be resolved
         */
@@ -86,7 +85,7 @@ public class FcpConnection implements Closeable {
        /**
         * Creates a new FCP connection to the Freenet node running on the given
         * host, listening on the default port.
-        *
+        * 
         * @param host
         *            The hostname of the Freenet node
         * @throws UnknownHostException
@@ -99,7 +98,7 @@ public class FcpConnection implements Closeable {
        /**
         * Creates a new FCP connection to the Freenet node running on the given
         * host, listening on the given port.
-        *
+        * 
         * @param host
         *            The hostname of the Freenet node
         * @param port
@@ -114,7 +113,7 @@ public class FcpConnection implements Closeable {
        /**
         * Creates a new FCP connection to the Freenet node running at the given
         * address, listening on the default port.
-        *
+        * 
         * @param address
         *            The address of the Freenet node
         */
@@ -125,7 +124,7 @@ public class FcpConnection implements Closeable {
        /**
         * Creates a new FCP connection to the Freenet node running at the given
         * address, listening on the given port.
-        *
+        * 
         * @param address
         *            The address of the Freenet node
         * @param port
@@ -142,7 +141,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Adds the given listener to the list of listeners.
-        *
+        * 
         * @param fcpListener
         *            The listener to add
         */
@@ -152,7 +151,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Removes the given listener from the list of listeners.
-        *
+        * 
         * @param fcpListener
         *            The listener to remove
         */
@@ -162,7 +161,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies listeners that a “NodeHello” message was received.
-        *
+        * 
         * @see FcpListener#receivedNodeHello(FcpConnection, NodeHello)
         * @param nodeHello
         *            The “NodeHello” message
@@ -176,7 +175,7 @@ public class FcpConnection implements Closeable {
        /**
         * Notifies listeners that a “CloseConnectionDuplicateClientName” message
         * was received.
-        *
+        * 
         * @see FcpListener#receivedCloseConnectionDuplicateClientName(FcpConnection,
         *      CloseConnectionDuplicateClientName)
         * @param closeConnectionDuplicateClientName
@@ -190,7 +189,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies listeners that a “SSKKeypair” message was received.
-        *
+        * 
         * @see FcpListener#receivedSSKKeypair(FcpConnection, SSKKeypair)
         * @param sskKeypair
         *            The “SSKKeypair” message
@@ -203,7 +202,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies listeners that a “Peer” message was received.
-        *
+        * 
         * @see FcpListener#receivedPeer(FcpConnection, Peer)
         * @param peer
         *            The “Peer” message
@@ -216,7 +215,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that an “EndListPeers” message was received.
-        *
+        * 
         * @see FcpListener#receivedEndListPeers(FcpConnection, EndListPeers)
         * @param endListPeers
         *            The “EndListPeers” message
@@ -229,7 +228,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “PeerNote” message was received.
-        *
+        * 
         * @see FcpListener#receivedPeerNote(FcpConnection, PeerNote)
         * @param peerNote
         */
@@ -241,7 +240,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that an “EndListPeerNotes” message was received.
-        *
+        * 
         * @see FcpListener#receivedEndListPeerNotes(FcpConnection,
         *      EndListPeerNotes)
         * @param endListPeerNotes
@@ -255,7 +254,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “PeerRemoved” message was received.
-        *
+        * 
         * @see FcpListener#receivedPeerRemoved(FcpConnection, PeerRemoved)
         * @param peerRemoved
         *            The “PeerRemoved” message
@@ -268,7 +267,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “NodeData” message was received.
-        *
+        * 
         * @see FcpListener#receivedNodeData(FcpConnection, NodeData)
         * @param nodeData
         *            The “NodeData” message
@@ -281,7 +280,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “TestDDAReply” message was received.
-        *
+        * 
         * @see FcpListener#receivedTestDDAReply(FcpConnection, TestDDAReply)
         * @param testDDAReply
         *            The “TestDDAReply” message
@@ -294,7 +293,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “TestDDAComplete” message was received.
-        *
+        * 
         * @see FcpListener#receivedTestDDAComplete(FcpConnection, TestDDAComplete)
         * @param testDDAComplete
         *            The “TestDDAComplete” message
@@ -307,7 +306,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “PersistentGet” message was received.
-        *
+        * 
         * @see FcpListener#receivedPersistentGet(FcpConnection, PersistentGet)
         * @param persistentGet
         *            The “PersistentGet” message
@@ -320,7 +319,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “PersistentPut” message was received.
-        *
+        * 
         * @see FcpListener#receivedPersistentPut(FcpConnection, PersistentPut)
         * @param persistentPut
         *            The “PersistentPut” message
@@ -334,7 +333,7 @@ public class FcpConnection implements Closeable {
        /**
         * Notifies all listeners that a “EndListPersistentRequests” message was
         * received.
-        *
+        * 
         * @see FcpListener#receivedEndListPersistentRequests(FcpConnection,
         *      EndListPersistentRequests)
         * @param endListPersistentRequests
@@ -348,7 +347,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “URIGenerated” message was received.
-        *
+        * 
         * @see FcpListener#receivedURIGenerated(FcpConnection, URIGenerated)
         * @param uriGenerated
         *            The “URIGenerated” message
@@ -361,7 +360,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “DataFound” message was received.
-        *
+        * 
         * @see FcpListener#receivedDataFound(FcpConnection, DataFound)
         * @param dataFound
         *            The “DataFound” message
@@ -374,7 +373,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that an “AllData” message was received.
-        *
+        * 
         * @see FcpListener#receivedAllData(FcpConnection, AllData)
         * @param allData
         *            The “AllData” message
@@ -387,7 +386,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “SimpleProgress” message was received.
-        *
+        * 
         * @see FcpListener#receivedSimpleProgress(FcpConnection, SimpleProgress)
         * @param simpleProgress
         *            The “SimpleProgress” message
@@ -400,7 +399,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “StartedCompression” message was received.
-        *
+        * 
         * @see FcpListener#receivedStartedCompression(FcpConnection,
         *      StartedCompression)
         * @param startedCompression
@@ -414,7 +413,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “FinishedCompression” message was received.
-        *
+        * 
         * @see FcpListener#receviedFinishedCompression(FcpConnection,
         *      FinishedCompression)
         * @param finishedCompression
@@ -429,7 +428,7 @@ public class FcpConnection implements Closeable {
        /**
         * Notifies all listeners that an “UnknownPeerNoteType” message was
         * received.
-        *
+        * 
         * @see FcpListener#receivedUnknownPeerNoteType(FcpConnection,
         *      UnknownPeerNoteType)
         * @param unknownPeerNoteType
@@ -444,7 +443,7 @@ public class FcpConnection implements Closeable {
        /**
         * Notifies all listeners that an “UnknownNodeIdentifier” message was
         * received.
-        *
+        * 
         * @see FcpListener#receivedUnknownNodeIdentifier(FcpConnection,
         *      UnknownNodeIdentifier)
         * @param unknownNodeIdentifier
@@ -458,7 +457,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “ConfigData” message was received.
-        *
+        * 
         * @see FcpListener#receivedConfigData(FcpConnection, ConfigData)
         * @param configData
         *            The “ConfigData” message
@@ -471,7 +470,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “GetFailed” message was received.
-        *
+        * 
         * @see FcpListener#receivedGetFailed(FcpConnection, GetFailed)
         * @param getFailed
         *            The “GetFailed” message
@@ -484,7 +483,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “PutFailed” message was received.
-        *
+        * 
         * @see FcpListener#receivedPutFailed(FcpConnection, PutFailed)
         * @param putFailed
         *            The “PutFailed” message
@@ -498,7 +497,7 @@ public class FcpConnection implements Closeable {
        /**
         * Notifies all listeners that an “IdentifierCollision” message was
         * received.
-        *
+        * 
         * @see FcpListener#receivedIdentifierCollision(FcpConnection,
         *      IdentifierCollision)
         * @param identifierCollision
@@ -512,7 +511,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that an “PersistentPutDir” message was received.
-        *
+        * 
         * @see FcpListener#receivedPersistentPutDir(FcpConnection,
         *      PersistentPutDir)
         * @param persistentPutDir
@@ -527,7 +526,7 @@ public class FcpConnection implements Closeable {
        /**
         * Notifies all listeners that a “PersistentRequestRemoved” message was
         * received.
-        *
+        * 
         * @see FcpListener#receivedPersistentRequestRemoved(FcpConnection,
         *      PersistentRequestRemoved)
         * @param persistentRequestRemoved
@@ -541,7 +540,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “SubscribedUSKUpdate” message was received.
-        *
+        * 
         * @see FcpListener#receivedSubscribedUSKUpdate(FcpConnection,
         *      SubscribedUSKUpdate)
         * @param subscribedUSKUpdate
@@ -555,7 +554,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “PluginInfo” message was received.
-        *
+        * 
         * @see FcpListener#receivedPluginInfo(FcpConnection, PluginInfo)
         * @param pluginInfo
         *            The “PluginInfo” message
@@ -568,7 +567,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that an “FCPPluginReply” message was received.
-        *
+        * 
         * @see FcpListener#receivedFCPPluginReply(FcpConnection, FCPPluginReply)
         * @param fcpPluginReply
         *            The “FCPPluginReply” message
@@ -582,7 +581,7 @@ public class FcpConnection implements Closeable {
        /**
         * Notifies all listeners that a “PersistentRequestModified” message was
         * received.
-        *
+        * 
         * @see FcpListener#receivedPersistentRequestModified(FcpConnection,
         *      PersistentRequestModified)
         * @param persistentRequestModified
@@ -596,7 +595,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “PutSuccessful” message was received.
-        *
+        * 
         * @see FcpListener#receivedPutSuccessful(FcpConnection, PutSuccessful)
         * @param putSuccessful
         *            The “PutSuccessful” message
@@ -609,7 +608,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “PutFetchable” message was received.
-        *
+        * 
         * @see FcpListener#receivedPutFetchable(FcpConnection, PutFetchable)
         * @param putFetchable
         *            The “PutFetchable” message
@@ -622,7 +621,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that a “ProtocolError” message was received.
-        *
+        * 
         * @see FcpListener#receivedProtocolError(FcpConnection, ProtocolError)
         * @param protocolError
         *            The “ProtocolError” message
@@ -635,7 +634,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all registered listeners that a message has been received.
-        *
+        * 
         * @see FcpListener#receivedMessage(FcpConnection, FcpMessage)
         * @param fcpMessage
         *            The message that was received
@@ -648,7 +647,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Notifies all listeners that the connection to the node was closed.
-        *
+        * 
         * @param throwable
         *            The exception that caused the disconnect, or <code>null</code>
         *            if there was no exception
@@ -666,7 +665,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Connects to the node.
-        *
+        * 
         * @throws IOException
         *             if an I/O error occurs
         * @throws IllegalStateException
@@ -686,7 +685,7 @@ public class FcpConnection implements Closeable {
        /**
         * Disconnects from the node. If there is no connection to the node, this
         * method does nothing.
-        *
+        * 
         * @deprecated Use {@link #close()} instead
         */
        @Deprecated
@@ -704,7 +703,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Sends the given FCP message.
-        *
+        * 
         * @param fcpMessage
         *            The FCP message to send
         * @throws IOException
@@ -722,7 +721,7 @@ public class FcpConnection implements Closeable {
        /**
         * Handles the given message, notifying listeners. This message should only
         * be called by {@link FcpConnectionHandler}.
-        *
+        * 
         * @param fcpMessage
         *            The received message
         */
@@ -819,7 +818,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Handles a disconnect from the node.
-        *
+        * 
         * @param throwable
         *            The exception that caused the disconnect, or <code>null</code>
         *            if there was no exception
@@ -842,7 +841,7 @@ public class FcpConnection implements Closeable {
        /**
         * Incremets the counter in {@link #incomingMessageStatistics} by <cod>1</code>
         * for the given message name.
-        *
+        * 
         * @param name
         *            The name of the message to count
         */
@@ -857,7 +856,7 @@ public class FcpConnection implements Closeable {
 
        /**
         * Returns a limited input stream from the node’s input stream.
-        *
+        * 
         * @param dataLength
         *            The length of the stream
         * @return The limited input stream
@@ -872,9 +871,8 @@ public class FcpConnection implements Closeable {
        /**
         * A wrapper around an {@link InputStream} that only supplies a limit number
         * of bytes from the underlying input stream.
-        *
+        * 
         * @author <a href="mailto:dr@ina-germany.de">David Roden</a>
-        * @version $Id$
         */
        private static class LimitedInputStream extends FilterInputStream {
 
@@ -884,7 +882,7 @@ public class FcpConnection implements Closeable {
                /**
                 * Creates a new LimitedInputStream that supplies at most
                 * <code>length</code> bytes from the given input stream.
-                *
+                * 
                 * @param inputStream
                 *            The input stream
                 * @param length
@@ -949,7 +947,7 @@ public class FcpConnection implements Closeable {
                /**
                 * {@inheritDoc} This method does nothing, as {@link #mark(int)} and
                 * {@link #reset()} are not supported.
-                *
+                * 
                 * @see java.io.FilterInputStream#mark(int)
                 */
                @Override
@@ -959,7 +957,7 @@ public class FcpConnection implements Closeable {
 
                /**
                 * {@inheritDoc}
-                *
+                * 
                 * @see java.io.FilterInputStream#markSupported()
                 * @return <code>false</code>
                 */
@@ -971,7 +969,7 @@ public class FcpConnection implements Closeable {
                /**
                 * {@inheritDoc} This method does nothing, as {@link #mark(int)} and
                 * {@link #reset()} are not supported.
-                *
+                * 
                 * @see java.io.FilterInputStream#reset()
                 */
                @Override
@@ -982,7 +980,7 @@ public class FcpConnection implements Closeable {
                /**
                 * Consumes the input stream, i.e. read all bytes until the limit is
                 * reached.
-                *
+                * 
                 * @throws IOException
                 *             if an I/O error occurs
                 */