package com.bocloud.ims.entity.middleware;

import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.Generic;
import com.bocloud.entity.meta.PKStrategy;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 消息队列节点
 * 
 * @author weiwei
 *
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table("cms_node")
public class CmsNode extends Generic {

	@PK(PKStrategy.AUTO)
	private Long id;// ID
	@Column("address")
	private String address;// 节点地址
	@Column("port")
	private Integer port;// 节点端口
	@Column("role")
	private String role;// 节点角色
	@Column("status")
	private String status;// 节点状态
	@Column("instance_id")
	private String instanceId;// 关联的虚拟机实例ID
	@Column("server_id")
	private Long serverId;// 关联的虚拟机ID
	@Column("cms_id")
	private Long cmsId;// 消息队列ID
	@Column("group_id")
	private String groupId;
	@Column("manage_ip")
	private String manageIp;

	/**
	 * 
	 * @param address
	 * @param port
	 * @param role
	 * @param status
	 * @param instanceId
	 */
	public CmsNode(String address, Integer port, String role, String status, String instanceId, Long cmsId) {
		super();
		this.address = address;
		this.port = port;
		this.role = role;
		this.status = status;
		this.instanceId = instanceId;
		this.cmsId = cmsId;
	}

}
