use of com.emc.fapiclient.ws.ClusterUID in project coprhd-controller by CoprHD.
the class RecoverPointBookmarkManagementUtils method mapCGToStorageArraysNoConnection.
/**
* Find the arrays for a CG
*
* @param groupSettings - A groupSettings object which contains, among other things, the array information for the CG
*
* @return The site to array mappings for the CG
*
* @throws RecoverPointException
*/
public Map<ClusterUID, Set<String>> mapCGToStorageArraysNoConnection(ConsistencyGroupSettings groupSettings) throws RecoverPointException {
Set<String> siteArraySet = null;
Map<ClusterUID, Set<String>> returnMap = new HashMap<ClusterUID, Set<String>>();
Set<ClusterUID> siteSet = new HashSet<ClusterUID>();
// First find out the sites involved in the CG
ClusterUID ClusterUID = null;
boolean foundSite = false;
for (ReplicationSetSettings replicationSet : groupSettings.getReplicationSetsSettings()) {
for (UserVolumeSettings userVolume : replicationSet.getVolumes()) {
ClusterUID = userVolume.getClusterUID();
foundSite = false;
for (ClusterUID mappedSite : siteSet) {
if (ClusterUID.getId() == mappedSite.getId()) {
foundSite = true;
break;
}
}
if (!foundSite) {
siteSet.add(ClusterUID);
}
}
}
for (ClusterUID mappedSite : siteSet) {
siteArraySet = new HashSet<String>();
for (ReplicationSetSettings replicationSet1 : groupSettings.getReplicationSetsSettings()) {
for (UserVolumeSettings userVolume : replicationSet1.getVolumes()) {
ClusterUID = userVolume.getClusterUID();
if (ClusterUID.getId() == mappedSite.getId()) {
if (userVolume.getVolumeInfo().getVendorName().equalsIgnoreCase("DGC")) {
siteArraySet.add(userVolume.getVolumeInfo().getArraySerialNumber());
}
}
}
}
if (!siteArraySet.isEmpty()) {
returnMap.put(mappedSite, siteArraySet);
}
}
if (!returnMap.isEmpty()) {
return returnMap;
} else {
return null;
}
}
Aggregations