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;

/**
 * nsx逻辑路由器
 * 
 * @author wangyu
 * @version 1.0
 * @since 2020年2月27日
 *
 */
@NoArgsConstructor
@AllArgsConstructor
@Table("nsx_logical_router")
public class NsxLogicalRouter extends GenericEntity {

	// id
	@Setter
	@Getter
	@PK(PKStrategy.AUTO)
	private Long id;
	// uuid(关联子订单明细)
	@Setter
	@Getter
	@Column("uuid")
	private String uuid;
	// 路由uuid
	@Setter
	@Getter
	@Column("router_id")
	private String routerId;
	// 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("advanced_config")
	private String advancedConfig;
	// edge cluster高级配置
	@Setter
	@Getter
	@Column("allocation_profile")
	private String allocationProfile;
	// edge cluster uuid
	@Setter
	@Getter
	@Column("edge_cluster_id")
	private String edgeClusterId;
	// edge cluster成员索引
	@Setter
	@Getter
	@Column("edge_cluster_member_indices")
	private String edgeClusterMemberIndices;
	// 故障转移模式
	@Setter
	@Getter
	@Column("failover_mode")
	private String failoverMode;
	// 防火墙
	@Setter
	@Getter
	@Column("firewall_sections")
	private String firewallSections;
	// 高可用模式
	@Setter
	@Getter
	@Column("high_availability_mode")
	private String highAvailabilityMode;
	// IPv6配置
	@Setter
	@Getter
	@Column("ipv6_profiles")
	private String ipv6Profiles;
	// 首选edge cluster成员索引
	@Setter
	@Getter
	@Column("preferred_edge_cluster_member_index")
	private Long preferredEdgeClusterMemberIndex;
	// 路由类型
	@Setter
	@Getter
	@Column("router_type")
	private String routerType;
	// tier0路由uuid
	@Setter
	@Getter
	@Column("tier0_router_uuid")
	private String tier0RouterUuid;
	// tier0路由Id
	@Setter
	@Getter
	@Column("tier0_router_id")
	private Long tier0RouterId;
	// edge cluster id
	@Setter
	@Getter
	@Column("cluster_id")
	private Long clusterId;
	// 云平台id
	@Setter
	@Getter
	@Column("vendor_id")
	private Long vendorId;
	// 租户id
	@Setter
	@Getter
	@Column("tenant_id")
	private Long tenantId;
	// 账号类别
	@Setter
	@Getter
	@Column("catalog")
	private Catalog catalog;
	// 是否为管理网路由器
	@Setter
	@Getter
	@Column("management_network")
	private Boolean managementNetwork;
	// edge cluster名称
	@Setter
	@Getter
	@IgnoreAll
	private String clusterName;
	// 云平台名称
	@Setter
	@Getter
	@IgnoreAll
	private String vendorName;
	// 租户名称
	@Setter
	@Getter
	@IgnoreAll
	private String tenantName;
	// tier0名称
	@Setter
	@Getter
	@IgnoreAll
	private String tier0RouterName;
	// 过期时间
	@Setter
	@Getter
	@IgnoreAll
	@JsonSerialize(using = DateSerializer.class)
	@JsonDeserialize(using = DateDeserializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date expiredTime;
	// 子网名称
	@Setter
	@Getter
	@IgnoreAll
	private String subnetNames;
}
