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;

/**
 * 分段
 * 
 * @author wangyu
 * @version 1.0
 * @since 2020年2月20日
 *
 */
@NoArgsConstructor
@AllArgsConstructor
@Table("nsx_segment")
public class NsxSegment extends GenericEntity {

	// id
	@Setter
	@Getter
	@PK(PKStrategy.AUTO)
	private Long id;
	// 分段UUID
	@Setter
	@Getter
	@Column("segment_id")
	private String segmentId;
	// 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;
	// Path of its parent
	@Setter
	@Getter
	@Column("parent_path")
	private String parentPath;
	// 绝对路径
	@Setter
	@Getter
	@Column("path")
	private String path;
	// 相对路径
	@Setter
	@Getter
	@Column("relative_path")
	private String relativePath;
	// subtree for this type within policy tree
	@Setter
	@Getter
	@Column("children")
	private String children;
	// 是否标记为已删除
	@Setter
	@Getter
	@Column("marked_for_delete")
	private Boolean markedForDelete;
	// 高级配置
	@Setter
	@Getter
	@Column("advanced_config")
	private String advancedConfig;
	// Policy path to the connecting Tier-0 or Tier-1
	@Setter
	@Getter
	@Column("connectivity_path")
	private String connectivityPath;
	// DNS域名称
	@Setter
	@Getter
	@Column("domain_name")
	private String domainName;
	// 通过L2 VPN扩展网段的配置
	@Setter
	@Getter
	@Column("l2_extension")
	private String l2Extension;
	// 为段预先创建的逻辑交换机ID
	@Setter
	@Getter
	@Column("ls_id")
	private String lsId;
	// 段叠加id
	@Setter
	@Getter
	@Column("overlay_id")
	private Long overlayId;
	// 子网
	@Setter
	@Getter
	@Column("subnets")
	private String subnets;
	// 传输区域路径
	@Setter
	@Getter
	@Column("transport_zone_path")
	private String transportZonePath;
	// 段类型
	@Setter
	@Getter
	@Column("type")
	private String type;
	// vlan ids
	@Setter
	@Getter
	@Column("vlan_ids")
	private String vlanIds;
	// 逻辑交换机id
	@Setter
	@Getter
	@Column("switch_id")
	private Long switchId;
	// 云平台id
	@Setter
	@Getter
	@Column("vendor_id")
	private Long vendorId;
	// vpc id
	@Setter
	@Getter
	@Column("vpc_id")
	private Long vpcId;
	// 云平台名称
	@Setter
	@Getter
	@IgnoreAll
	private String vendorName;
	// 逻辑交换机名称
	@Setter
	@Getter
	@IgnoreAll
	private String switchName;
}
