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 lombok.Data;

import java.util.List;

/**
 * 端口组实体类
 * 
 * @author weiwei
 * @since 2017.4.20
 *
 */
@Table("port_group")
@Data
public class PortGroup extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id; // ID
	@Column("vendor_id")
	private Long vendorId; // 云供应商ID
	@Column("type")
	private String type; // 端口组类型
	@Column("port_num")
	private Integer portNum;
	@Column("group_val")
	private String groupVal;
	@Column("vlan_uuid")
	private String vlanUuid; //SangforV6.8新增
	@Column("vlan_id")
	private Integer vlanId;// vlanID
	@Column("trunk_vlan")
	private String trunkVlan;// 中继vlan
	@Column("vlan_type")
	private String vlanType;// vlan类型
	@Column("switcher_id")
	private Long switcherId;// 交换机ID
	@Column("allow_promiscuous")
	private Boolean allowPromiscuous;// 是否接受混杂模式
	@Column("mac_changes")
	private Boolean macChanges;// 是否接受mac地址更改
	@Column("forged_transmits")
	private Boolean forgedTransmits;// 是否接受伪传输
	@Column("in_traffic_enabled")
	private Boolean inTrafficEnabled;// 是否启用输入流量调整
	@Column("in_average_band_width")
	private Long inAverageBandWidth;// 输入流量平均带宽
	@Column("in_peak_band_width")
	private Long inPeakBandWidth;// 输入流量带宽峰值
	@Column("in_burst_size")
	private Long inBurstSize;// 输入流量突发大小
	@Column("out_traffic_enabled")
	private Boolean outTrafficEnabled;// 是否启用输出流量调整
	@Column("out_average_band_width")
	private Long outAverageBandWidth;// 输出流量平均带宽
	@Column("out_peak_band_width")
	private Long outPeakBandWidth;// 输出流量带宽峰值
	@Column("out_burst_size")
	private Long outBurstSize;// 输出流量突发大小
	@Column("policy")
	private String policy;// 负载平衡
	@Column("check_beacon")
	private Boolean checkBeacon;// 网络故障切换检测
	@Column("notify_switches")
	private Boolean notifySwitches;// 通知交换机
	@Column("rolling_order")
	private Boolean rollingOrder;// 故障恢复
	@Column("active_nics")
	private String activeNics;// 活动适配器
	@Column("standby_nics")
	private String standbyNics;// 备用适配器
	@Column("ipfix_enabled")
	private Boolean ipfixEnabled;// NetFlow状态
	@Column("active_uplinks")
	private String activeUplinks;// 活动上行链路
	@Column("standby_uplinks")
	private String standbyUplinks;// 备用上行链路
	@Column("blocked")
	private Boolean blocked;// 是否组织所有端口
	@Column("disconnect_config_reset")
	private Boolean disconnectConfigReset;// 断开连接时配置重置
	@Column("allow_override_policy")
	private Boolean allowOverridePolicy;// 允许替代端口策略
	@Column("guid")
	private String guid;// guid
	@IgnoreAll
	private List<CloudServer> cloudServers;
	@IgnoreAll
	private String switchType;// 所在交换机类型
	@IgnoreAll
	private String switchName;// 交换机名称
	@IgnoreAll
	private Long networkId;// 网络id

	//fc 纳管
	@Column("uri")
	private String uri;//访问该cluster对应的uri地址
	@Column("is_ip_mac_bind")
	private Boolean isIpMacBind;//是否设置该端口组内的云主机的IP地址与MAC地址绑定，
	@Column("ip_bcst_suppress")
	private Integer ipBcstSuppress;//广播抑制：0表示未开启
	@Column("is_calc_tcp_check_sum")
	private Boolean isCalcTcpCheckSum;//填充tcp校检和：false表示关闭
	@Column("is_dhcp_isolation")
	private Boolean isDhcpIsolation;//dhcp隔离：false表示关闭
	@Column("vlan_range")
	private String vlanRange;
	//fc 纳管




	/**
	 * 
	 */
	public PortGroup() {
		super();
	}

	/**
	 * @param vendorId
	 * @param type
	 * @param portNum
	 * @param groupVal
	 * @param vlanId
	 * @param trunkVlan
	 * @param vlanType
	 * @param switcherId
	 * @param allowPromiscuous
	 * @param macChanges
	 * @param forgedTransmits
	 * @param inTrafficEnabled
	 * @param inAverageBandWidth
	 * @param inPeakBandWidth
	 * @param inBurstSize
	 * @param outTrafficEnabled
	 * @param outAverageBandWidth
	 * @param outPeakBandWidth
	 * @param outBurstSize
	 * @param policy
	 * @param checkBeacon
	 * @param notifySwitches
	 * @param rollingOrder
	 * @param activeNics
	 * @param standbyNics
	 * @param ipfixEnabled
	 * @param activeUplinks
	 * @param standbyUplinks
	 * @param blocked
	 * @param disconnectConfigReset
	 * @param allowOverridePolicy
	 * @param cloudServers
	 */
	public PortGroup(Long vendorId, String type, Integer portNum, String groupVal, Integer vlanId, String trunkVlan,
			String vlanType, Long switcherId, Boolean allowPromiscuous, Boolean macChanges, Boolean forgedTransmits,
			Boolean inTrafficEnabled, Long inAverageBandWidth, Long inPeakBandWidth, Long inBurstSize,
			Boolean outTrafficEnabled, Long outAverageBandWidth, Long outPeakBandWidth, Long outBurstSize,
			String policy, Boolean checkBeacon, Boolean notifySwitches, Boolean rollingOrder, String activeNics,
			String standbyNics, Boolean ipfixEnabled, String activeUplinks, String standbyUplinks, Boolean blocked,
			Boolean disconnectConfigReset, Boolean allowOverridePolicy, List<CloudServer> cloudServers) {
		super();
		this.vendorId = vendorId;
		this.type = type;
		this.portNum = portNum;
		this.groupVal = groupVal;
		this.vlanId = vlanId;
		this.trunkVlan = trunkVlan;
		this.vlanType = vlanType;
		this.switcherId = switcherId;
		this.allowPromiscuous = allowPromiscuous;
		this.macChanges = macChanges;
		this.forgedTransmits = forgedTransmits;
		this.inTrafficEnabled = inTrafficEnabled;
		this.inAverageBandWidth = inAverageBandWidth;
		this.inPeakBandWidth = inPeakBandWidth;
		this.inBurstSize = inBurstSize;
		this.outTrafficEnabled = outTrafficEnabled;
		this.outAverageBandWidth = outAverageBandWidth;
		this.outPeakBandWidth = outPeakBandWidth;
		this.outBurstSize = outBurstSize;
		this.policy = policy;
		this.checkBeacon = checkBeacon;
		this.notifySwitches = notifySwitches;
		this.rollingOrder = rollingOrder;
		this.activeNics = activeNics;
		this.standbyNics = standbyNics;
		this.ipfixEnabled = ipfixEnabled;
		this.activeUplinks = activeUplinks;
		this.standbyUplinks = standbyUplinks;
		this.blocked = blocked;
		this.disconnectConfigReset = disconnectConfigReset;
		this.allowOverridePolicy = allowOverridePolicy;
		this.cloudServers = cloudServers;
	}

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

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

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

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

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

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

	/**
	 * @return the portNum
	 */
	public Integer getPortNum() {
		return portNum;
	}

	/**
	 * @param portNum the portNum to set
	 */
	public void setPortNum(Integer portNum) {
		this.portNum = portNum;
	}

	/**
	 * @return the groupVal
	 */
	public String getGroupVal() {
		return groupVal;
	}

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

	/**
	 * @return the vlanId
	 */
	public Integer getVlanId() {
		return vlanId;
	}

	/**
	 * @param vlanId the vlanId to set
	 */
	public void setVlanId(Integer vlanId) {
		this.vlanId = vlanId;
	}

	/**
	 * @return the trunkVlan
	 */
	public String getTrunkVlan() {
		return trunkVlan;
	}

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

	/**
	 * @return the vlanType
	 */
	public String getVlanType() {
		return vlanType;
	}

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

	/**
	 * @return the switcherId
	 */
	public Long getSwitcherId() {
		return switcherId;
	}

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

	/**
	 * @return the allowPromiscuous
	 */
	public Boolean getAllowPromiscuous() {
		return allowPromiscuous;
	}

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

	/**
	 * @return the macChanges
	 */
	public Boolean getMacChanges() {
		return macChanges;
	}

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

	/**
	 * @return the forgedTransmits
	 */
	public Boolean getForgedTransmits() {
		return forgedTransmits;
	}

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

	/**
	 * @return the inTrafficEnabled
	 */
	public Boolean getInTrafficEnabled() {
		return inTrafficEnabled;
	}

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

	/**
	 * @return the inAverageBandWidth
	 */
	public Long getInAverageBandWidth() {
		return inAverageBandWidth;
	}

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

	/**
	 * @return the inPeakBandWidth
	 */
	public Long getInPeakBandWidth() {
		return inPeakBandWidth;
	}

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

	/**
	 * @return the inBurstSize
	 */
	public Long getInBurstSize() {
		return inBurstSize;
	}

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

	/**
	 * @return the outTrafficEnabled
	 */
	public Boolean getOutTrafficEnabled() {
		return outTrafficEnabled;
	}

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

	/**
	 * @return the outAverageBandWidth
	 */
	public Long getOutAverageBandWidth() {
		return outAverageBandWidth;
	}

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

	/**
	 * @return the outPeakBandWidth
	 */
	public Long getOutPeakBandWidth() {
		return outPeakBandWidth;
	}

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

	/**
	 * @return the outBurstSize
	 */
	public Long getOutBurstSize() {
		return outBurstSize;
	}

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

	/**
	 * @return the policy
	 */
	public String getPolicy() {
		return policy;
	}

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

	/**
	 * @return the checkBeacon
	 */
	public Boolean getCheckBeacon() {
		return checkBeacon;
	}

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

	/**
	 * @return the notifySwitches
	 */
	public Boolean getNotifySwitches() {
		return notifySwitches;
	}

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

	/**
	 * @return the rollingOrder
	 */
	public Boolean getRollingOrder() {
		return rollingOrder;
	}

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

	/**
	 * @return the activeNics
	 */
	public String getActiveNics() {
		return activeNics;
	}

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

	/**
	 * @return the standbyNics
	 */
	public String getStandbyNics() {
		return standbyNics;
	}

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

	/**
	 * @return the ipfixEnabled
	 */
	public Boolean getIpfixEnabled() {
		return ipfixEnabled;
	}

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

	/**
	 * @return the activeUplinks
	 */
	public String getActiveUplinks() {
		return activeUplinks;
	}

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

	/**
	 * @return the standbyUplinks
	 */
	public String getStandbyUplinks() {
		return standbyUplinks;
	}

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

	/**
	 * @return the blocked
	 */
	public Boolean getBlocked() {
		return blocked;
	}

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

	/**
	 * @return the disconnectConfigReset
	 */
	public Boolean getDisconnectConfigReset() {
		return disconnectConfigReset;
	}

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

	/**
	 * @return the allowOverridePolicy
	 */
	public Boolean getAllowOverridePolicy() {
		return allowOverridePolicy;
	}

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

	/**
	 * @return the cloudServers
	 */
	public List<CloudServer> getCloudServers() {
		return cloudServers;
	}

	/**
	 * @param cloudServers the cloudServers to set
	 */
	public void setCloudServers(List<CloudServer> cloudServers) {
		this.cloudServers = cloudServers;
	}

	/**
	 * @return the switchType
	 */
	public String getSwitchType() {
		return switchType;
	}

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

	/**
	 * @return the switchName
	 */
	public String getSwitchName() {
		return switchName;
	}

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

	public String getGuid() {
		return guid;
	}

	public void setGuid(String guid) {
		this.guid = guid;
	}

	public Long getNetworkId() {
		return networkId;
	}

	public void setNetworkId(Long networkId) {
		this.networkId = networkId;
	}

	public void preSave(Long creatorId, Long menderId, Long vendorId, Long switcherId) {
		this.setCreatorId(creatorId);
		this.setMenderId(menderId);
		this.setVendorId(vendorId);
		this.setSwitcherId(switcherId);
	}

}
