X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fnet%2Fpterodactylus%2Futil%2Ffcp%2FFcpConnection.java;h=ba167d1f884162e2662bee0f84823cdec33f0942;hb=d52efb700e50a4beebe9b0954dfef70041618901;hp=a8b6024213c97314b2792951e79f42ed8be7b56b;hpb=a1d90ea4e35f7f4f03b352216a1fca37c8e99037;p=jSite2.git diff --git a/src/net/pterodactylus/util/fcp/FcpConnection.java b/src/net/pterodactylus/util/fcp/FcpConnection.java index a8b6024..ba167d1 100644 --- a/src/net/pterodactylus/util/fcp/FcpConnection.java +++ b/src/net/pterodactylus/util/fcp/FcpConnection.java @@ -28,13 +28,6 @@ import java.net.UnknownHostException; import java.util.ArrayList; import java.util.List; -import net.pterodactylus.util.fcp.message.CloseConnectionDuplicateClientName; -import net.pterodactylus.util.fcp.message.EndListPeerNotes; -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.PeerNote; -import net.pterodactylus.util.fcp.message.SSKKeypair; import net.pterodactylus.util.io.Closer; /** @@ -240,6 +233,19 @@ public class FcpConnection { } /** + * Notifies all listeners that a “PeerRemoved” message was received. + * + * @see FcpListener#receviedPeerRemoved(FcpConnection, PeerRemoved) + * @param peerRemoved + * The “PeerRemoved” message + */ + private void fireReceivedPeerRemoved(PeerRemoved peerRemoved) { + for (FcpListener fcpListener: fcpListeners) { + fcpListener.receviedPeerRemoved(this, peerRemoved); + } + } + + /** * Notifies all registered listeners that a message has been received. * * @see FcpListener#receivedMessage(FcpConnection, FcpMessage) @@ -323,6 +329,8 @@ public class FcpConnection { fireReceivedEndListPeers(new EndListPeers(fcpMessage)); } else if ("SSKKeypair".equals(messageName)) { fireReceivedSSKKeypair(new SSKKeypair(fcpMessage)); + } else if ("PeerRemoved".equals(messageName)) { + fireReceivedPeerRemoved(new PeerRemoved(fcpMessage)); } else if ("NodeHello".equals(messageName)) { fireReceivedNodeHello(new NodeHello(fcpMessage)); } else if ("CloseConnectionDuplicateClientName".equals(messageName)) {