view src/main/java/christie/topology/HostMessage.java @ 83:2314c55534ef

add TreeTopology
author akahori
date Sat, 15 Sep 2018 09:24:36 +0900
parents f884c1bd0d36
children 7abfe041b75c
line wrap: on
line source

package christie.topology;


import org.msgpack.annotation.Message;

@Message
public class HostMessage {
    public String hostName;
    public int port;

    public String connectionName;
    public String nodeName; // this is nodeName which have these IP and port.

    public String reverseName;
    public String remoteNodeName;
    public String cookie; // MD5

    public boolean alive;

    public HostMessage() { }
    public HostMessage(String name, int port) {
        this.hostName = name;
        this.port = port;
    }

    public HostMessage(String name, int port, String connectionName, String reverseName) {
        this.hostName = name;
        this.port = port;
        this.connectionName = connectionName;
        this.reverseName = reverseName;
    }

    public boolean isAlive() {
        return alive;
    }

    public String toString() {
        return "HostMessage : name = " + hostName + ", port = " + Integer.toString(port) + " connectionName = " +
                connectionName + " absName = " + nodeName + "reverseName = " + reverseName + " remoteAbsName = " + remoteNodeName
                + " cokkie = " + cookie ;
    }
}