Search in sources :

Example 16 with VolumeIngestionContext

use of com.emc.storageos.api.service.impl.resource.blockingestorchestration.context.VolumeIngestionContext in project coprhd-controller by CoprHD.

the class RecoverPointVolumeIngestionContext method findExistingProtectionSet.

/**
 * Finds an existing ProtectionSet in any RecoverPoint volume ingestion context within the scope of this ingestion request.
 *
 * @param psetLabel the label for the ProtectionSet
 * @param rpProtectionId the RecoverPoint protection set id
 * @param protectionSystemUri the RecoverPoint device URI
 * @param umpsetNativeGuid the nativeGuid for the discovered UnManagedProtectionSet
 * @return an existing ProtectionSet matching the arguments
 */
public ProtectionSet findExistingProtectionSet(String psetLabel, String rpProtectionId, URI protectionSystemUri, String umpsetNativeGuid) {
    for (VolumeIngestionContext volumeContext : getRootIngestionRequestContext().getProcessedUnManagedVolumeMap().values()) {
        if (volumeContext != null && volumeContext instanceof RecoverPointVolumeIngestionContext) {
            RecoverPointVolumeIngestionContext rpContext = (RecoverPointVolumeIngestionContext) volumeContext;
            ProtectionSet pset = rpContext.getManagedProtectionSet();
            if (pset != null) {
                if ((pset.getLabel().equals(psetLabel)) && (pset.getProtectionId().equals(rpProtectionId)) && (pset.getProtectionSystem().equals(protectionSystemUri)) && (pset.getNativeGuid().equals(umpsetNativeGuid))) {
                    _logger.info("found already-instantiated ProtectionSet {} (hash {})", pset.getLabel(), pset.hashCode());
                    return pset;
                }
            }
        }
    }
    _logger.info("did not find an already-instantiated ProtectionSet for ", psetLabel);
    return null;
}
Also used : ProtectionSet(com.emc.storageos.db.client.model.ProtectionSet) UnManagedProtectionSet(com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedProtectionSet) VolumeIngestionContext(com.emc.storageos.api.service.impl.resource.blockingestorchestration.context.VolumeIngestionContext)

Aggregations

VolumeIngestionContext (com.emc.storageos.api.service.impl.resource.blockingestorchestration.context.VolumeIngestionContext)16 UnManagedVolume (com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedVolume)9 IngestionRequestContext (com.emc.storageos.api.service.impl.resource.blockingestorchestration.context.IngestionRequestContext)6 BlockObject (com.emc.storageos.db.client.model.BlockObject)6 DataObject (com.emc.storageos.db.client.model.DataObject)6 Volume (com.emc.storageos.db.client.model.Volume)6 RpVplexVolumeIngestionContext (com.emc.storageos.api.service.impl.resource.blockingestorchestration.context.impl.RpVplexVolumeIngestionContext)5 VplexVolumeIngestionContext (com.emc.storageos.api.service.impl.resource.blockingestorchestration.context.impl.VplexVolumeIngestionContext)5 ArrayList (java.util.ArrayList)5 RecoverPointVolumeIngestionContext (com.emc.storageos.api.service.impl.resource.blockingestorchestration.context.impl.RecoverPointVolumeIngestionContext)4 ExportGroup (com.emc.storageos.db.client.model.ExportGroup)4 URI (java.net.URI)4 BlockVolumeIngestionContext (com.emc.storageos.api.service.impl.resource.blockingestorchestration.context.impl.BlockVolumeIngestionContext)3 BlockSnapshot (com.emc.storageos.db.client.model.BlockSnapshot)3 StringSet (com.emc.storageos.db.client.model.StringSet)3 UnManagedProtectionSet (com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedProtectionSet)3 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)3 InternalException (com.emc.storageos.svcs.errorhandling.resources.InternalException)3 BlockConsistencyGroup (com.emc.storageos.db.client.model.BlockConsistencyGroup)2 BlockSnapshotSession (com.emc.storageos.db.client.model.BlockSnapshotSession)2