X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fcore%2FNodeListener.java;h=dda0d63218b15303f0bc7c7394667f6b2f5bde03;hb=c63257e8cc0ba1a5aca9364b22171abe7279d479;hp=23f1a4c40841f367d8503f94ba2ed63e0ac136cc;hpb=7ccb1fcb746198ee1417bb2f92c846132bf6bc96;p=jSite2.git diff --git a/src/net/pterodactylus/jsite/core/NodeListener.java b/src/net/pterodactylus/jsite/core/NodeListener.java index 23f1a4c..dda0d63 100644 --- a/src/net/pterodactylus/jsite/core/NodeListener.java +++ b/src/net/pterodactylus/jsite/core/NodeListener.java @@ -23,24 +23,52 @@ 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 * 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