X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Futil%2Ffcp%2FFcpListener.java;h=a983f883eb14f176ea31eb6a578d9951f0931e4e;hb=fba184e707edc02ac0f7fc89a4378549a4602476;hp=e3d6d007ddfa7f0f643b8f1a34f43da4a5b0fcc7;hpb=90f3a1c8e0c85f19c82130e49d7a605cb9e55286;p=jSite2.git diff --git a/src/net/pterodactylus/util/fcp/FcpListener.java b/src/net/pterodactylus/util/fcp/FcpListener.java index e3d6d00..a983f88 100644 --- a/src/net/pterodactylus/util/fcp/FcpListener.java +++ b/src/net/pterodactylus/util/fcp/FcpListener.java @@ -20,25 +20,60 @@ package net.pterodactylus.util.fcp; import java.util.EventListener; -import java.util.Map; +import net.pterodactylus.util.fcp.message.CloseConnectionDuplicateClientName; +import net.pterodactylus.util.fcp.message.NodeHello; +import net.pterodactylus.util.fcp.message.SSKKeypair; /** - * TODO + * Interface for objects that want to be notified on certain FCP events. + * * @author David ‘Bombe’ Roden <bombe@freenetproject.org> * @version $Id$ */ public interface FcpListener extends EventListener { - public void fcpConnected(FcpConnection fcpConnection); - public void fcpDisconnected(FcpConnection fcpConnection); - - // - // connection setup - // - - public void fcpNodeHello(FcpConnection fcpConnection, Map nodeProperties); - public void fcpCloseConnectionDuplicateName(FcpConnection fcpConnection); - - + /** + * Notifies listeners that a “NodeHello” message was received. + * + * @param fcpConnection + * The connection that received the message + * @param nodeHello + * The “NodeHello” message + */ + public void receivedNodeHello(FcpConnection fcpConnection, NodeHello nodeHello); + + /** + * Notifies all listeners that a “CloseConnectionDuplicateClientName” + * message was received. + * + * @param fcpConnection + * The connection that received the message + * @param closeConnectionDuplicateClientName + * The “CloseConnectionDuplicateClientName” message + */ + public void receivedCloseConnectionDuplicateClientName(FcpConnection fcpConnection, CloseConnectionDuplicateClientName closeConnectionDuplicateClientName); + + /** + * Notifies all listeners that a “SSKKeypair” message was received. + * + * @param fcpConnection + * The connection that received themessage + * @param sskKeypair + * The “SSKKeypair” message + */ + public void receivedSSKKeypair(FcpConnection fcpConnection, SSKKeypair sskKeypair); + + /** + * Notifies listeners that a message has been received. This method is only + * called if {@link FcpConnection#handleMessage(FcpMessage)} does not + * recognize the message. Should that ever happen, please file a bug report! + * + * @param fcpConnection + * The connection that received the message + * @param fcpMessage + * The message that was received + */ + public void receivedMessage(FcpConnection fcpConnection, FcpMessage fcpMessage); + }