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年3月5日
 *
 */
@NoArgsConstructor
@AllArgsConstructor
@Table("nsx_router_port")
public class NsxRouterPort 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;
	// 逻辑路由器uuid
	@Setter
	@Getter
	@Column("logical_router_id")
	private String logicalRouterId;
	// 服务绑定
	@Setter
	@Getter
	@Column("service_bindings")
	private String serviceBindings;
	/**
	 * LogicalRouterUpLinkPort LogicalRouterDownLinkPort LogicalRouterLoopbackPort
	 * edge集群成员下标
	 */
	@Setter
	@Getter
	@Column("edge_cluster_member_index")
	private String edgeClusterMemberIndex;
	// 连接的逻辑交换机端口id
	@Setter
	@Getter
	@Column("linked_logical_switch_port_id")
	private String linkedLogicalSwitchPortId;
	// mac地址
	@Setter
	@Getter
	@Column("mac_address")
	private String macAddress;
	// mtu
	@Setter
	@Getter
	@Column("mtu")
	private Long mtu;
	// NDRA前缀配置
	@Setter
	@Getter
	@Column("ndra_prefix_config")
	private String ndraPrefixConfig;
	// 端口上的NDRA配置文件id
	@Setter
	@Getter
	@Column("ndra_profile_id")
	private String ndraProfileId;
	// 子网
	@Setter
	@Getter
	@Column("subnets")
	private String subnets;
	// 单播反向路径转发模式
	@Setter
	@Getter
	@Column("urpf_mode")
	private String urpfMode;
	/**
	 * LogicalRouterLinkPortOnTIER0 LogicalRouterLinkPortOnTIER1 连接的逻辑路由器端口uuid
	 */
	@Setter
	@Getter
	@Column("linked_logical_router_port_id")
	private String linkedLogicalRouterPortId;
	/**
	 * LogicalRouterIPTunnelPort 管理状态
	 */
	@Setter
	@Getter
	@Column("admin_state")
	private String adminState;
	// vpn会话id
	@Setter
	@Getter
	@Column("vpn_session_id")
	private String vpnSessionId;
	/**
	 * LogicalRouterCentralizedServicePort 是否启用netx
	 */
	@Setter
	@Getter
	@Column("enable_netx")
	private Boolean enableNetx;
	// 云平台id
	@Setter
	@Getter
	@Column("vendor_id")
	private Long vendorId;
	// 连接的路由器端口id
	@Setter
	@Getter
	@Column("linked_router_port_id")
	private Long linkedRouterPortId;
	// 连接的逻辑交换机端口id
	@Setter
	@Getter
	@Column("linked_switch_port_id")
	private Long linkedSwitchPortId;
	// 逻辑路由器id
	@Setter
	@Getter
	@Column("router_id")
	private Long routerId;
	// 云平台名称
	@Setter
	@Getter
	@IgnoreAll
	private String vendorName;
	// 路由器名称
	@Setter
	@Getter
	@IgnoreAll
	private String routerName;
	// 连接的逻辑路由器名称
	@Setter
	@Getter
	@IgnoreAll
	private String linkedRouterName;
	// 连接的逻辑交换机名称
	@Setter
	@Getter
	@IgnoreAll
	private String linkedSwitchName;
	@Setter
	@Getter
	@IgnoreAll
	private String switchPort;
	@Setter
	@Getter
	@IgnoreAll
	private NsxSwitchPort port;
	@Setter
	@Getter
	@IgnoreAll
	private String logicalSwitchId;

}
