use of com.emc.storageos.coordinator.client.model.VdcConfigVersion in project coprhd-controller by CoprHD.
the class CoordinatorClientImpl method getDifferentVdcConfigVersionCommon.
/**
* Common method to compare vdcConfigVersions with target's vdcConfigVersion
*
* @param vdcConfigVersions
* nodes' vdcConfigVersions
* @return list of nodes which configVersions are different from the target's
*/
private List<String> getDifferentVdcConfigVersionCommon(final Map<Service, VdcConfigVersion> vdcConfigVersions) {
List<String> differentConfigVersions = new ArrayList<String>();
SiteInfo targetSiteInfo = getTargetInfo(SiteInfo.class);
if (targetSiteInfo == null) {
return differentConfigVersions;
}
String targetVdcConfigVersion = String.valueOf(targetSiteInfo.getVdcConfigVersion());
for (Map.Entry<Service, VdcConfigVersion> entry : vdcConfigVersions.entrySet()) {
if (!StringUtils.equals(targetVdcConfigVersion, entry.getValue().getConfigVersion())) {
differentConfigVersions.add(entry.getKey().getId());
}
}
return differentConfigVersions;
}
use of com.emc.storageos.coordinator.client.model.VdcConfigVersion in project coprhd-controller by CoprHD.
the class CoordinatorClientImpl method getControlNodesState.
@Override
public ClusterInfo.ClusterState getControlNodesState(String siteId) {
try {
// get target repository and configVersion
final RepositoryInfo targetRepository = getTargetInfo(RepositoryInfo.class);
final PropertyInfoRestRep targetProperty = getTargetInfo(PropertyInfoExt.class);
final PowerOffState targetPowerOffState = getTargetInfo(PowerOffState.class);
final StorageDriversInfo targetDrivers = getTargetInfo(StorageDriversInfo.class);
// get control nodes' repository and configVersion info
final Map<Service, RepositoryInfo> controlNodesInfo = getAllNodeInfos(RepositoryInfo.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
final Map<Service, ConfigVersion> controlNodesConfigVersions = getAllNodeInfos(ConfigVersion.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
final Map<Service, VdcConfigVersion> controlNodesVdcConfigVersions = getAllNodeInfos(VdcConfigVersion.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
final Map<Service, StorageDriversInfo> controlNodesDrivers = getAllNodeInfos(StorageDriversInfo.class, CONTROL_NODE_SYSSVC_ID_PATTERN, siteId);
return getControlNodesState(targetRepository, controlNodesInfo, targetProperty, controlNodesConfigVersions, controlNodesVdcConfigVersions, targetPowerOffState, targetDrivers, controlNodesDrivers, siteId);
} catch (Exception e) {
log.info("Fail to get the control node information ", e);
return ClusterInfo.ClusterState.UNKNOWN;
}
}
Aggregations