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;

/**
 * 资源池实体类
 * 
 * @author wangyu
 * @version 1.0
 * @since 2017年11月24日
 *
 */
@Table("resource_pool")
public class VmResourcePool extends GenericEntity {

	@PK(value = PKStrategy.AUTO)
	private Long id;// ID
	@Column("parent_id")
	private Long parentId;// 父资源池
	@Column("cpu_reservation")
	private Long cpuReservation;// CPU预留
	@Column("cpu_expan_reservation")
	private Boolean cpuExpanReservation;// CPU可扩展预留
	@Column("cpu_limit")
	private Long cpuLimit;// CPU限制
	@Column("cpu_shares")
	private int cpuShares;// CPU份额值
	@Column("cpu_share_level")
	private String cpuShareLevel;// CPU份额
	@Column("mem_reservation")
	private Long memReservation;// 内存预留
	@Column("mem_expan_reservation")
	private Boolean memExpanReservation;// 内存可扩展预留
	@Column("mem_limit")
	private Long memLimit;// 内存限制
	@Column("mem_shares")
	private int memShares;// 内存份额值
	@Column("mem_share_level")
	private String memShareLevel;// 内存份额
	@Column("pool_val")
	private String poolVal;// 资源池value
	@Column("vdc_id")
	private Long vdcId;// 数据中心ID
	@Column("owner")
	private Long owner;// 资源池所属
	@Column("owner_category")
	private String ownerCategory;// 资源池所属类别
	@Column("vendor_id")
	private Long vendorId;// 云平台ID
	@Column("tenant_id")
	private Long tenantId;// 租户ID
	@IgnoreAll
	private String children;// 子资源池
	@IgnoreAll
	private String hostName;// 宿主机名称
	@IgnoreAll
	private String hostVal;// 宿主机value
	@IgnoreAll
	private String clusterName;// 集群名称
	@IgnoreAll
	private String clusterVal;// 集群value
	@IgnoreAll
	private String vdcName;// 数据中心名称
	@IgnoreAll
	private String parentName;// 父资源池名称
	@IgnoreAll
	private String parentPoolVal;// 父资源池value
	@IgnoreAll
	private String ownerName;// 所属名称

	// 版本
	@IgnoreAll
	private String version;

	// 服务器数量（主机数量）
	@IgnoreAll
	private Integer hostCount;

	// 云主机数量（实例数量）
	@IgnoreAll
	private Integer instanceCount;

	// 模板数量
	@IgnoreAll
	private Integer templateCount;

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

	/**
	 * @param parentId
	 * @param cpuReservation
	 * @param cpuExpanReservation
	 * @param cpuLimit
	 * @param cpuShares
	 * @param cpuShareLevel
	 * @param memReservation
	 * @param memExpanReservation
	 * @param memLimit
	 * @param memShares
	 * @param memShareLevel
	 * @param poolVal
	 * @param vdcId
	 * @param owner
	 * @param ownerCategory
	 * @param vendorId
	 * @param tenantId
	 * @param children
	 * @param hostName
	 * @param hostVal
	 * @param clusterName
	 * @param clusterVal
	 * @param vdcName
	 * @param parentName
	 * @param parentPoolVal
	 */
	public VmResourcePool(Long parentId, Long cpuReservation, Boolean cpuExpanReservation, Long cpuLimit, int cpuShares,
						  String cpuShareLevel, Long memReservation, Boolean memExpanReservation, Long memLimit, int memShares,
						  String memShareLevel, String poolVal, Long vdcId, Long owner, String ownerCategory, Long vendorId,
						  Long tenantId, String children, String hostName, String hostVal, String clusterName, String clusterVal,
						  String vdcName, String parentName, String parentPoolVal) {
		super();
		this.parentId = parentId;
		this.cpuReservation = cpuReservation;
		this.cpuExpanReservation = cpuExpanReservation;
		this.cpuLimit = cpuLimit;
		this.cpuShares = cpuShares;
		this.cpuShareLevel = cpuShareLevel;
		this.memReservation = memReservation;
		this.memExpanReservation = memExpanReservation;
		this.memLimit = memLimit;
		this.memShares = memShares;
		this.memShareLevel = memShareLevel;
		this.poolVal = poolVal;
		this.vdcId = vdcId;
		this.owner = owner;
		this.ownerCategory = ownerCategory;
		this.vendorId = vendorId;
		this.tenantId = tenantId;
		this.children = children;
		this.hostName = hostName;
		this.hostVal = hostVal;
		this.clusterName = clusterName;
		this.clusterVal = clusterVal;
		this.vdcName = vdcName;
		this.parentName = parentName;
		this.parentPoolVal = parentPoolVal;
	}

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

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

