com.app.common.cluster.ServerInfo Maven / Gradle / Ivy
The newest version!
package com.app.common.cluster;
import java.util.HashMap;
/**
* 服务信息
*
* @author deshuai.kong
*
*/
public class ServerInfo {
public static final int TYPE_ALL = 0;
public static final int TYPE_STANDBY = 2;
public static final String[] TYPE = { "ALL", "ALL", "STANDBY" };
private String seqName="";// 服务在节点名字
private String stat = "0";// 状态1,启动,0未启动
private String name;// 服务名字
private String group;// 集群分组
private int level;//级别,1,2,数字越大,优先级越低
private int type;// 集群方式
private String host="";
private boolean registerEnable=true;
public boolean isRegisterEnable() {
return registerEnable;
}
public void setRegisterEnable(boolean registerEnable) {
this.registerEnable = registerEnable;
}
private int port;
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public int getPort() {
return port;
}
public void setPort(int port) {
this.port = port;
}
HashMap atts = new HashMap();
public HashMap getAtts() {
return atts;
}
public void setAtts(HashMap atts) {
this.atts = atts;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getSeqName() {
return seqName;
}
public void setSeqName(String seqName) {
this.seqName = seqName;
}
public String getStat() {
return stat;
}
public void setStat(String stat) {
this.stat = stat;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getGroup() {
return group;
}
public void setGroup(String group) {
this.group = group;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
@Override
public String toString() {
return String.format("Host:%s,Port:%s",host,port);
}
}