package com.bocloud.ims.entity.resource.hmc;

import com.bocloud.cmp.entity.enums.HmcPartitionType;
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;

/**
 * HMC分区类
 *
 * @author ShaolongTan
 */
@Deprecated
@Table("hmc_partition")
public class HmcPartition extends GenericEntity {

    @PK(value = PKStrategy.AUTO)
    private Long id; // ID
    @Column("server_id")
    private Long serverId;
    @Column("hmc_partition_id")
    private Integer hmcPartitionId;
    @Column("partition_type")
    private String partitionType;
    @Column("uuid")
    private String uuid;
    @Column("processor")
    private Double processor;
    @Column("memory")
    private Double memory;
    @Column("code")
    private String code;
    @Column("ip")
    private String ip;
    @Column("os_version")
    private String osVersion;
    @Column("led_on")
    private Boolean ledOn;
    @Column("processor_compatibility_mode")
    private String processorCompatibilityMode;
    @Column("key_lock_position")
    private String keyLockPosition;
    @Column("error_path_report")
    private Boolean errorPathReport;
    @Column("service_partition")
    private Boolean servicePartition;
    @Column("current_profile_sync")
    private String currentProfileSync;
    @Column("conn_monitor_enabled")
    private Boolean connMonitorEnabled; // 连接监视
    @Column("allow_performance_collection")
    private Boolean allowPerformanceCollection; // 允许性能数据收集
    @Column("rmc_state")
    private String rmcState;// rmc连接状态
    @Column("tenant_id")
    private Long tenantId;
    @Column("current_max_virtual_io_slots")
    private Integer currentMaxVirtualIOSlots;
    @Column("pending_processor_compatibility_mode")
    private String pendingProcessorCompatibilityMode;

    @IgnoreAll
    private String serverUuid;

    @IgnoreAll
    private String schemaVersion;

    @IgnoreAll
    private HmcProfile hmcLparProfile;

    @IgnoreAll
    private String profileName;

    @IgnoreAll
    private String serverName;

    @IgnoreAll
    private HmcPartitionProcessor hmcPartitionProcessor;

    @IgnoreAll
    private HmcPartitionMemory hmcPartitionMemory;

    @IgnoreAll
    private List<HmcPartitionIo> hmcPartitionIos;

    @IgnoreAll
    private List<HmcPartitionScsiAdapter> hmcPartitionScsiAdapters;

    @IgnoreAll
    private Double value;

    @IgnoreAll
    private List<HmcVirtualFibreChannelMapping> hmcVirtualFibreChannelMappings;

    @IgnoreAll
    private List<HmcPartitionNetworkAdapter> hmcPartitionNetworkAdapters;

    //用于cms监控
    @IgnoreAll
    private String thresholdGroupName;//阈值组

    @IgnoreAll
    private String policyName;//分发策略

    @IgnoreAll
    private Long ruleRelationId;//关联关系id

    @IgnoreAll
    private Long thresholdGroupId;  //阈值组ID

    @IgnoreAll
    private Long policyId; //分发策略ID

    public String getRmcState() {
        return rmcState;
    }

    public void setRmcState(String rmcState) {
        this.rmcState = rmcState;
    }

    public Long getTenantId() {
        return tenantId;
    }

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

    /**
     * @return the hmcPartitionScsiAdapters
     */
    public List<HmcPartitionScsiAdapter> getHmcPartitionScsiAdapters() {
        return hmcPartitionScsiAdapters;
    }

    /**
     * @param hmcPartitionScsiAdapters the hmcPartitionScsiAdapters to set
     */
    public void setHmcPartitionScsiAdapters(List<HmcPartitionScsiAdapter> hmcPartitionScsiAdapters) {
        this.hmcPartitionScsiAdapters = hmcPartitionScsiAdapters;
    }

    /**
     * @return the currentProfileSync
     */
    public String getCurrentProfileSync() {
        return currentProfileSync;
    }

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

    public Boolean getErrorPathReport() {
        return errorPathReport;
    }

    public void setErrorPathReport(Boolean errorPathReport) {
        this.errorPathReport = errorPathReport;
    }

    public Boolean getServicePartition() {
        return servicePartition;
    }

    public void setServicePartition(Boolean servicePartition) {
        this.servicePartition = servicePartition;
    }

    /**
     * @return the keyLockPosition
     */
    public String getKeyLockPosition() {
        return keyLockPosition;
    }

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

    /**
     * @return the connMonitorEnabled
     */
    public Boolean getConnMonitorEnabled() {
        return connMonitorEnabled;
    }

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

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

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

    /**
     * @return the serverId
     */
    public Long getServerId() {
        return serverId;
    }

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

    /**
     * @return the hmcPartitionId
     */
    public Integer getHmcPartitionId() {
        return hmcPartitionId;
    }

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

    /**
     * @return the partitionType
     */
    public String getPartitionType() {
        return partitionType;
    }

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

    /**
     * @return the uuid
     */
    public String getUuid() {
        return uuid;
    }

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

    /**
     * @return the processor
     */
    public Double getProcessor() {
        return processor;
    }

    /**
     * @param processor the processor to set
     */
    public void setProcessor(Double processor) {
        this.processor = processor;
    }

    /**
     * @return the memory
     */
    public Double getMemory() {
        return memory;
    }

