diff options
author | Kyle Gunger <kgunger12@gmail.com> | 2019-11-22 14:10:10 -0500 |
---|---|---|
committer | Kyle Gunger <kgunger12@gmail.com> | 2019-11-22 14:10:10 -0500 |
commit | 224e0341bbc4402ca25493d465e2a68c66815114 (patch) | |
tree | 87fd53241d56bfaddf985ee266348be50ef30eb1 /src | |
parent | c05689ba385733ee52ca825b194134126640af8a (diff) |
[Update] More methods to impliment so that everyone plays nice
+ Unlinkers for nodes
+ Get connections for nodes
Signed-off-by: Kyle Gunger <kgunger12@gmail.com>
Diffstat (limited to 'src')
3 files changed, 24 insertions, 1 deletions
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[] */ |