use of com.emc.storageos.workflow.Workflow.Method in project coprhd-controller by CoprHD.
the class SRDFDeviceController method addRollbackStepsForRefreshSystems.
/**
* Add rollback steps for refreshing the target providers. Currently, for SRDF workflow steps
* we always try to use the active source provider, so here we will filter only the target descriptors
* in order to determine their provider, which most likely has gotten out of sync.
*
* @param workflow The workflow instance.
* @param waitFor Step ID to wait on until complete.
* @param srdfDescriptors All SRDF descriptors.
* @return Step ID.
*/
private String addRollbackStepsForRefreshSystems(Workflow workflow, String waitFor, List<VolumeDescriptor> srdfDescriptors) {
List<VolumeDescriptor> targetDescriptors = VolumeDescriptor.filterByType(srdfDescriptors, VolumeDescriptor.Type.SRDF_TARGET);
if (targetDescriptors.isEmpty()) {
return waitFor;
}
URI targetSystem = targetDescriptors.get(0).getDeviceURI();
StorageSystem tgt = dbClient.queryObject(StorageSystem.class, targetSystem);
Workflow.Method refreshTargetSystemsMethod = new Method(REFRESH_SRDF_TARGET_SYSTEM, tgt, null);
workflow.createStep(ROLLBACK_REFRESH_SYSTEM_STEP_GROUP, String.format(ROLLBACK_REFRESH_SYSTEM_STEP_DESC, tgt.getSerialNumber()), waitFor, tgt.getId(), tgt.getSystemType(), this.getClass(), rollbackMethodNullMethod(), refreshTargetSystemsMethod, null);
return ROLLBACK_REFRESH_SYSTEM_STEP_GROUP;
}
use of com.emc.storageos.workflow.Workflow.Method in project coprhd-controller by CoprHD.
the class SRDFDeviceController method refreshVolumeProperties.
/**
* This method creates step to refresh volume properties.
*
* @param volumeDescriptors List of volume descriptors
* @param system reference to storage system
* @param waitFor String waitFor of previous step, we wait on this to complete
* @param workflow Reference to Workflow
* @return stepId
*/
private String refreshVolumeProperties(List<VolumeDescriptor> volumeDescriptors, StorageSystem system, String waitFor, Workflow workflow) {
List<URI> targetURIs = VolumeDescriptor.getVolumeURIs(volumeDescriptors);
Method updateVolumePropertiesMethod = updateVolumePropertiesMethod(targetURIs, system.getId());
Method rollbackMethod = rollbackMethodNullMethod();
String stepId = workflow.createStep(REFRESH_VOLUME_PROPERTIES_STEP, REFRESH_VOLUME_PROPERTIES_STEP_DESC, waitFor, system.getId(), system.getSystemType(), getClass(), updateVolumePropertiesMethod, rollbackMethod, null);
return stepId;
}
Aggregations