From 224e0341bbc4402ca25493d465e2a68c66815114 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Fri, 22 Nov 2019 14:10:10 -0500 Subject: [Update] More methods to impliment so that everyone plays nice + Unlinkers for nodes + Get connections for nodes Signed-off-by: Kyle Gunger --- src/main/java/net/transit/network/system/Node.java | 6 ++++++ .../java/net/transit/network/system/swap/AcceptorNode.java | 10 +++++++++- .../java/net/transit/network/system/swap/ProviderNode.java | 9 +++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/net/transit/network/system/Node.java b/src/main/java/net/transit/network/system/Node.java index 9e9ac10..9ab9812 100644 --- a/src/main/java/net/transit/network/system/Node.java +++ b/src/main/java/net/transit/network/system/Node.java @@ -27,4 +27,10 @@ public interface Node * @return */ public Object getData(String groupID); + + /** Get the nodes that this node is connected to + * + * @return Node[] + */ + public Node[] getConnections(); } diff --git a/src/main/java/net/transit/network/system/swap/AcceptorNode.java b/src/main/java/net/transit/network/system/swap/AcceptorNode.java index c583146..69c07e7 100644 --- a/src/main/java/net/transit/network/system/swap/AcceptorNode.java +++ b/src/main/java/net/transit/network/system/swap/AcceptorNode.java @@ -10,11 +10,19 @@ public interface AcceptorNode extends Node * * @param requester The object to be a provider * @param group - * @return Provider + * @return */ public boolean linkProvider(Node requestor, String group); + /** Unlink a provider from the acceptor + * + * @param toUnlink + * @return + */ + public boolean unlinkProvider(Node toUnlink); + + /** * @return Node[] */ diff --git a/src/main/java/net/transit/network/system/swap/ProviderNode.java b/src/main/java/net/transit/network/system/swap/ProviderNode.java index 4cd9dba..1ba1ef3 100644 --- a/src/main/java/net/transit/network/system/swap/ProviderNode.java +++ b/src/main/java/net/transit/network/system/swap/ProviderNode.java @@ -12,6 +12,15 @@ public interface ProviderNode extends Node{ */ public boolean linkAcceptor(Node requester, String group); + + /** Unlink a provider from the acceptor + * + * @param toUnlink + * @return + */ + public boolean unlinkAcceptor(Node toUnlink); + + /** * @return Node[] */ -- cgit v1.2.3