From: David ‘Bombe’ Roden Date: Wed, 18 Nov 2009 20:14:01 +0000 (+0100) Subject: Store the NodeHello response and expose it. X-Git-Tag: v0.1.1~1 X-Git-Url: https://git.pterodactylus.net/?p=jFCPlib.git;a=commitdiff_plain;h=2d2cb653da15b89e3161f5026c4778e08a8bff0a Store the NodeHello response and expose it. --- diff --git a/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java b/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java index 3012e00..5bf4e1a 100644 --- a/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java +++ b/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java @@ -89,6 +89,9 @@ public class FcpClient { /** The underlying FCP connection. */ private final FcpConnection fcpConnection; + /** The {@link NodeHello} data sent by the node on connection. */ + private volatile NodeHello nodeHello; + /** Whether the client is currently connected. */ private volatile boolean connected; @@ -218,6 +221,20 @@ public class FcpClient { } // + // ACCESSORS + // + + /** + * Returns the {@link NodeHello} object that the node returned when + * connecting. + * + * @return The {@code NodeHello} data container + */ + public NodeHello getNodeHello() { + return nodeHello; + } + + // // ACTIONS // @@ -251,8 +268,10 @@ public class FcpClient { * {@inheritDoc} */ @Override + @SuppressWarnings("synthetic-access") public void receivedNodeHello(FcpConnection fcpConnection, NodeHello nodeHello) { completionLatch.countDown(); + FcpClient.this.nodeHello = nodeHello; } }.execute(); }