package com.bocloud.ims.entity.resource;

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 java.util.List;

/**
 * 防火墙实体类
 *
 * @author wangyu
 * @version 1.0
 * @since 2017年8月29日
 */
@Table("firewall")
public class Firewall extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id;// id
	@Column("firewall_uuid")
	private String firewallUuid;// 防火墙ID
	@Column("policy_id")
	private Long policyId;// 策略外键ID
	@Column("policy_uuid")
	private String policyUuid;// 策略uuid
	@Column("request_id")
	private String requestId;// 请求ID
	@Column("tenant_uuid")
	private String tenantUuid;// 租户ID
	@Column("is_shared")
	private Boolean shared;// 是否共享
	@Column("admin_stateup")
	private Boolean adminStateUp;// 管理状态
	@Column("vendor_id")
	private Long vendorId;// 云平台ID
	@Column("tenant_id")
	private Long tenantId;// 租户ID
	@Column("project_id")
	private Long projectId;// 项目ID
	@IgnoreAll
	private String policyName;// 绑定的策略名称
	@IgnoreAll
	private String routerNames;// 防火墙所有绑定的路由
	@IgnoreAll
	private String vendorName;
	@IgnoreAll
	private String vendorType;
	@IgnoreAll
	private List<Long> routerIds;
	@IgnoreAll
	private List<String> routerUuids;
	@IgnoreAll
	private String tenantName;
	@IgnoreAll
	private String projectName;
	@IgnoreAll
	private String osTenantName;// openstack底层租户名称

	// 深信服防火墙
	@Column("priority")
	private Integer priority;
	@Column("fw_index")
	private Integer index;
	@Column("is_default")
	private Boolean isDefault;
	@Column("enable")
	private Boolean enable;
	@Column("srv")
	private String srv;
	@Column("fw_range")
	private String range;
	@Column("action")
	private String action;
	@IgnoreAll
	private String sangforType;
	@IgnoreAll
	private String azId;
	@IgnoreAll
	private String sangforProjectId;
	@IgnoreAll
	private String sangforPolicyType;


	@Column("srcip")
	private String srcip;
	@Column("dstip")
	private String dstip;
	@Column("src_type")
	private String srcType;
	@Column("dst_type")
	private String dstType;
	@Column("srcif_all")
	private Integer srcifAll;
	@Column("dstif_all")
	private Integer dstifAll;

	public String getSangforType() {
		return sangforType;
	}

	public void setSangforType(String sangforType) {
		this.sangforType = sangforType;
	}

	public String getAzId() {
		return azId;
	}

	public void setAzId(String azId) {
		this.azId = azId;
	}

	public String getSangforProjectId() {
		return sangforProjectId;
	}

	public void setSangforProjectId(String sangforProjectId) {
		this.sangforProjectId = sangforProjectId;
	}

	public String getSangforPolicyType() {
		return sangforPolicyType;
	}

	public void setSangforPolicyType(String sangforPolicyType) {
		this.sangforPolicyType = sangforPolicyType;
	}

	public Firewall() {
		super();
	}

	public void preSave(Long creatorId, Long menderId, Long vendorId, Long tenantId, Long projectId) {
		this.setCreatorId(creatorId);
		this.setMenderId(menderId);
		this.setVendorId(vendorId);
		this.setTenantId(tenantId);
		this.setProjectId(projectId);
	}

	/**
	 * @param firewallUuid
	 * @param policyId
	 * @param policyUuid
	 * @param requestId
	 * @param tenantUuid
	 * @param shared
	 * @param adminStateUp
	 * @param vendorId
	 * @param policyName
	 * @param routerNames
	 */
	public Firewall(String firewallUuid, Long policyId, String policyUuid, String requestId, String tenantUuid,
			Boolean shared, Boolean adminStateUp, Long vendorId, String policyName, String routerNames) {
		super();
		this.firewallUuid = firewallUuid;
		this.policyId = policyId;
		this.policyUuid = policyUuid;
		this.requestId = requestId;
		this.tenantUuid = tenantUuid;
		this.shared = shared;
		this.adminStateUp = adminStateUp;
		this.vendorId = vendorId;
		this.policyName = policyName;
		this.routerNames = routerNames;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the firewallUuid
	 */
	public String getFirewallUuid() {
		return firewallUuid;
	}

	/**
	 * @param firewallUuid
	 *            the firewallUuid to set
	 */
	public void setFirewallUuid(String firewallUuid) {
		this.firewallUuid = firewallUuid;
	}

	/**
	 * @return the policyId
	 */
	public Long getPolicyId() {
		return policyId;
	}

	/**
	 * @param policyId
	 *            the policyId to set
	 */
	public void setPolicyId(Long policyId) {
		this.policyId = policyId;
	}

	/**
	 * @return the policyUuid
	 */
	public String getPolicyUuid() {
		return policyUuid;
	}

	/**
	 * @param policyUuid
	 *            the policyUuid to set
	 */
	public void setPolicyUuid(String policyUuid) {
		this.policyUuid = policyUuid;
	}

	/**
	 * @return the requestId
	 */
	public String getRequestId() {
		return requestId;
	}

	/**
	 * @param requestId
	 *            the requestId to set
	 */
	public void setRequestId(String requestId) {
		this.requestId = requestId;
	}

	/**
	 * @return the tenantUuid
	 */
	public String getTenantUuid() {
		return tenantUuid;
	}

	/**
	 * @param tenantUuid
	 *            the tenantUuid to set
	 */
	public void setTenantUuid(String tenantUuid) {
		this.tenantUuid = tenantUuid;
	}

	/**
	 * @return the shared
	 */
	public Boolean getShared() {
		return shared;
	}

	/**
	 * @param shared
	 *            the shared to set
	 */
	public void setShared(Boolean shared) {
		this.shared = shared;
	}

	/**
	 * @return the adminStateUp
	 */
	public Boolean getAdminStateUp() {
		return adminStateUp;
	}

	/**
	 * @param adminStateUp
	 *            the adminStateUp to set
	 */
	public void setAdminStateUp(Boolean adminStateUp) {
		this.adminStateUp = adminStateUp;
	}

	/**
	 * @return the vendorId
	 */
	public Long getVendorId() {
		return vendorId;
	}

	/**
	 * @param vendorId
	 *            the vendorId to set
	 */
	public void setVendorId(Long vendorId) {
		this.vendorId = vendorId;
	}

	/**
	 * @return the policyName
	 */
	public String getPolicyName() {
		return policyName;
	}

	/**
	 * @param policyName
	 *            the policyName to set
	 */
	public void setPolicyName(String policyName) {
		this.policyName = policyName;
	}

	/**
	 * @return the routerNames
	 */
	public String getRouterNames() {
		return routerNames;
	}

	/**
	 * @param routerNames
	 *            the routerNames to set
	 */
	public void setRouterNames(String routerNames) {
		this.routerNames = routerNames;
	}

	/**
	 * @return the vendorName
	 */
	public String getVendorName() {
		return vendorName;
	}

	/**
	 * @param vendorName
	 *            the vendorName to set
	 */
	public void setVendorName(String vendorName) {
		this.vendorName = vendorName;
	}

	/**
	 * @return the tenantId
	 */
	public Long getTenantId() {
		return tenantId;
	}

	/**
	 * @param tenantId
	 *            the tenantId to set
	 */
	public void setTenantId(Long tenantId) {
		this.tenantId = tenantId;
	}

	/**
	 * @return the routerIds
	 */
	public List<Long> getRouterIds() {
		return routerIds;
	}

	/**
	 * @param routerIds
	 *            the routerIds to set
	 */
	public void setRouterIds(List<Long> routerIds) {
		this.routerIds = routerIds;
	}

	/**
	 * @return the routerUuids
	 */
	public List<String> getRouterUuids() {
		return routerUuids;
	}

	/**
	 * @param routerUuids
	 *            the routerUuids to set
	 */
	public void setRouterUuids(List<String> routerUuids) {
		this.routerUuids = routerUuids;
	}

	/**
	 * @return the tenantName
	 */
	public String getTenantName() {
		return tenantName;
	}

	/**
	 * @param tenantName
	 *            the tenantName to set
	 */
	public void setTenantName(String tenantName) {
		this.tenantName = tenantName;
	}

	/**
	 * @return the projectId
	 */
	public Long getProjectId() {
		return projectId;
	}

	/**
	 * @param projectId
	 *            the projectId to set
	 */
	public void setProjectId(Long projectId) {
		this.projectId = projectId;
	}

	public String getProjectName() {
		return projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	public String getOsTenantName() {
		return osTenantName;
	}

	public void setOsTenantName(String osTenantName) {
		this.osTenantName = osTenantName;
	}

	public String getVendorType() {
		return vendorType;
	}

	public void setVendorType(String vendorType) {
		this.vendorType = vendorType;
	}

	public Integer getPriority() {
		return priority;
	}

	public void setPriority(Integer priority) {
		this.priority = priority;
	}

	public Boolean getIsDefault() {
		return isDefault;
	}

	public void setIsDefault(Boolean isDefault) {
		this.isDefault = isDefault;
	}

	public String getSrv() {
		return srv;
	}

	public void setSrv(String srv) {
		this.srv = srv;
	}

	public String getRange() {
		return range;
	}

	public void setRange(String range) {
		this.range = range;
	}

	public Boolean getEnable() {
		return enable;
	}

	public void setEnable(Boolean enable) {
		this.enable = enable;
	}

	public String getAction() {
		return action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	public Integer getIndex() {
		return index;
	}

	public void setIndex(Integer index) {
		this.index = index;
	}

	public String getSrcip() {
		return srcip;
	}

	public void setSrcip(String srcip) {
		this.srcip = srcip;
	}

	public String getDstip() {
		return dstip;
	}

	public void setDstip(String dstip) {
		this.dstip = dstip;
	}

	public String getSrcType() {
		return srcType;
	}

	public void setSrcType(String srcType) {
		this.srcType = srcType;
	}

	public String getDstType() {
		return dstType;
	}

	public void setDstType(String dstType) {
		this.dstType = dstType;
	}

	public Integer getSrcifAll() {
		return srcifAll;
	}

	public void setSrcifAll(Integer srcifAll) {
		this.srcifAll = srcifAll;
	}

	public Integer getDstifAll() {
		return dstifAll;
	}

	public void setDstifAll(Integer dstifAll) {
		this.dstifAll = dstifAll;
	}
}
