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;

/**
 * tier1逻辑路由器
 * 
 * @author wangyu
 * @version 1.0
 * @since 2020年2月20日
 *
 */
@NoArgsConstructor
@AllArgsConstructor
@Table("nsx_tier_one")
public class NsxTierOne extends GenericEntity {

	// id
	@Setter
	@Getter
	@PK(PKStrategy.AUTO)
	private Long id;
	// 子订单号
	@Setter
	@Getter
	@Column("uuid")
	private String uuid;
	// tier UUID
	@Setter
	@Getter
	@Column("tier1_id")
	private String tier1Id;
	// 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("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("default_rule_logging")
	private Boolean defaultRuleLogging;
	// 连接到Tier-1的网段的DHCP配置
	@Setter
	@Getter
	@Column("dhcp_config_paths")
	private String dhcpConfigPaths;
	// 禁用网关防火墙
	@Setter
	@Getter
	@Column("disable_firewall")
	private Boolean disableFirewall;
	// 启用备用服务路由器重定位的标志。
	@Setter
	@Getter
	@Column("enable_standby_relocation")
	private Boolean enableStandbyRelocation;
	// 故障转移模式
	@Setter
	@Getter
	@Column("failover_mode")
	private String failoverMode;
	// 标记以在实现过程中添加白名单FW规则
	@Setter
	@Getter
	@Column("force_whitelisting")
	private Boolean forceWhitelisting;
	// IPv6配置文件配置
	@Setter
	@Getter
	@Column("ipv6_profile_paths")
	private String ipv6ProfilePaths;
	// 路由规则过滤
	@Setter
	@Getter
	@Column("route_advertisement_rules")
	private String routeAdvertisementRules;
	// 路由规则过滤类型
	@Setter
	@Getter
	@Column("route_advertisement_types")
	private String routeAdvertisementTypes;
	// tier-0路由器路径
	@Setter
	@Getter
	@Column("tier0_path")
	private String tier0Path;
	// tier-1类型
	@Setter
	@Getter
	@Column("type")
	private String type;
	// tier-0路由器id
	@Setter
	@Getter
	@Column("tier0_id")
	private Long tier0Id;
	// 云平台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
	@IgnoreAll
	private Integer segmentCount;
	// 云平台名称
	@Setter
	@Getter
	@IgnoreAll
	private String vendorName;
	// 租户名称
	@Setter
	@Getter
	@IgnoreAll
	private String tenantName;
}
