Search in sources :

Example 6 with UserVolumeSettings

use of com.emc.fapiclient.ws.UserVolumeSettings 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

ReplicationSetSettings (com.emc.fapiclient.ws.ReplicationSetSettings)6 UserVolumeSettings (com.emc.fapiclient.ws.UserVolumeSettings)6 ConsistencyGroupSettings (com.emc.fapiclient.ws.ConsistencyGroupSettings)5 FunctionalAPIActionFailedException_Exception (com.emc.fapiclient.ws.FunctionalAPIActionFailedException_Exception)5 FunctionalAPIInternalError_Exception (com.emc.fapiclient.ws.FunctionalAPIInternalError_Exception)5 ConsistencyGroupUID (com.emc.fapiclient.ws.ConsistencyGroupUID)4 ConsistencyGroupCopyUID (com.emc.fapiclient.ws.ConsistencyGroupCopyUID)3 ConsistencyGroupState (com.emc.fapiclient.ws.ConsistencyGroupState)3 HashMap (java.util.HashMap)3 HashSet (java.util.HashSet)3 ConsistencyGroupCopySettings (com.emc.fapiclient.ws.ConsistencyGroupCopySettings)2 JournalVolumeSettings (com.emc.fapiclient.ws.JournalVolumeSettings)2 ClusterConfiguration (com.emc.fapiclient.ws.ClusterConfiguration)1 ClusterUID (com.emc.fapiclient.ws.ClusterUID)1 ConsistencyGroupCopyJournal (com.emc.fapiclient.ws.ConsistencyGroupCopyJournal)1 ConsistencyGroupCopyState (com.emc.fapiclient.ws.ConsistencyGroupCopyState)1 ConsistencyGroupLinkSettings (com.emc.fapiclient.ws.ConsistencyGroupLinkSettings)1 FullRecoverPointSettings (com.emc.fapiclient.ws.FullRecoverPointSettings)1 FunctionalAPIValidationException_Exception (com.emc.fapiclient.ws.FunctionalAPIValidationException_Exception)1 ReplicationSetUID (com.emc.fapiclient.ws.ReplicationSetUID)1