summaryrefslogtreecommitdiff
path: root/src/main/java/net/transit/network/system/swap
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2019-11-22 10:35:21 -0500
committerKyle Gunger <kgunger12@gmail.com>2019-11-22 10:35:21 -0500
commitc05689ba385733ee52ca825b194134126640af8a (patch)
tree66674f5af72f9bfa97e8ee377f4e894f8fca9a72 /src/main/java/net/transit/network/system/swap
parentd08cbf6b8705df234077c49608de3c2f7ff0e3fa (diff)
[Update] Nodes now transfer things
~ Switched Provider and Acceptor to ProviderNode and AcceptorNode ~ Nodes are now expected to connect to eachother on their own ~ Inventory hooks are not here, but have been thought through Signed-off-by: Kyle Gunger <kgunger12@gmail.com>
Diffstat (limited to 'src/main/java/net/transit/network/system/swap')
-rw-r--r--src/main/java/net/transit/network/system/swap/AcceptorNode.java31
-rw-r--r--src/main/java/net/transit/network/system/swap/ProviderNode.java20
2 files changed, 51 insertions, 0 deletions
diff --git a/src/main/java/net/transit/network/system/swap/AcceptorNode.java b/src/main/java/net/transit/network/system/swap/AcceptorNode.java
new file mode 100644
index 0000000..c583146
--- /dev/null
+++ b/src/main/java/net/transit/network/system/swap/AcceptorNode.java
@@ -0,0 +1,31 @@
+package net.transit.network.system.swap;
+
+import net.transit.network.packet.Packet;
+import net.transit.network.system.Node;
+
+public interface AcceptorNode extends Node
+{
+
+ /** Link another node as a provider
+ *
+ * @param requester The object to be a provider
+ * @param group
+ * @return Provider
+ */
+ public boolean linkProvider(Node requestor, String group);
+
+
+ /**
+ * @return Node[]
+ */
+ public Node[] getProviders();
+
+
+ /** Accept a packet from a provider
+ *
+ * @param packet
+ * @param group
+ * @return
+ */
+ public boolean accept(Packet<?> packet, String group);
+}
diff --git a/src/main/java/net/transit/network/system/swap/ProviderNode.java b/src/main/java/net/transit/network/system/swap/ProviderNode.java
new file mode 100644
index 0000000..4cd9dba
--- /dev/null
+++ b/src/main/java/net/transit/network/system/swap/ProviderNode.java
@@ -0,0 +1,20 @@
+package net.transit.network.system.swap;
+
+import net.transit.network.system.Node;
+
+public interface ProviderNode extends Node{
+
+ /** Link another node as an acceptor
+ *
+ * @param requester The object requesting the Acceptor
+ * @param group
+ * @return boolean
+ */
+ public boolean linkAcceptor(Node requester, String group);
+
+ /**
+ * @return Node[]
+ */
+ public Node[] getAcceptors();
+
+}