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_policy")
public class FirewallPolicy extends GenericEntity {

	@PK(PKStrategy.AUTO)
	private Long id;// ID
	@Column("policy_uuid")
	private String policyUuid;// 策略ID
	@Column("tenant_uuid")
	private String tenantUuid;// 租户ID
	@Column("is_shared")
	private Boolean shared;// 是否共享
	@Column("is_audited")
	private Boolean audited;// 是否已审计
	@Column("vendor_id")
	private Long vendorId;// 云平台ID
	@Column("tenant_id")
	private Long tenantId;// 租户ID
	@Column("project_id")
	private Long projectId;// 项目ID
	@IgnoreAll
	private String ruleNames;// 绑定所有规则名称
	@IgnoreAll
	private String vendorName;
	@IgnoreAll
	private List<Long> ruleIds;// 规则ID
	@IgnoreAll
	private Long beforeRuleId;// 前一条规则ID
	@IgnoreAll
	private Long afterRuleId;// 后一条规则ID
	@IgnoreAll
	private Long ruleId;
	@IgnoreAll
	private String tenantName;// 所属租户
	@IgnoreAll
	private String projectName;
	@IgnoreAll
	private String osTenantName;// openstack租户id
	@Column("vendor_type")
	private String vendorType;// 租户ID

	public FirewallPolicy() {
		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 policyUuid
	 * @param tenantUuid
	 * @param shared
	 * @param audited
	 * @param vendorId
	 */
	public FirewallPolicy(String policyUuid, String tenantUuid, Boolean shared, Boolean audited, Long vendorId) {
		super();
		this.policyUuid = policyUuid;
		this.tenantUuid = tenantUuid;
		this.shared = shared;
		this.audited = audited;
		this.vendorId = vendorId;
	}

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

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

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

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

	/**
	 * @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 audited
	 */
	public Boolean getAudited() {
		return audited;
	}

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

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

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

	/**
	 * @return the ruleNames
	 */
	public String getRuleNames() {
		return ruleNames;
	}

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

	/**
	 * @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 ruleIds
	 */
	public List<Long> getRuleIds() {
		return ruleIds;
	}

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

	/**
	 * @return the beforeRuleId
	 */
	public Long getBeforeRuleId() {
		return beforeRuleId;
	}

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

	/**
	 * @return the afterRuleId
	 */
	public Long getAfterRuleId() {
		return afterRuleId;
	}

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

	/**
	 * @return the ruleId
	 */
	public Long getRuleId() {
		return ruleId;
	}

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

	/**
	 * @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;
	}

}
