use of com.emc.storageos.computesystemcontroller.hostmountadapters.HostMountAdapter in project coprhd-controller by CoprHD.
the class ComputeSystemControllerImpl method createDirectory.
public void createDirectory(URI hostId, String mountPath, String stepId) {
try {
HostMountAdapter adapter = getMountAdapters().get(_dbClient.queryObject(Host.class, hostId).getType());
WorkflowStepCompleter.stepExecuting(stepId);
List<String> lockKeys = new ArrayList<String>();
lockKeys.add(ControllerLockingUtil.getMountHostKey(_dbClient, hostId));
_workflowService.acquireWorkflowStepLocks(stepId, lockKeys, LockTimeoutValue.get(LockType.FILE_MOUNT_OPERATIONS));
adapter.createDirectory(hostId, mountPath);
WorkflowStepCompleter.stepSucceded(stepId);
} catch (ControllerException e) {
WorkflowStepCompleter.stepFailed(stepId, e);
throw e;
} catch (Exception ex) {
WorkflowStepCompleter.stepFailed(stepId, APIException.badRequests.commandFailedToComplete(ex.getMessage()));
throw ex;
}
}
use of com.emc.storageos.computesystemcontroller.hostmountadapters.HostMountAdapter in project coprhd-controller by CoprHD.
the class ComputeSystemControllerImpl method addToFSTab.
public void addToFSTab(URI hostId, String mountPath, URI resId, String subDirectory, String security, String fsType, String stepId) {
try {
HostMountAdapter adapter = getMountAdapters().get(_dbClient.queryObject(Host.class, hostId).getType());
WorkflowStepCompleter.stepExecuting(stepId);
List<String> lockKeys = new ArrayList<String>();
lockKeys.add(ControllerLockingUtil.getMountHostKey(_dbClient, hostId));
_workflowService.acquireWorkflowStepLocks(stepId, lockKeys, LockTimeoutValue.get(LockType.FILE_MOUNT_OPERATIONS));
adapter.addToFSTab(hostId, mountPath, resId, subDirectory, security, fsType);
WorkflowStepCompleter.stepSucceded(stepId);
} catch (ControllerException e) {
WorkflowStepCompleter.stepFailed(stepId, e);
throw e;
} catch (Exception ex) {
WorkflowStepCompleter.stepFailed(stepId, APIException.badRequests.commandFailedToComplete(ex.getMessage()));
throw ex;
}
}
use of com.emc.storageos.computesystemcontroller.hostmountadapters.HostMountAdapter in project coprhd-controller by CoprHD.
the class ComputeSystemControllerImpl method deleteDir.
public void deleteDir(URI resId, URI hostId, String mountPath, String stepId) {
try {
HostMountAdapter adapter = getMountAdapters().get(_dbClient.queryObject(Host.class, hostId).getType());
WorkflowStepCompleter.stepExecuting(stepId);
List<String> lockKeys = new ArrayList<String>();
lockKeys.add(ControllerLockingUtil.getMountHostKey(_dbClient, hostId));
_workflowService.acquireWorkflowStepLocks(stepId, lockKeys, LockTimeoutValue.get(LockType.FILE_MOUNT_OPERATIONS));
adapter.deleteDirectory(hostId, mountPath);
WorkflowStepCompleter.stepSucceded(stepId);
} catch (ControllerException e) {
WorkflowStepCompleter.stepFailed(stepId, e);
throw e;
} catch (Exception ex) {
WorkflowStepCompleter.stepFailed(stepId, APIException.badRequests.commandFailedToComplete(ex.getMessage()));
throw ex;
}
}
Aggregations