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

/**
 * 子网实体类
 *
 * @author dongkai
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@Table("subnet")
public class Subnet extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id; // ID
	@Column("ip_pools")
	private String ipPools;
	@Column("cidr")
	private String cidr;
	@Column("dhcp_enabled")
	private Boolean dhcpEnabled;
	@Column("dhcp_server_ip")
	private String dhcpServerIp;
	@Column("gateway")
	private String gateway;
	@Column("netmask")
	private String netmask;
	@Column("vlan")
	private Integer vlan;
	@Column("dns_names")
	private String dnsNames;
	@Column("host_routes")
	private String hostRoutes;
	@Column("subnet_uuid")
	private String subnetUuid;
	@Column("ip_version")
	private String ipVersion;
	@Column("network_uuid")
	private String networkUuid;
	@Column("vendor_id")
	private Long vendorId; // 云供应商ID
	@Column("region")
	private Long region;
	@Column("portgroup")
	private String portgroup;
	@Column("mac")
	private String mac;
	@Column("address")
	private String address;
	@Column("network_id")
	private Long networkId; // 网络ID
	@IgnoreAll
	private String networkName;
	@Column("guid")
	private String guid;// 全局唯一标识
	@Column("zone")
	private String zone;
	@IgnoreAll
	private String zoneName;
	@IgnoreAll
	private String regionName;
	@IgnoreAll
	private String dnsName;

	@Column("region_id")
	private String regionId;
	@Column("router_id")
	private Long routerId;
	@Column("port_uuid")
	private String portUuid;
	@Column("vpc_id")
	private Long vpcId;
	@Column("vpc_uuid")
	private String vpcUuid;
	@IgnoreAll
	private String vendorType;
	@IgnoreAll
	private String routeTableUuid;
	@IgnoreAll
	private Long associationId;
	@IgnoreAll
	private Boolean ipV6Enable;
	// azure -新增字段
	@Column("security_group_id")
	private Long securityGroupId;
	@Column("tenant_uuid")
	private String tenantUuid;// openstack底层租户id
	@Column("labels")
	private String labels;
	@Column("ipv6_cidr")
	private String ipv6Cidr;// ipv6Cidr
	@Column("ip_pool_id")
	private String ipPoolId;// IT资源系统的对应ID
	@Column("net_info_id")
	private String netInfoId;
	@Column("v6_net_info_id")
	private String v6NetInfoId;
	@Column("route_table_id")
	private String routeTableId;//路由表
	@Column("route_table_type")
	private String routeTableType;//路由表类型
	@Column("resource_group_uuid")
	private String resourceGroupUuid; // 资源组ID
	@IgnoreAll
	private String resourceGroupName; // 资源组标识
	@IgnoreAll
	private Long zoneId; 
	@IgnoreAll
	private String zoneNum; 
	@IgnoreAll
	private String vpcName; 

	@Column("neutron_subnet_uuid")
	private String neutronSubnetUuid; //
	@Column("neutron_subnet_v6_uuid")
	private String neutronSubnetV6Uuid; //
	@Column("router_table_id")
	private Long routerTableId;


	public Long getSecurityGroupId() {
		return securityGroupId;
	}

	public void setSecurityGroupId(Long securityGroupId) {
		this.securityGroupId = securityGroupId;
	}

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

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

	public String getIpPools() {
		return ipPools;
	}

	public void setIpPools(String ipPools) {
		this.ipPools = ipPools;
	}

	/**
	 * @return the cidr
	 */
	public String getCidr() {
		return cidr;
	}

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

	/**
	 * @return the dhcpEnabled
	 */
	public Boolean getDhcpEnabled() {
		return dhcpEnabled;
	}

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

	/**
	 * @return the gateway
	 */
	public String getGateway() {
		return gateway;
	}

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

	/**
	 * @return the dnsNames
	 */
	public String getDnsNames() {
		return dnsNames;
	}

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

	/**
	 * @return the hostRoutes
	 */
	public String getHostRoutes() {
		return hostRoutes;
	}

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

	/**
	 * @return the subnetUuid
	 */
	public String getSubnetUuid() {
		return subnetUuid;
	}

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

	/**
	 * @return the ipVersion
	 */
	public String getIpVersion() {
		return ipVersion;
	}

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

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

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

	/**
	 * @return the mac
	 */
	public String getMac() {
		return mac;
	}

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

	/**
	 * @return the address
	 */
	public String getAddress() {
		return address;
	}

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

	/**
	 * @return the networkId
	 */
	public Long getNetworkId() {
		return networkId;
	}

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

	/**
	 * @return the networkName
	 */
	public String getNetworkName() {
		return networkName;
	}

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

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

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

	public Subnet() {
		super();
	}

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

	public String getZone() {
		return zone;
	}

	public void setZone(String zone) {
		this.zone = zone;
	}

	public String getZoneName() {
		return zoneName;
	}

	public void setZoneName(String zoneName) {
		this.zoneName = zoneName;
	}

	public String getRegionId() {
		return regionId;
	}

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

	public String getPortUuid() {
		return portUuid;
	}

	public void setPortUuid(String portUuid) {
		this.portUuid = portUuid;
	}

	public String getRegionName() {
		return regionName;
	}

	public void setRegionName(String regionName) {
		this.regionName = regionName;
	}

	public String getVpcUuid() {
		return vpcUuid;
	}

	public void setVpcUuid(String vpcUuid) {
		this.vpcUuid = vpcUuid;
	}

	public String getVendorType() {
		return vendorType;
	}

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

	public String getNetmask() {
		return netmask;
	}

	public void setNetmask(String netmask) {
		this.netmask = netmask;
	}

	public String getTenantUuid() {
		return tenantUuid;
	}

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

	public Long getRouterId() {
		return routerId;
	}

	public void setRouterId(Long routerId) {
		this.routerId = routerId;
	}

	public Long getVpcId() {
		return vpcId;
	}

	public void setVpcId(Long vpcId) {
		this.vpcId = vpcId;
	}

}
