X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fnet%2Fpterodactylus%2Fjsite%2Fcore%2FNode.java;h=854a668df32c47db9c01a05f636240304ef50bfb;hb=d1caba447262a4b183242ce0ffc3c95a51cd7277;hp=37664985d8ff2ff9269283060432912dba07e47c;hpb=811c8f26e0ea0f1418451acb34ddabedafdbc3b3;p=jSite2.git
diff --git a/src/net/pterodactylus/jsite/core/Node.java b/src/net/pterodactylus/jsite/core/Node.java
index 3766498..854a668 100644
--- a/src/net/pterodactylus/jsite/core/Node.java
+++ b/src/net/pterodactylus/jsite/core/Node.java
@@ -36,6 +36,9 @@ public class Node {
/** The port number of the node. */
private int port;
+ /** Whether the node is running on the same machine as jSite. */
+ private boolean sameMachine;
+
/**
* Returns the user-given name of the node.
*
@@ -93,4 +96,33 @@ public class Node {
this.port = port;
}
+ /**
+ * Returns whether this node is running on the same machine as jSite.
+ *
+ * @return the sameMachine true
if, and only if, the node is
+ * running on the same machine as jSite
+ */
+ public boolean isSameMachine() {
+ return sameMachine;
+ }
+
+ /**
+ * Sets whether this node is running on the same machine as jSite.
+ *
+ * @param sameMachine
+ * true
if the node is running on the same machine
+ * as jSite, false
otherwise
+ */
+ public void setSameMachine(boolean sameMachine) {
+ this.sameMachine = sameMachine;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public String toString() {
+ return name + " (" + hostname + ((port == 9481) ? ("") : (":" + port)) + ")";
+ }
+
}