use of com.sequenceiq.cloudbreak.cloud.model.FileSystem in project cloudbreak by hortonworks.
the class FileSystemValidator method validateFileSystem.
public void validateFileSystem(String platform, CloudCredential cloudCredential, FileSystemRequest fileSystemRequest) {
if (fileSystemRequest == null) {
return;
}
validateFilesystemRequest(fileSystemRequest);
LOGGER.debug("Sending fileSystemRequest to {} to validate the file system", platform);
CloudContext cloudContext = new CloudContext(null, null, platform, null, null, null);
FileSystem fileSystem = converter.convert(fileSystemRequest);
FileSystemValidationRequest request = new FileSystemValidationRequest(fileSystem, cloudCredential, cloudContext);
eventBus.notify(request.selector(), eventFactory.createEvent(request));
try {
FileSystemValidationResult result = request.await();
LOGGER.info("File system validation result: {}", result);
Exception exception = result.getErrorDetails();
if (exception != null) {
throw new BadRequestException(result.getStatusReason(), exception);
}
} catch (InterruptedException e) {
LOGGER.error("Error while sending the file system validation request", e);
throw new OperationException(e);
}
}
Aggregations