package com.bocloud.cmp.model.hmc;

/**
 * HMC系统CPU配置
 *
 * @author sxp
 * @since May 22, 2018
 */
@Deprecated
public class HmcSystemProcessorConfigModel {
    private Long id;
    private Long serverId;
    private Double currentAvailableSystemProcessorUnits;
    private Double configurableSystemProcessorUnits;
    private Double installedSystemProcessorUnits;
    private String supportedPartitionProcessorCompatibilityModes;
    private String sharedProcessorPoolCapable;
    private Double assignedSystemProcessorUnit;

    public HmcSystemProcessorConfigModel() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getServerId() {
        return serverId;
    }

    public void setServerId(Long serverId) {
        this.serverId = serverId;
    }

    public Double getCurrentAvailableSystemProcessorUnits() {
        return currentAvailableSystemProcessorUnits;
    }

    public void setCurrentAvailableSystemProcessorUnits(Double currentAvailableSystemProcessorUnits) {
        this.currentAvailableSystemProcessorUnits = currentAvailableSystemProcessorUnits;
    }

    public Double getConfigurableSystemProcessorUnits() {
        return configurableSystemProcessorUnits;
    }

    public void setConfigurableSystemProcessorUnits(Double configurableSystemProcessorUnits) {
        this.configurableSystemProcessorUnits = configurableSystemProcessorUnits;
    }

    public Double getInstalledSystemProcessorUnits() {
        return installedSystemProcessorUnits;
    }

    public void setInstalledSystemProcessorUnits(Double installedSystemProcessorUnits) {
        this.installedSystemProcessorUnits = installedSystemProcessorUnits;
    }

    public String getSharedProcessorPoolCapable() {
        return sharedProcessorPoolCapable;
    }

    public void setSharedProcessorPoolCapable(String sharedProcessorPoolCapable) {
        this.sharedProcessorPoolCapable = sharedProcessorPoolCapable;
    }

    public Double getAssignedSystemProcessorUnit() {
        return assignedSystemProcessorUnit;
    }

    public void setAssignedSystemProcessorUnit(Double assignedSystemProcessorUnit) {
        this.assignedSystemProcessorUnit = assignedSystemProcessorUnit;
    }

    public void calculateAssignedSystemProcessorUnit() {
        if (currentAvailableSystemProcessorUnits == null || configurableSystemProcessorUnits == null) {
            return;
        }
        // 可配置的 - 可用的
        double assigned = configurableSystemProcessorUnits - currentAvailableSystemProcessorUnits;
        assignedSystemProcessorUnit = Math.round(assigned * 100) / 100D;
    }

    public String getSupportedPartitionProcessorCompatibilityModes() {
        return supportedPartitionProcessorCompatibilityModes;
    }

    public void setSupportedPartitionProcessorCompatibilityModes(String supportedPartitionProcessorCompatibilityModes) {
        this.supportedPartitionProcessorCompatibilityModes = supportedPartitionProcessorCompatibilityModes;
    }
}