    /**
     * @param memory the memory to set
     */
    public void setMemory(Double memory) {
        this.memory = memory;
    }

    /**
     * @return the code
     */
    public String getCode() {
        return code;
    }

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

    public String getOsVersion() {
        return osVersion;
    }

    public void setOsVersion(String osVersion) {
        this.osVersion = osVersion;
    }

    /**
     * @return the processorCompatibilityMode
     */
    public String getProcessorCompatibilityMode() {
        return processorCompatibilityMode;
    }

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

    /**
     * @return the serverUuid
     */
    public String getServerUuid() {
        return serverUuid;
    }

    public Boolean getLedOn() {
        return ledOn;
    }

    public void setLedOn(Boolean ledOn) {
        this.ledOn = ledOn;
    }

    /**
     * @return the schemaVersion
     */
    public String getSchemaVersion() {
        return schemaVersion;
    }

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

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

    /**
     * @return the hmcLparProfile
     */
    public HmcProfile getHmcLparProfile() {
        return hmcLparProfile;
    }

    /**
     * @return the profileName
     */
    public String getProfileName() {
        return profileName;
    }

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

    /**
     * @param hmcLparProfile the hmcLparProfile to set
     */
    public void setHmcLparProfile(HmcProfile hmcLparProfile) {
        this.hmcLparProfile = hmcLparProfile;
    }

    public String getServerName() {
        return serverName;
    }

    public void setServerName(String serverName) {
        this.serverName = serverName;
    }

    public HmcPartitionProcessor getHmcPartitionProcessor() {
        return hmcPartitionProcessor;
    }

    public void setHmcPartitionProcessor(HmcPartitionProcessor hmcPartitionProcessor) {
        this.hmcPartitionProcessor = hmcPartitionProcessor;
    }

    public HmcPartitionMemory getHmcPartitionMemory() {
        return hmcPartitionMemory;
    }

    public void setHmcPartitionMemory(HmcPartitionMemory hmcPartitionMemory) {
        this.hmcPartitionMemory = hmcPartitionMemory;
    }

    public List<HmcPartitionIo> getHmcPartitionIos() {
        return hmcPartitionIos;
    }

    public void setHmcPartitionIos(List<HmcPartitionIo> hmcPartitionIos) {
        this.hmcPartitionIos = hmcPartitionIos;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Integer getCurrentMaxVirtualIOSlots() {
        return currentMaxVirtualIOSlots;
    }

    public void setCurrentMaxVirtualIOSlots(Integer currentMaxVirtualIOSlots) {
        this.currentMaxVirtualIOSlots = currentMaxVirtualIOSlots;
    }

    public Boolean getAllowPerformanceCollection() {
        return allowPerformanceCollection;
    }

    public void setAllowPerformanceCollection(Boolean allowPerformanceCollection) {
        this.allowPerformanceCollection = allowPerformanceCollection;
    }

    public Double getValue() {
        return value;
    }

    public void setValue(Double value) {
        this.value = value;
    }

    public Boolean isVios() {
        Boolean isVios = false;
        if (HmcPartitionType.VIOS.getType().equals(partitionType)) {
            isVios = true;
        }

        return isVios;
    }

    public void preSave(Long creatorId, Long menderId, Long serverId) {
        this.setCreatorId(creatorId);
        this.setMenderId(menderId);
        this.setServerId(serverId);
    }

    public List<HmcVirtualFibreChannelMapping> getHmcVirtualFibreChannelMappings() {
        return hmcVirtualFibreChannelMappings;
    }

    public void setHmcVirtualFibreChannelMappings(List<HmcVirtualFibreChannelMapping> hmcVirtualFibreChannelMappings) {
        this.hmcVirtualFibreChannelMappings = hmcVirtualFibreChannelMappings;
    }

    public List<HmcPartitionNetworkAdapter> getHmcPartitionNetworkAdapters() {
        return hmcPartitionNetworkAdapters;
    }

    public void setHmcPartitionNetworkAdapters(List<HmcPartitionNetworkAdapter> hmcPartitionNetworkAdapters) {
        this.hmcPartitionNetworkAdapters = hmcPartitionNetworkAdapters;
    }

    public String getPendingProcessorCompatibilityMode() {
        return pendingProcessorCompatibilityMode;
    }


    public void setPendingProcessorCompatibilityMode(String pendingProcessorCompatibilityMode) {
        this.pendingProcessorCompatibilityMode = pendingProcessorCompatibilityMode;
    }


    public String getThresholdGroupName() {
        return thresholdGroupName;
    }

    public void setThresholdGroupName(String thresholdGroupName) {
        this.thresholdGroupName = thresholdGroupName;
    }

    public String getPolicyName() {
        return policyName;
    }

    public void setPolicyName(String policyName) {
        this.policyName = policyName;
    }

    public Long getRuleRelationId() {
        return ruleRelationId;
    }

    public void setRuleRelationId(Long ruleRelationId) {
        this.ruleRelationId = ruleRelationId;
    }

    public Long getThresholdGroupId() {
        return thresholdGroupId;
    }

    public void setThresholdGroupId(Long thresholdGroupId) {
        this.thresholdGroupId = thresholdGroupId;
    }

    public Long getPolicyId() {
        return policyId;
    }

    public void setPolicyId(Long policyId) {
        this.policyId = policyId;
    }
}
