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;
}
Aggregations