package com.bocloud.ims.entity.resource.nsx;

import com.bocloud.common.utils.DateDeserializer;
import com.bocloud.common.utils.DateSerializer;
import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreAll;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.GenericEntity;
import com.bocloud.entity.meta.PKStrategy;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * nsx虚拟服务器
 * 
 * @author wangyu
 * @version 1.0
 * @since 2020年3月26日
 *
 */
@NoArgsConstructor
@AllArgsConstructor
@Table("nsx_virtual_server")
public class NsxVirtualServer extends GenericEntity {

	// id
	@Setter
	@Getter
	@PK(PKStrategy.AUTO)
	private Long id;
	// 虚拟服务器uuid
	@Setter
	@Getter
	@Column("server_id")
	private String serverId;
	// References related to this resource
	@Setter
	@Getter
	@Column("links")
	private String links;
	// Schema for this resource
	@Setter
	@Getter
	@Column("resource_schema")
	private String resourceSchema;
	// Link to this resource
	@Setter
	@Getter
	@Column("self")
	private String self;
	// Generation of this resource config
	@Setter
	@Getter
	@Column("revision")
	private Long revision;
	// 创建时间
	@Setter
	@Getter
	@JsonSerialize(using = DateSerializer.class)
	@JsonDeserialize(using = DateDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Column("create_time")
	private Date createTime;
	// 创建用户
	@Setter
	@Getter
	@Column("create_user")
	private String createUser;
	// 最后一次修改时间
	@Setter
	@Getter
	@JsonSerialize(using = DateSerializer.class)
	@JsonDeserialize(using = DateDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Column("last_modified_time")
	private Date lastModifiedTime;
	// 最后一次修改用户
	@Setter
	@Getter
	@Column("last_modified_user")
	private String lastModifiedUser;
	// Indicates protection status of this resource
	@Setter
	@Getter
	@Column("protection")
	private String protection;
	// 是否为系统资源
	@Setter
	@Getter
	@Column("system_owned")
	private Boolean systemOwned;
	// 资源类型
	@Setter
	@Getter
	@Column("resource_type")
	private String resourceType;
	// 资源标签
	@Setter
	@Getter
	@Column("tags")
	private String tags;
	// 启用日志访问
	@Setter
	@Getter
	@Column("access_log_enabled")
	private Boolean accessLogEnabled;
	/**
	 * 应用程序配置id, 它用于影响负载平衡的执行方式。 目前， LbFastTCPProfile，LbFastUDPProfile和
	 * 支持LbHttpProfile等
	 */
	@Setter
	@Getter
	@Column("application_profile_id")
	private String applicationProfileId;
	// 虚拟服务器端SSL绑定设置
	@Setter
	@Getter
	@Column("client_ssl_profile_binding")
	private String clientSslProfileBinding;
	// 客户端TCP配置文件ID
	@Setter
	@Getter
	@Column("client_tcp_profile_id")
	private String clientTcpProfileId;
	// 未定义成员端口时的默认池成员端口(已弃用属性)
	@Setter
	@Getter
	@Column("default_pool_member_port")
	private String defaultPoolMemberPort;
	/**
	 * 未定义成员端口时的默认池成员端口， 如果配置了default_pool_member_ports，则两者
	 * 响应中的default_pool_member_port和default_pool_member_ports 有效负载将包括端口设置，请注意
	 * default_pool_member_port是的第一个元素 default_pool_member_ports。
	 */
	@Setter
	@Getter
	@Column("default_pool_member_ports")
	private String defaultPoolMemberPorts;
	// 是否启用
	@Setter
	@Getter
	@Column("enabled")
	private Boolean enabled;
	// IP地址
	@Setter
	@Getter
	@Column("ip_address")
	private String ipAddress;
	// IP协议
	@Setter
	@Getter
	@Column("ip_protocol")
	private String ipProtocol;
	// 最大并发连接数
	@Setter
	@Getter
	@Column("max_concurrent_connections")
	private Long maxConcurrentConnections;
	// 最大新连接速率
	@Setter
	@Getter
	@Column("max_new_connection_rate")
	private Long maxNewConnectionRate;
	// 持久性配置文件id
	@Setter
	@Getter
	@Column("persistence_profile_id")
	private String persistenceProfileId;
	// 默认服务器池id
	@Setter
	@Getter
	@Column("pool_id")
	private String poolId;
	// 虚拟服务器端口号或端口范围(已弃用)
	@Setter
	@Getter
	@Column("port")
	private String port;
	// 虚拟服务器端口号或端口范围
	@Setter
	@Getter
	@Column("ports")
	private String ports;
	// 负载均衡器规则id
	@Setter
	@Getter
	@Column("rule_ids")
	private String ruleIds;
	// 池侧SSL绑定设置
	@Setter
	@Getter
	@Column("server_ssl_profile_binding")
	private String serverSslProfileBinding;
	// 服务器端TCP配置文件id
	@Setter
	@Getter
	@Column("server_tcp_profile_id")
	private String serverTcpProfileId;
	// Sorry Server 池id
	@Setter
	@Getter
	@Column("sorry_pool_id")
	private String sorryPoolId;
	// 云平台id
	@Setter
	@Getter
	@Column("vendor_id")
	private Long vendorId;
	// 云平台名称
	@Setter
	@Getter
	@IgnoreAll
	private String vendorName;
	// 负载均衡器名称
	@Setter
	@Getter
	@IgnoreAll
	private String lbNames;
}