	/**
	 * @return the parentId
	 */
	public Long getParentId() {
		return parentId;
	}

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

	/**
	 * @return the cpuReservation
	 */
	public Long getCpuReservation() {
		return cpuReservation;
	}

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

	/**
	 * @return the cpuExpanReservation
	 */
	public Boolean getCpuExpanReservation() {
		return cpuExpanReservation;
	}

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

	/**
	 * @return the cpuLimit
	 */
	public Long getCpuLimit() {
		return cpuLimit;
	}

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

	/**
	 * @return the cpuShares
	 */
	public int getCpuShares() {
		return cpuShares;
	}

	/**
	 * @param cpuShares the cpuShares to set
	 */
	public void setCpuShares(int cpuShares) {
		this.cpuShares = cpuShares;
	}

	/**
	 * @return the cpuShareLevel
	 */
	public String getCpuShareLevel() {
		return cpuShareLevel;
	}

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

	/**
	 * @return the memReservation
	 */
	public Long getMemReservation() {
		return memReservation;
	}

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

	/**
	 * @return the memExpanReservation
	 */
	public Boolean getMemExpanReservation() {
		return memExpanReservation;
	}

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

	/**
	 * @return the memLimit
	 */
	public Long getMemLimit() {
		return memLimit;
	}

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

	/**
	 * @return the memShares
	 */
	public int getMemShares() {
		return memShares;
	}

	/**
	 * @param memShares the memShares to set
	 */
	public void setMemShares(int memShares) {
		this.memShares = memShares;
	}

	/**
	 * @return the memShareLevel
	 */
	public String getMemShareLevel() {
		return memShareLevel;
	}

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

	/**
	 * @return the poolVal
	 */
	public String getPoolVal() {
		return poolVal;
	}

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

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

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

	/**
	 * @return the owner
	 */
	public Long getOwner() {
		return owner;
	}

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

	/**
	 * @return the ownerCategory
	 */
	public String getOwnerCategory() {
		return ownerCategory;
	}

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

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

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

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

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

	/**
	 * @return the children
	 */
	public String getChildren() {
		return children;
	}

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

	/**
	 * @return the hostName
	 */
	public String getHostName() {
		return hostName;
	}

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

	/**
	 * @return the hostVal
	 */
	public String getHostVal() {
		return hostVal;
	}

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

	/**
	 * @return the clusterName
	 */
	public String getClusterName() {
		return clusterName;
	}

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

	/**
	 * @return the clusterVal
	 */
	public String getClusterVal() {
		return clusterVal;
	}

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

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

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

	/**
	 * @return the parentName
	 */
	public String getParentName() {
		return parentName;
	}

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

	/**
	 * @return the parentPoolVal
	 */
	public String getParentPoolVal() {
		return parentPoolVal;
	}

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

	/**
	 * @return the ownerName
	 */
	public String getOwnerName() {
		return ownerName;
	}

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

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public Integer getHostCount() {
		return hostCount;
	}

	public void setHostCount(Integer hostCount) {
		this.hostCount = hostCount;
	}

	public Integer getInstanceCount() {
		return instanceCount;
	}

	public void setInstanceCount(Integer instanceCount) {
		this.instanceCount = instanceCount;
	}

	public Integer getTemplateCount() {
		return templateCount;
	}

	public void setTemplateCount(Integer templateCount) {
		this.templateCount = templateCount;
	}

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