use of com.emc.storageos.workflow.WorkflowService in project coprhd-controller by CoprHD.
the class ReplicaDeviceController method removeFromReplicationGroup.
/**
* Orchestration method for removing members from a replication group.
*
* @param storage
* @param consistencyGroup
* @param repGroupName
* @param addVolumesList
* @param opId
* @return
* @throws ControllerException
*/
public boolean removeFromReplicationGroup(URI storage, URI consistencyGroup, String repGroupName, List<URI> addVolumesList, String opId) throws ControllerException {
TaskCompleter taskCompleter = new BlockConsistencyGroupUpdateCompleter(consistencyGroup, opId);
try {
List<String> lockKeys = new ArrayList<>();
lockKeys.add(ControllerLockingUtil.getReplicationGroupStorageKey(_dbClient, repGroupName, storage));
WorkflowService workflowService = _blockDeviceController.getWorkflowService();
workflowService.acquireWorkflowStepLocks(opId, lockKeys, LockTimeoutValue.get(LockType.ARRAY_CG));
StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, storage);
_blockDeviceController.getDevice(storageSystem.getSystemType()).doRemoveFromReplicationGroup(storageSystem, consistencyGroup, repGroupName, addVolumesList, taskCompleter);
} catch (Exception e) {
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
taskCompleter.error(_dbClient, serviceError);
WorkflowStepCompleter.stepFailed(opId, serviceError);
return false;
}
return true;
}
use of com.emc.storageos.workflow.WorkflowService in project coprhd-controller by CoprHD.
the class SRDFOperationContext method insertContextOperation.
public static void insertContextOperation(TaskCompleter completer, SRDFOperationType operation, Object... args) {
checkNotNull(completer);
WorkflowService service = WorkflowService.getInstance();
SRDFOperationContext ctx = (SRDFOperationContext) service.loadStepData(completer.getOpId());
if (ctx == null) {
ctx = new SRDFOperationContext();
}
ctx.insertOperation(operation.toString(), args);
service.storeStepData(completer.getOpId(), ctx);
}
use of com.emc.storageos.workflow.WorkflowService in project coprhd-controller by CoprHD.
the class ReplicaDeviceController method addToReplicationGroup.
/**
* Orchestration method for adding members to a replication group.
*
* @param storage
* @param consistencyGroup
* @param replicationGroupName
* @param addVolumesList
* @param opId
* @return
* @throws ControllerException
*/
public boolean addToReplicationGroup(URI storage, URI consistencyGroup, String replicationGroupName, List<URI> addVolumesList, String opId) throws ControllerException {
WorkflowStepCompleter.stepExecuting(opId);
TaskCompleter taskCompleter = null;
try {
List<String> lockKeys = new ArrayList<String>();
lockKeys.add(ControllerLockingUtil.getReplicationGroupStorageKey(_dbClient, replicationGroupName, storage));
WorkflowService workflowService = _blockDeviceController.getWorkflowService();
workflowService.acquireWorkflowStepLocks(opId, lockKeys, LockTimeoutValue.get(LockType.ARRAY_CG));
StorageSystem storageSystem = _dbClient.queryObject(StorageSystem.class, storage);
taskCompleter = new BlockConsistencyGroupUpdateCompleter(consistencyGroup, opId);
_blockDeviceController.getDevice(storageSystem.getSystemType()).doAddToReplicationGroup(storageSystem, consistencyGroup, replicationGroupName, addVolumesList, taskCompleter);
WorkflowStepCompleter.stepSucceded(opId);
} catch (Exception e) {
ServiceError serviceError = DeviceControllerException.errors.jobFailed(e);
taskCompleter.error(_dbClient, serviceError);
WorkflowStepCompleter.stepFailed(opId, serviceError);
return false;
}
return true;
}
Aggregations