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

import com.bocloud.common.model.RequestContext.Catalog;
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;
import java.util.List;

/**
 * nsx逻辑交换机
 * 
 * @author wangyu
 * @version 1.0
 * @since 2020年2月24日
 *
 */
@NoArgsConstructor
@AllArgsConstructor
@Table("nsx_logical_switch")
public class NsxLogicalSwitch extends GenericEntity {

	// id
	@Setter
	@Getter
	@PK(PKStrategy.AUTO)
	private Long id;
	// 逻辑交换机UUID
	@Setter
	@Getter
	@Column("switch_id")
	private String switchId;
	// 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("address_bindings")
	private String addressBindings;
	// 管理状态
	@Setter
	@Getter
	@Column("admin_state")
	private String adminState;
	// 逻辑交换机额外配置
	@Setter
	@Getter
	@Column("extra_configs")
	private String extraConfigs;
	// 标识混合逻辑交换机的标志
	@Setter
	@Getter
	@Column("hybrid")
	private Boolean hybrid;
	// 与逻辑交换机关联的分配IP池
	@Setter
	@Getter
	@Column("ip_pool_id")
	private String ipPoolId;
	// 与逻辑交换机关联的分配mac池
	@Setter
	@Getter
	@Column("mac_pool_id")
	private String macPoolId;
	// 逻辑交换机的复制模式
	@Setter
	@Getter
	@Column("replication_mode")
	private String replicationMode;
	// 交换机类型
	@Setter
	@Getter
	@Column("switch_type")
	private String switchType;
	// 交换机文件ids
	@Setter
	@Getter
	@Column("switching_profile_ids")
	private String switchingProfileIds;
	// 传输区域id
	@Setter
	@Getter
	@Column("transport_zone_id")
	private String transportZoneId;
	// 逻辑交换机的交换上行链路分组策略的名称
	@Setter
	@Getter
	@Column("uplink_teaming_policy_name")
	private String uplinkTeamingPolicyName;
	// VLAN
	@Setter
	@Getter
	@Column("vlan")
	private Long vlan;
	// 中继vlan规格
	@Setter
	@Getter
	@Column("vlan_trunk_spec")
	private String vlanTrunkSpec;
	// 逻辑交换机vni
	@Setter
	@Getter
	@Column("vni")
	private Long vni;
	// 传输区域id
	@Setter
	@Getter
	@Column("zone_id")
	private Long zoneId;
	// 云平台id
	@Setter
	@Getter
	@Column("vendor_id")
	private Long vendorId;
	// 租户id
	@Setter
	@Getter
	@Column("tenant_id")
	private Long tenantId;
	// 云平台id
	@Setter
	@Getter
	@Column("catalog")
	private Catalog catalog;
	// vpc id
	@Setter
	@Getter
	@Column("vpc_id")
	private Long vpcId;
	// 逻辑端口
	@Setter
	@Getter
	@IgnoreAll
	private List<NsxSwitchPort> ports;
	// 租户名称
	@Setter
	@Getter
	@IgnoreAll
	private String tenantName;
	// 云平台名称
	@Setter
	@Getter
	@IgnoreAll
	private String vendorName;
	// 传输区域名称
	@Setter
	@Getter
	@IgnoreAll
	private String zoneName;
	// 网关
	@Setter
	@Getter
	@IgnoreAll
	private String gateway;
	// 网络地址
	@Setter
	@Getter
	@IgnoreAll
	private String cidr;
	// IP版本
	@Setter
	@Getter
	@IgnoreAll
	private String ipVersion;
	// 逻辑端口数量
	@Setter
	@Getter
	@IgnoreAll
	private Integer portNum;
}
