Search in sources :

Example 16 with ClusterUID

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;
    }
}
Also used : ClusterUID(com.emc.fapiclient.ws.ClusterUID) HashSet(java.util.HashSet) Set(java.util.Set) UserVolumeSettings(com.emc.fapiclient.ws.UserVolumeSettings) HashMap(java.util.HashMap) ReplicationSetSettings(com.emc.fapiclient.ws.ReplicationSetSettings) HashSet(java.util.HashSet)

Aggregations

ClusterUID (com.emc.fapiclient.ws.ClusterUID)16 ConsistencyGroupCopyUID (com.emc.fapiclient.ws.ConsistencyGroupCopyUID)8 RecoverPointException (com.emc.storageos.recoverpoint.exceptions.RecoverPointException)8 FunctionalAPIActionFailedException_Exception (com.emc.fapiclient.ws.FunctionalAPIActionFailedException_Exception)7 FunctionalAPIInternalError_Exception (com.emc.fapiclient.ws.FunctionalAPIInternalError_Exception)7 FunctionalAPIValidationException_Exception (com.emc.fapiclient.ws.FunctionalAPIValidationException_Exception)6 ConsistencyGroupUID (com.emc.fapiclient.ws.ConsistencyGroupUID)5 HashMap (java.util.HashMap)5 HashSet (java.util.HashSet)5 RPSite (com.emc.storageos.recoverpoint.objectmodel.RPSite)4 CreateCopyParams (com.emc.storageos.recoverpoint.requests.CreateCopyParams)4 CreateVolumeParams (com.emc.storageos.recoverpoint.requests.CreateVolumeParams)4 RecoverPointImageManagementUtils (com.emc.storageos.recoverpoint.utils.RecoverPointImageManagementUtils)4 ArrayList (java.util.ArrayList)4 ConsistencyGroupSettings (com.emc.fapiclient.ws.ConsistencyGroupSettings)3 ConsistencyGroupSettingsChangesParam (com.emc.fapiclient.ws.ConsistencyGroupSettingsChangesParam)3 GlobalCopyUID (com.emc.fapiclient.ws.GlobalCopyUID)3 ConsistencyGroupCopySettings (com.emc.fapiclient.ws.ConsistencyGroupCopySettings)2 ConsistencyGroupLinkSettings (com.emc.fapiclient.ws.ConsistencyGroupLinkSettings)2 FullConsistencyGroupPolicy (com.emc.fapiclient.ws.FullConsistencyGroupPolicy)2