All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.emc.vipr.model.sys.ClusterInfo Maven / Gradle / Ivy

There is a newer version: 3.5.0.0
Show newest version
/*
 * Copyright (c) 2012 EMC Corporation
 * All Rights Reserved
 */
package com.emc.vipr.model.sys;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

import com.emc.storageos.model.RestLinkRep;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@XmlRootElement(name = "cluster_info")
public class ClusterInfo {

    public final static String CLUSTER_URI = "/upgrade/cluster-state";

    private String currentState;
    private Map controlNodes;
    private Map extraNodes;
    private NodeState targetState;
    private List newVersions;
    private List removableVersions;
    private RestLinkRep selfLink;

    public ClusterInfo() {
    }

    public ClusterInfo(String currentState,
            Map controlNodes,
            Map extraNodes, NodeState targetState,
            List newVersions, List removableVersions,
            RestLinkRep selfLink) {
        this.currentState = currentState;
        this.controlNodes = controlNodes;
        this.extraNodes = extraNodes;
        this.targetState = targetState;
        this.newVersions = newVersions;
        this.removableVersions = removableVersions;
        this.selfLink = selfLink;
    }

    @XmlElement(name = "cluster_state")
    public String getCurrentState() {
        return currentState;
    }

    public void setCurrentState(String state) {
        this.currentState = state;
    }

    @XmlElementWrapper(name = "control_nodes")
    public Map getControlNodes() {
        return controlNodes;
    }

    public void setControlNodes(Map controlNodes) {
        this.controlNodes = controlNodes;
    }

    @XmlElementWrapper(name = "extra_nodes")
    public Map getExtraNodes() {
        return extraNodes;
    }

    public void setExtraNodes(Map extraNodes) {
        this.extraNodes = extraNodes;
    }

    @XmlElement(name = "target_state")
    public NodeState getTargetState() {
        return targetState;
    }

    public void setTargetState(NodeState targetState) {
        this.targetState = targetState;
    }

    @XmlElementWrapper(name = "new_versions")
    @XmlElement(name = "new_version")
    public List getNewVersions() {
        return newVersions;
    }

    public void setNewVersions(List newVersions) {
        this.newVersions = newVersions;
    }

    @XmlElementWrapper(name = "removable_versions")
    @XmlElement(name = "removable_version")
    public List getRemovableVersions() {
        return removableVersions;
    }

    public void setRemovableVersions(List removableVersions) {
        this.removableVersions = removableVersions;
    }

    @XmlElement(name = "link")
    public RestLinkRep getSelfLink() {
        return selfLink;
    }

    public void setSelfLink(RestLinkRep selfLink) {
        this.selfLink = selfLink;
    }

    public static enum ClusterState {
        UNKNOWN,
        STABLE,
        SYNCING,
        UPGRADING,
        UPGRADING_PREP_DB,
        UPGRADING_CONVERT_DB,
        UPGRADING_FAILED,
        DEGRADED,
        UPDATING,
        POWERINGOFF,
        INITIALIZING,
    }

    public static class NodeState {

        private ArrayList available;
        private String current;
        private String configVersion;

        public NodeState() {
        }

        public NodeState(ArrayList available, String current,
                String configVersion) {
            super();
            this.available = available;
            this.current = current;
            this.configVersion = configVersion;
        }

        @XmlElementWrapper(name = "available_versions")
        @XmlElement(name = "available_version")
        public ArrayList getAvailable() {
            if (available == null) {
                available = new ArrayList();
            }
            return available;
        }

        public void setAvailable(ArrayList available) {
            this.available = available;
        }

        @XmlElement(name = "current_version")
        public String getCurrent() {
            return current;
        }

        public void setCurrent(String current) {
            this.current = current;
        }

        @XmlElement(name = "config_version")
        public String getConfigVersion() {
            return configVersion;
        }

        public void setConfigVersion(String configVersion) {
            this.configVersion = configVersion;
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy