From 2d2cb653da15b89e3161f5026c4778e08a8bff0a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 18 Nov 2009 21:14:01 +0100 Subject: [PATCH] Store the NodeHello response and expose it. --- .../net/pterodactylus/fcp/highlevel/FcpClient.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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(); } -- 2.7.4