whitespace fixups
[jSite2.git] / src / net / pterodactylus / jsite / core / NodeListener.java
index 95254c1..dda0d63 100644 (file)
@@ -23,15 +23,14 @@ 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
         */
@@ -39,7 +38,7 @@ public interface NodeListener extends EventListener {
 
        /**
         * Notifies a listener that a node was removed.
-        * 
+        *
         * @param node
         *            The node that was removed
         */
@@ -47,16 +46,29 @@ public interface NodeListener extends EventListener {
 
        /**
         * Notifies a listener that a connection to the given node was established.
-        * 
+        *
         * @param node
         *            The node that is now connected
         */
        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
         * @param throwable