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年2月24日
 *
 */
@NoArgsConstructor
@AllArgsConstructor
@Table("nsx_switch_port")
public class NsxSwitchPort extends GenericEntity {

	// id
	@Setter
	@Getter
	@PK(PKStrategy.AUTO)
	private Long id;
	// 逻辑端口UUID
	@Setter
	@Getter
	@Column("port_id")
	private String portId;
	// 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("attachment")
	private String attachment;
	// 逻辑端口额外配置
	@Setter
	@Getter
	@Column("extra_configs")
	private String extraConfigs;
	// 忽略的地址绑定
	@Setter
	@Getter
	@Column("ignore_address_bindings")
	private String ignoreAddressBindings;
	// 端口初始状态
	@Setter
	@Getter
	@Column("init_state")
	private String initState;
	// 逻辑交换机UUID
	@Setter
	@Getter
	@Column("logical_switch_id")
	private String logicalSwitchId;
	// 逻辑交换机id
	@Setter
	@Getter
	@Column("switch_id")
	private Long switchId;
	// 逻辑交换机配置文件ids
	@Setter
	@Getter
	@Column("switching_profile_ids")
	private String switchingProfileIds;
	// 云平台id
	@Setter
	@Getter
	@Column("vendor_id")
	private Long vendorId;
	// 交换机名称
	@Setter
	@Getter
	@IgnoreAll
	private String switchName;
	// 云平台名称
	@Setter
	@Getter
	@IgnoreAll
	private String vendorName;
}
