use of com.emc.storageos.volumecontroller.impl.file.FileDeleteWorkflowCompleter in project coprhd-controller by CoprHD.
the class FileOrchestrationDeviceController method deleteFileSystems.
/*
* (non-Javadoc)
*
* @see com.emc.storageos.fileorchestrationcontroller.FileOrchestrationController#deleteFileSystems(java.util.List,
* java.lang.String)
*/
/**
* Deletes one or more filesystem.
*
* @param fileDescriptors
* @param taskId
* @throws ControllerException
*/
@Override
public void deleteFileSystems(List<FileDescriptor> fileDescriptors, String taskId) throws ControllerException {
List<URI> fileShareUris = FileDescriptor.getFileSystemURIs(fileDescriptors);
FileDeleteWorkflowCompleter completer = new FileDeleteWorkflowCompleter(fileShareUris, taskId);
Workflow workflow = null;
try {
// Generate the Workflow.
workflow = _workflowService.getNewWorkflow(this, DELETE_FILESYSTEMS_WF_NAME, false, taskId);
// call the FileDeviceController to add its delete methods.
_fileDeviceController.addStepsForDeleteFileSystems(workflow, null, fileDescriptors, taskId);
// Finish up and execute the plan.
// The Workflow will handle the TaskCompleter
String successMessage = "Delete FileShares successful for: " + fileShareUris.toString();
Object[] callbackArgs = new Object[] { fileShareUris };
workflow.executePlan(completer, successMessage, new WorkflowCallback(), callbackArgs, null, null);
} catch (Exception ex) {
s_logger.error("Could not delete FileShares: " + fileShareUris, ex);
releaseWorkflowLocks(workflow);
String opName = ResourceOperationTypeEnum.DELETE_FILE_SYSTEM.getName();
ServiceError serviceError = DeviceControllerException.errors.deleteFileSharesFailed(fileShareUris.toString(), opName, ex);
completer.error(s_dbClient, _locker, serviceError);
}
}
Aggregations