package com.bocloud.nms.model.veeam.job;

import com.bocloud.nms.enums.EManagedServerType;
import com.bocloud.nms.enums.EViHostType;

public class ManagedServerModel {

    private String id;
    /**
     * DNS全名称或者IP地址
     */
    private String name;
    private String description;
    /**
     * 服务器类型
     */
    private EManagedServerType type;
    /**
     * 用于连接主机的凭证记录ID
     */
    private String credentialsId;
    /**
     * server type 为WindowsHost
     */
    private WindowsHostPortsModel networkSettings;
    /**
     * server type 为LinuxHost
     */
    private LinuxHostSSHSettingsModel sshSettings;
    /**
     * server type 为ViHost
     * VMware vSphere 服务器类型
     */
    private EViHostType viHostType;
    /**
     * server type 为ViHost
     */
    private Integer port;

    public String getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public EManagedServerType getType() {
        return type;
    }

    public void setType(EManagedServerType type) {
        this.type = type;
    }

    public String getCredentialsId() {
        return credentialsId;
    }

    public void setCredentialsId(String credentialsId) {
        this.credentialsId = credentialsId;
    }

    public WindowsHostPortsModel getNetworkSettings() {
        return networkSettings;
    }

    public void setNetworkSettings(WindowsHostPortsModel networkSettings) {
        this.networkSettings = networkSettings;
    }

    public LinuxHostSSHSettingsModel getSshSettings() {
        return sshSettings;
    }

    public void setSshSettings(LinuxHostSSHSettingsModel sshSettings) {
        this.sshSettings = sshSettings;
    }

    public EViHostType getViHostType() {
        return viHostType;
    }

    public void setViHostType(EViHostType viHostType) {
        this.viHostType = viHostType;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    @Override
    public String toString() {

        StringBuilder builder = new StringBuilder("ManagedServerModel{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", description='" + description + '\'' +
                ", type=" + type +
                ", credentialsId='" + credentialsId + '\'');
        if(networkSettings!=null){
            return builder.append(", networkSettings=" + networkSettings + '}').toString();
        }
        if(sshSettings!=null){
            return builder.append(", sshSettings=" + sshSettings +'}').toString();
        }
            return builder.append(", viHostType=" + viHostType +
                    ", port=" + port +
                    '}').toString();

    }
}
