}
/**
+ * {@inheritDoc}
+ *
+ * @see FcpListener#receivedNodeData(net.pterodactylus.util.fcp.FcpConnection,
+ * net.pterodactylus.util.fcp.NodeData)
+ */
+ public void receivedNodeData(FcpConnection fcpConnection, NodeData nodeData) {
+ /* empty. */
+ }
+
+ /**
* @see net.pterodactylus.util.fcp.FcpListener#receivedMessage(net.pterodactylus.util.fcp.FcpConnection,
* net.pterodactylus.util.fcp.FcpMessage)
*/
}
/**
+ * Notifies all listeners that a “NodeData” message was received.
+ *
+ * @see FcpListener#receivedNodeData(FcpConnection, NodeData)
+ * @param nodeData
+ * The “NodeData” message
+ */
+ private void fireReceivedNodeData(NodeData nodeData) {
+ for (FcpListener fcpListener: fcpListeners) {
+ fcpListener.receivedNodeData(this, nodeData);
+ }
+ }
+
+ /**
* Notifies all registered listeners that a message has been received.
*
* @see FcpListener#receivedMessage(FcpConnection, FcpMessage)
fireReceivedSSKKeypair(new SSKKeypair(fcpMessage));
} else if ("PeerRemoved".equals(messageName)) {
fireReceivedPeerRemoved(new PeerRemoved(fcpMessage));
+ } else if ("NodeData".equals(messageName)) {
+ fireReceivedNodeData(new NodeData(fcpMessage));
} else if ("NodeHello".equals(messageName)) {
fireReceivedNodeHello(new NodeHello(fcpMessage));
} else if ("CloseConnectionDuplicateClientName".equals(messageName)) {
public void receviedPeerRemoved(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 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!