use of com.emc.fapiclient.ws.RemoteClusterConnectionInformation in project coprhd-controller by CoprHD.
the class RecoverPointClient method getClusterTopology.
public Set<String> getClusterTopology() throws RecoverPointException {
Set<String> clusterTopology = new HashSet<String>();
String mgmtIPAddress = _endpoint.toASCIIString();
if (null == mgmtIPAddress) {
throw RecoverPointException.exceptions.noRecoverPointEndpoint();
}
try {
Map<Long, String> clusterSiteNameMap = new HashMap<Long, String>();
for (ClusterConfiguration clusterInfo : functionalAPI.getFullRecoverPointSettings().getSystemSettings().getGlobalSystemConfiguration().getClustersConfigurations()) {
clusterSiteNameMap.put(clusterInfo.getCluster().getId(), clusterInfo.getInternalClusterName());
}
logger.info("RecoverPoint service: Returning all RP Sites associated with endpoint: " + _endpoint);
for (ClusterConfiguration clusterInfo : functionalAPI.getFullRecoverPointSettings().getSystemSettings().getGlobalSystemConfiguration().getClustersConfigurations()) {
for (RemoteClusterConnectionInformation connectionInfo : clusterInfo.getRemoteClustersConnectionInformations()) {
// Find the internal site name associated with the cluster name
clusterTopology.add(clusterInfo.getInternalClusterName() + " " + clusterSiteNameMap.get(connectionInfo.getCluster().getId()) + " " + connectionInfo.getConnectionType().toString());
}
}
return clusterTopology;
} catch (RecoverPointException e) {
throw e;
} catch (Exception e) {
throw RecoverPointException.exceptions.failedToPingMgmtIP(mgmtIPAddress, getCause(e));
}
}
Aggregations