Search in sources :

Example 1 with NodeState

use of com.emc.vipr.model.sys.ClusterInfo.NodeState in project coprhd-controller by CoprHD.

the class ClusterInfoMapper method toClusterInfo.

public static ClusterInfo toClusterInfo(final ClusterState controlNodesState, final Map<Service, RepositoryInfo> controlNodesInfo, final Map<Service, ConfigVersion> controlNodesConfigVersions, final RepositoryInfo targetRepository, final PropertyInfoExt targetProperty) {
    ClusterInfo toClusterInfo = new ClusterInfo();
    toClusterInfo.setCurrentState((controlNodesState != ClusterState.STABLE) ? controlNodesState.toString() : ClusterState.STABLE.toString());
    if (!controlNodesInfo.isEmpty()) {
        toClusterInfo.setControlNodes(new HashMap<String, NodeState>());
        for (Map.Entry<Service, RepositoryInfo> entry : controlNodesInfo.entrySet()) {
            addControlNodeInfo(toClusterInfo, entry.getKey().getNodeId(), entry.getValue(), controlNodesConfigVersions != null ? controlNodesConfigVersions.get(entry.getKey()) : null);
        }
    }
    if (targetRepository != null) {
        addTargetInfo(toClusterInfo, targetRepository, targetProperty);
    }
    return toClusterInfo;
}
Also used : ClusterInfo(com.emc.vipr.model.sys.ClusterInfo) NodeState(com.emc.vipr.model.sys.ClusterInfo.NodeState) RepositoryInfo(com.emc.storageos.coordinator.client.model.RepositoryInfo) Service(com.emc.storageos.coordinator.common.Service) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

RepositoryInfo (com.emc.storageos.coordinator.client.model.RepositoryInfo)1 Service (com.emc.storageos.coordinator.common.Service)1 ClusterInfo (com.emc.vipr.model.sys.ClusterInfo)1 NodeState (com.emc.vipr.model.sys.ClusterInfo.NodeState)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1