use of com.emc.storageos.volumecontroller.impl.vnxunity.job.VNXUnityDeleteFileSystemQuotaDirectoryJob in project coprhd-controller by CoprHD.
the class VNXUnityFileStorageDevice method doDeleteQuotaDirectory.
@Override
public BiosCommandResult doDeleteQuotaDirectory(StorageSystem storage, FileDeviceInputOutput args) throws ControllerException {
_logger.info("Deleting file system {} quota directory {} ", args.getFsName(), args.getQuotaDirectoryName());
VNXeApiClient apiClient = getVnxUnityClient(storage);
VNXeCommandJob job = null;
VNXUnityQuotaDirectoryTaskCompleter completer = null;
try {
job = apiClient.deleteQuotaDirectory(args.getQuotaDirectoryNativeId());
if (job != null) {
completer = new VNXUnityQuotaDirectoryTaskCompleter(QuotaDirectory.class, args.getQuotaDirectoryId(), args.getOpId());
VNXUnityDeleteFileSystemQuotaDirectoryJob quotaJob = new VNXUnityDeleteFileSystemQuotaDirectoryJob(job.getId(), storage.getId(), completer);
ControllerServiceImpl.enqueueJob(new QueueJob(quotaJob));
} else {
_logger.error("No job returned from deleteQuotaDirectory");
ServiceError error = DeviceControllerErrors.vnxe.jobFailed("DeleteFileSystemQuota", "No Job returned from deleteQuotaDirectory");
return BiosCommandResult.createErrorResult(error);
}
} catch (VNXeException e) {
_logger.error("Delete file system quota directory got an exception", e);
if (completer != null) {
completer.error(dbClient, e);
}
return BiosCommandResult.createErrorResult(e);
} catch (Exception ex) {
_logger.error("Delete file system quota directory got an exception", ex);
ServiceError error = DeviceControllerErrors.vnxe.jobFailed("DeleteFileSystemQuota", ex.getMessage());
if (completer != null) {
completer.error(dbClient, error);
}
return BiosCommandResult.createErrorResult(error);
}
StringBuilder logMsgBuilder = new StringBuilder(String.format("Delete filesystem quota job submitted - Array:%s, fileSystem: %s, quota: %s", storage.getSerialNumber(), args.getFsName(), args.getQuotaDirectoryName()));
_logger.info(logMsgBuilder.toString());
return BiosCommandResult.createPendingResult();
}
Aggregations