use of com.emc.storageos.computesystemcontroller.hostmountadapters.MountCompleter in project coprhd-controller by CoprHD.
the class ComputeSystemOrchestrationDeviceController method unmountDevice.
@Override
public void unmountDevice(URI hostId, URI resId, String mountPath, String opId) throws ControllerException {
HostDeviceInputOutput args = new HostDeviceInputOutput();
args.setHostId(hostId);
args.setResId(resId);
args.setMountPath(mountPath);
// Generate the Workflow.
Workflow workflow = null;
MountCompleter completer = new MountCompleter(args.getResId(), opId);
try {
// Generate the Workflow.
workflow = _workflowService.getNewWorkflow(this, UNMOUNT_DEVICE_WF_NAME, false, opId);
_computeSystemControllerImpl.addStepsForUnmountDevice(workflow, args);
// Finish up and execute the plan.
// The Workflow will handle the TaskCompleter
String successMessage = "Unmount device successful for: " + args.getHostId().toString();
workflow.executePlan(completer, successMessage);
} catch (Exception ex) {
_log.error("Could not unmount device: " + args, ex);
ComputeSystemControllerException exception = ComputeSystemControllerException.exceptions.unableToUnmount(_dbClient.queryObject(Host.class, args.getHostId()).getType(), ex);
completer.error(_dbClient, exception);
_workflowService.releaseAllWorkflowLocks(workflow);
throw ex;
}
}
use of com.emc.storageos.computesystemcontroller.hostmountadapters.MountCompleter in project coprhd-controller by CoprHD.
the class ComputeSystemOrchestrationDeviceController method mountDevice.
@Override
public void mountDevice(URI hostId, URI resId, String subDirectory, String security, String mountPath, String fsType, String opId) throws ControllerException {
HostDeviceInputOutput args = new HostDeviceInputOutput();
args.setSubDirectory(subDirectory);
args.setHostId(hostId);
args.setResId(resId);
args.setSecurity(security);
args.setMountPath(mountPath);
args.setFsType(fsType);
// Generate the Workflow.
Workflow workflow = null;
MountCompleter completer = new MountCompleter(args.getResId(), opId);
try {
// Generate the Workflow.
workflow = _workflowService.getNewWorkflow(this, MOUNT_DEVICE_WF_NAME, false, opId);
_computeSystemControllerImpl.addStepsForMountDevice(workflow, args);
// Finish up and execute the plan.
// The Workflow will handle the TaskCompleter
String successMessage = "Mount device successful for: " + args.getHostId().toString();
workflow.executePlan(completer, successMessage);
} catch (Exception ex) {
_log.error("Could not mount device: " + args, ex);
ComputeSystemControllerException exception = ComputeSystemControllerException.exceptions.unableToMount(_dbClient.queryObject(Host.class, args.getHostId()).getType(), ex);
completer.error(_dbClient, exception);
_workflowService.releaseAllWorkflowLocks(workflow);
throw ex;
}
}
Aggregations