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;
}
Aggregations