X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=inline;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fcore%2FNodeListener.java;h=11989693ea2e83cbc9cabf3bcd2aadc3505b22d8;hb=8eab1a3975c251c4820988f3fdecbf9b113d9171;hp=80a01ce800d5b7a8d087f6c266828f0dcc31bbdb;hpb=4be8c6526b4e80d5b8f8df8598da128be766ced7;p=jSite2.git diff --git a/src/net/pterodactylus/jsite/core/NodeListener.java b/src/net/pterodactylus/jsite/core/NodeListener.java index 80a01ce..1198969 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