X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fnet%2Fpterodactylus%2Futil%2Ffcp%2FFcpListener.java;h=93e3b8bda33864154a05fa4220e44e73763aa882;hb=7efea8c164769901ab87ae77864935d2351942d0;hp=2c72280ffb343ad3dd6226d987e8f8296d182e5d;hpb=9dbb34874ce7cd4fa4703f6bde00302bef2fb295;p=jSite2.git diff --git a/src/net/pterodactylus/util/fcp/FcpListener.java b/src/net/pterodactylus/util/fcp/FcpListener.java index 2c72280..93e3b8b 100644 --- a/src/net/pterodactylus/util/fcp/FcpListener.java +++ b/src/net/pterodactylus/util/fcp/FcpListener.java @@ -21,12 +21,6 @@ package net.pterodactylus.util.fcp; import java.util.EventListener; -import net.pterodactylus.util.fcp.message.CloseConnectionDuplicateClientName; -import net.pterodactylus.util.fcp.message.EndListPeers; -import net.pterodactylus.util.fcp.message.NodeHello; -import net.pterodactylus.util.fcp.message.Peer; -import net.pterodactylus.util.fcp.message.SSKKeypair; - /** * Interface for objects that want to be notified on certain FCP events. * @@ -36,7 +30,7 @@ import net.pterodactylus.util.fcp.message.SSKKeypair; public interface FcpListener extends EventListener { /** - * Notifies listeners that a “NodeHello” message was received. + * Notifies a listener that a “NodeHello” message was received. * * @param fcpConnection * The connection that received the message @@ -46,8 +40,8 @@ public interface FcpListener extends EventListener { public void receivedNodeHello(FcpConnection fcpConnection, NodeHello nodeHello); /** - * Notifies all listeners that a “CloseConnectionDuplicateClientName” - * message was received. + * Notifies a listener that a “CloseConnectionDuplicateClientName” message + * was received. * * @param fcpConnection * The connection that received the message @@ -57,7 +51,7 @@ public interface FcpListener extends EventListener { public void receivedCloseConnectionDuplicateClientName(FcpConnection fcpConnection, CloseConnectionDuplicateClientName closeConnectionDuplicateClientName); /** - * Notifies all listeners that a “SSKKeypair” message was received. + * Notifies a listener that a “SSKKeypair” message was received. * * @param fcpConnection * The connection that received themessage @@ -67,7 +61,7 @@ public interface FcpListener extends EventListener { public void receivedSSKKeypair(FcpConnection fcpConnection, SSKKeypair sskKeypair); /** - * Notifies all listeners that a “Peer” message was received. + * Notifies a listener that a “Peer” message was received. * * @param fcpConnection * The connection that received the message @@ -87,7 +81,177 @@ public interface FcpListener extends EventListener { public void receivedEndListPeers(FcpConnection fcpConnection, EndListPeers endListPeers); /** - * Notifies listeners that a message has been received. This method is only + * Notifies a listener that a “PeerNote” message was received. + * + * @param fcpConnection + * The connection that received the message + * @param peerNote + * The “PeerNote” message + */ + public void receivedPeerNote(FcpConnection fcpConnection, PeerNote peerNote); + + /** + * Notifies a listener that an “EndListPeerNotes” message was received. + * + * @param fcpConnection + * The connection that received the message + * @param endListPeerNotes + * The “EndListPeerNotes” message + */ + public void receivedEndListPeerNotes(FcpConnection fcpConnection, EndListPeerNotes endListPeerNotes); + + /** + * Notifies a listener that a “PeerRemoved” message was received. + * + * @param fcpConnection + * The connection that received the message + * @param peerRemoved + * The “PeerRemoved” message + */ + public void receivedPeerRemoved(FcpConnection fcpConnection, PeerRemoved peerRemoved); + + /** + * Notifies a listener that a “NodeData” message was received. + * + * @param fcpConnection + * The connection that received the message + * @param nodeData + * The “NodeData” message + */ + public void receivedNodeData(FcpConnection fcpConnection, NodeData nodeData); + + /** + * Notifies a listener that a “TestDDAReply” message was received. + * + * @param fcpConnection + * The connection that received the message + * @param testDDAReply + * The “TestDDAReply” message + */ + public void receivedTestDDAReply(FcpConnection fcpConnection, TestDDAReply testDDAReply); + + /** + * Notifies a listener that a “TestDDAComplete” was received. + * + * @param fcpConnection + * The connection that received the message + * @param testDDAComplete + * The “TestDDAComplete” message + */ + public void receivedTestDDAComplete(FcpConnection fcpConnection, TestDDAComplete testDDAComplete); + + /** + * Notifies a listener that a “PersistentGet” was received. + * + * @param fcpConnection + * The connection that received the message + * @param persistentGet + * The “PersistentGet” message + */ + public void receivedPersistentGet(FcpConnection fcpConnection, PersistentGet persistentGet); + + /** + * Notifies a listener that a “PersistentPut” was received. + * + * @param fcpConnection + * The connection that received the message + * @param persistentPut + * The “PersistentPut” message + */ + public void receivedPersistentPut(FcpConnection fcpConnection, PersistentPut persistentPut); + + /** + * Notifies a listener that a “EndListPersistentRequests” was received. + * + * @param fcpConnection + * The connection that received the message + * @param endListPersistentRequests + * The “EndListPersistentRequests” message + */ + public void receivedEndListPersistentRequests(FcpConnection fcpConnection, EndListPersistentRequests endListPersistentRequests); + + /** + * Notifies a listener that a “URIGenerated” was received. + * + * @param fcpConnection + * The connection that received the message + * @param uriGenerated + * The “URIGenerated” message + */ + public void receivedURIGenerated(FcpConnection fcpConnection, URIGenerated uriGenerated); + + /** + * Notifies a listener that a “DataFound” was received. + * + * @param fcpConnection + * The connection that received the message + * @param dataFound + * The “DataFound” message + */ + public void receivedDataFound(FcpConnection fcpConnection, DataFound dataFound); + + /** + * Notifies a listener that an “AllData” was received. + * + * @param fcpConnection + * The connection that received the message + * @param allData + * The “AllData” message + */ + public void receivedAllData(FcpConnection fcpConnection, AllData allData); + + /** + * Notifies a listener that a “SimpleProgress” was received. + * + * @param fcpConnection + * The connection that received the message + * @param simpleProgress + * The “SimpleProgress” message + */ + public void receivedSimpleProgress(FcpConnection fcpConnection, SimpleProgress simpleProgress); + + /** + * Notifies a listener that a “StartedCompression” was received. + * + * @param fcpConnection + * The connection that received the message + * @param startedCompression + * The “StartedCompression” message + */ + public void receivedStartedCompression(FcpConnection fcpConnection, StartedCompression startedCompression); + + /** + * Notifies a listener that a “FinishedCompression” was received. + * + * @param fcpConnection + * The connection that received the message + * @param finishedCompression + * The “FinishedCompression” message + */ + public void receviedFinishedCompression(FcpConnection fcpConnection, FinishedCompression finishedCompression); + + /** + * Notifies a listener that an “UnknownPeerNoteType” was received. + * + * @param fcpConnection + * The connection that received the message + * @param unknownPeerNoteType + * The “UnknownPeerNoteType” message + */ + public void receivedUnknownPeerNoteType(FcpConnection fcpConnection, UnknownPeerNoteType unknownPeerNoteType); + + /** + * Notifies a listener that a “ProtocolError” was received. + * + * @param fcpConnection + * The connection that received the message + * @param protocolError + * The “ProtocolError” message + */ + public void receivedProtocolError(FcpConnection fcpConnection, ProtocolError protocolError); + + /** + * Notifies a listener 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! *