package com.bocloud.ims.entity.resource;

import com.bocloud.common.model.RequestContext.Catalog;
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 dongkai
 */
@Table("network")
public class Network extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id; // ID
	@Column("network_uuid")
	private String networkUuid; // 网络ID
	@Column("vendor_id")
	private Long vendorId; // 云供应商ID
	@Column("region")
	private Long region; // 所在区域
	@Column("type")
	private String type;// 网络类型
	@Column("shared")
	private Boolean shared;// 是否共享
	@Column("admin_stateup")
	private Boolean adminStateup;
	@Column("network_val")
	private String networkVal;// 网络value
	@Column("vdc_id")
	private Long vdcId; // 数据中心ID
	@Column("port_num")
	private Integer portNum;// 端口数量
	@Column("is_router_external")
	private Boolean isRouterExternal;// 是否外部访问
	@Column("segmentation_id")
	private String segmentationId;// 段Id
	@Column("phy_network")
	private String phyNetwork;// 物理网络
	@Column("switcher_id")
	private Long switcherId; // 交换机ID
	@Column("opaque_network_type")
	private String opaqueNetworkType;// 模糊网络类型
	@IgnoreAll
	private String vendorName; // 云供应商名称
	@IgnoreAll
	private String vdcName; // 数据中心名称
	@IgnoreAll
	private String regionName; // 所在区域名称
	@IgnoreAll
	private Long subnetNum;
	@IgnoreAll
	private String tenantName;
	@IgnoreAll
	private String projectVisibility;
	@Column("guid")
	private String guid;// 全局唯一标识
	@Column("region_id")
	private String regionId;
	@Column("mtu")
	private Integer mtu; // MTU即网络传输的最大数据包，单位字节
	@Column("tenant_uuid")
	private String tenantUuid; // OpenStack底层租户id
	@IgnoreAll
	private String osTenantName;
	@IgnoreAll
	private List<Subnet> subnets;
	@IgnoreAll
	@Column("vendor_type")
	private String vendorType;

	@Column("business_id")
	private Long businessId;
	@Column("tenant_id")
	private Long tenantId;// 租户ID
	@Column("project_id")
	private Long projectId;// 项目ID
	@Column("catalog")
	private Catalog Catalog;// 账号类别

	public Long getSubnetNum() {
		return subnetNum;
	}

	public void setSubnetNum(Long subnetNum) {
		this.subnetNum = subnetNum;
	}

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

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

	/**
	 * @return the networkUuid
	 */
	public String getNetworkUuid() {
		return networkUuid;
	}

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

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

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

	/**
	 * @return the region
	 */
	public Long getRegion() {
		return region;
	}

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

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

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

	/**
	 * @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 networkVal
	 */
	public String getNetworkVal() {
		return networkVal;
	}

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

	/**
	 * @return the vdcId
	 */
	public Long getVdcId() {
		return vdcId;
	}

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

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

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

	/**
	 * @return the isRouterExternal
	 */
	public Boolean getIsRouterExternal() {
		return isRouterExternal;
	}

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

	/**
	 * @return the segmentationId
	 */
	public String getSegmentationId() {
		return segmentationId;
	}

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

	/**
	 * @return the phyNetwork
	 */
	public String getPhyNetwork() {
		return phyNetwork;
	}

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

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

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

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

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

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

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

	/**
	 * @return the vdcName
	 */
	public String getVdcName() {
		return vdcName;
	}

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

	/**
	 * @return the regionName
	 */
	public String getRegionName() {
		return regionName;
	}

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

	/**
	 * @return the guid
	 */
	public String getGuid() {
		return guid;
	}

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

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

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

	public String getTenantUuid() {
		return tenantUuid;
	}

	public void setTenantUuid(String tenantUuid) {
		this.tenantUuid = tenantUuid;
	}

	public Network() {
		super();
	}

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

	public String getRegionId() {
		return regionId;
	}

	public void setRegionId(String regionId) {
		this.regionId = regionId;
	}

	public String getProjectVisibility() {
		return projectVisibility;
	}

	public void setProjectVisibility(String projectVisibility) {
		this.projectVisibility = projectVisibility;
	}

	public Integer getMtu() {
		return mtu;
	}

	public void setMtu(Integer mtu) {
		this.mtu = mtu;
	}

	public String getOsTenantName() {
		return osTenantName;
	}

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

	public String getOpaqueNetworkType() {
		return opaqueNetworkType;
	}

	public void setOpaqueNetworkType(String opaqueNetworkType) {
		this.opaqueNetworkType = opaqueNetworkType;
	}

	public List<Subnet> getSubnets() {
		return subnets;
	}

	public void setSubnets(List<Subnet> subnets) {
		this.subnets = subnets;
	}

	public String getVendorType() {
		return vendorType;
	}

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

	public Long getBusinessId() {
		return businessId;
	}

	public void setBusinessId(Long businessId) {
		this.businessId = businessId;
	}

	public Long getTenantId() {
		return tenantId;
	}

	public void setTenantId(Long tenantId) {
		this.tenantId = tenantId;
	}

	public Long getProjectId() {
		return projectId;
	}

	public void setProjectId(Long projectId) {
		this.projectId = projectId;
	}

	public Catalog getCatalog() {
		return Catalog;
	}

	public void setCatalog(Catalog catalog) {
		Catalog = catalog;
	}

}
