package com.bocloud.ims.entity.resource;

import com.bocloud.common.utils.DateDeserializer;
import com.bocloud.common.utils.DaySerializer;
import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.IgnoreAll;
import com.bocloud.entity.annotations.IgnoreInsert;
import com.bocloud.entity.annotations.IgnoreUpdate;
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 com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 数据中心类
 *
 * @author wei wei
 * @version 1.0
 * @since 2016.02.26
 */
@Table("data_center")
public class DataCenter extends GenericEntity {

    @PK(value = PKStrategy.AUTO)
    private Long id; // ID
    @Column("address")
    private String address; // 所在地址
    @Column("contact_phone")
    private String contactPhone; // 联系电话
    @Column("contacter")
    private String contacter; // 联系人
    @Column("contact_email")
    private String contactEmail; // 联系邮箱
    @Column("emergency_phone")
    private String emergencyPhone; // 紧急电话
    @Column("vendor")
    private String vendor; // 承建商
    @Column("commission_date")
    @JsonSerialize(using = DaySerializer.class)
    @JsonDeserialize(using = DateDeserializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date commissionDate; // 投产日期
    @Column("total_area")
    private String totalArea; // 总面积
    @Column("province")
    private String province; // 省份
    @Column("city")
    private String city; // 城市
    @Column("coordinate")
    private String coordinate; // 经纬度
    @Column("config")
    private String config; // 配置
    @IgnoreInsert
    @IgnoreUpdate
    private Integer centers; // 数据中心数量
    @IgnoreInsert
    @IgnoreUpdate
    private Integer rooms; // 机房数量
    @IgnoreInsert
    @IgnoreUpdate
    private Integer racks; // 机柜数量
    @IgnoreInsert
    @IgnoreUpdate
    private Integer servers; // 服务器数量
    @IgnoreInsert
    @IgnoreUpdate
    private Integer clusters; // 集群数量
    @IgnoreInsert
    @IgnoreUpdate
    private Integer pools; // 资源池数量
    @IgnoreAll
    private String used; // 已使用的面积
    @IgnoreAll
    private Long cmdbId;// cmdb对应主键ID
    @IgnoreAll
    private String zoneName;// 所属域名称
    @IgnoreAll
    private Integer vmCount; // 虚拟机数量
    @IgnoreAll
    private Integer pmCount; // 物理机数量
    @IgnoreAll
    private Integer dsCount; // 存储数量

    public Long getCmdbId() {
        return cmdbId;
    }

    public void setCmdbId(Long cmdbId) {
        this.cmdbId = cmdbId;
    }

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

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

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

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

    /**
     * @return the contactPhone
     */
    public String getContactPhone() {
        return contactPhone;
    }

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

    /**
     * @return the contacter
     */
    public String getContacter() {
        return contacter;
    }

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

    /**
     * @return the contactEmail
     */
    public String getContactEmail() {
        return contactEmail;
    }

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

    /**
     * @return the emergencyPhone
     */
    public String getEmergencyPhone() {
        return emergencyPhone;
    }

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

    /**
     * @return the vendor
     */
    public String getVendor() {
        return vendor;
    }

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

    /**
     * @return the commissionDate
     */
    public Date getCommissionDate() {
        return commissionDate;
    }

    /**
     * @param commissionDate the commissionDate to set
     */
    public void setCommissionDate(Date commissionDate) {
        this.commissionDate = commissionDate;
    }

    /**
     * @return the totalArea
     */
    public String getTotalArea() {
        return totalArea;
    }

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

    /**
     * @return the province
     */
    public String getProvince() {
        return province;
    }

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

    /**
     * @return the city
     */
    public String getCity() {
        return city;
    }

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

    /**
     * @return the coordinate
     */
    public String getCoordinate() {
        return coordinate;
    }

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

    /**
     * @return the centers
     */
    public Integer getCenters() {
        return centers;
    }

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

    /**
     * @return the rooms
     */
    public Integer getRooms() {
        return rooms;
    }

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

    /**
     * @return the racks
     */
    public Integer getRacks() {
        return racks;
    }

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

    /**
     * @return the servers
     */
    public Integer getServers() {
        return servers;
    }

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

    /**
     * @return the clusters
     */
    public Integer getClusters() {
        return clusters;
    }

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

    /**
     * @return the pools
     */
    public Integer getPools() {
        return pools;
    }

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

    public String getUsed() {
        return used;
    }

    public void setUsed(String used) {
        this.used = used;
    }

    public String getZoneName() {
        return zoneName;
    }

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

    public String getConfig() {
        return config;
    }

    public void setConfig(String config) {
        this.config = config;
    }

    public Integer getVmCount() {
        return vmCount;
    }

    public void setVmCount(Integer vmCount) {
        this.vmCount = vmCount;
    }

    public Integer getPmCount() {
        return pmCount;
    }

    public void setPmCount(Integer pmCount) {
        this.pmCount = pmCount;
    }

    public Integer getDsCount() {
        return dsCount;
    }

    public void setDsCount(Integer dsCount) {
        this.dsCount = dsCount;
    }

}
