whitespace fixups
[jSite2.git] / src / net / pterodactylus / jsite / core / NodeListener.java
index 80a01ce..dda0d63 100644 (file)
@@ -25,11 +25,26 @@ import java.util.EventListener;
  * Interface for listeners that want to be notified about node events.
  *
  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
- * @version $Id$
  */
 public interface NodeListener extends EventListener {
 
        /**
+        * Notifies a listener that a node was added.
+        *
+        * @param node
+        *            The node that was added
+        */
+       public void nodeAdded(Node node);
+
+       /**
+        * Notifies a listener that a node was removed.
+        *
+        * @param node
+        *            The node that was removed
+        */
+       public void nodeRemoved(Node node);
+
+       /**
         * Notifies a listener that a connection to the given node was established.
         *
         * @param node
@@ -38,8 +53,21 @@ public interface NodeListener extends EventListener {
        public void nodeConnected(Node node);
 
        /**
-        * Notifies a listener that a connection to the given node was severed. The
-        * listener is responsible for
+        * Notifies a listener that a connection to a node has failed.
+        *
+        * @param node
+        *            The node that could not be connected
+        * @param cause
+        *            The cause of the failure
+        */
+       public void nodeConnectionFailed(Node node, Throwable cause);
+
+       /**
+        * Notifies a listener that a connection to the given node was severed. If
+        * the listener needs the high-level client associated with the node for
+        * anything else (like deregistering as listener from it) it should retrieve
+        * the high-level client using {@link NodeManager#getHighLevelClient(Node)}
+        * before this method returns!
         *
         * @param node
         *            The node that is now disconnected