changeset 40:342931aea0b8

add topology HostMessage
author akahori
date Tue, 31 Jul 2018 16:12:27 +0900
parents fedfc1d43b6f
children cf5a75bc3e55
files src/main/java/christie/topology/HostMessage.java
diffstat 1 files changed, 42 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/christie/topology/HostMessage.java	Tue Jul 31 16:12:27 2018 +0900
@@ -0,0 +1,42 @@
+package christie.topology;
+
+
+import org.msgpack.annotation.Message;
+
+@Message
+public class HostMessage {
+    public String name;
+    public int port;
+
+    public String connectionName;
+    public String absName; // this is absName which have these IP and port.
+
+    public String reverseName;
+    public String remoteAbsName;
+    public String cookie; // MD5
+
+    public boolean alive;
+
+    public HostMessage() { }
+    public HostMessage(String name, int port) {
+        this.name = name;
+        this.port = port;
+    }
+
+    public HostMessage(String name, int port, String connectionName, String reverseName) {
+        this.name = name;
+        this.port = port;
+        this.connectionName = connectionName;
+        this.reverseName = reverseName;
+    }
+
+    public boolean isAlive() {
+        return alive;
+    }
+
+    public String toString() {
+        return "HostMessage : name = " + name + ", port = " + Integer.toString(port) + " connectionName = " +
+                connectionName + " absName = " + absName + "reverseName = " + reverseName + " remoteAbsName = " + remoteAbsName
+                + " cokkie = " + cookie ;
+    }
+}