use of com.sequenceiq.environment.environment.domain.RegionWrapper in project cloudbreak by hortonworks.
the class EnvironmentValidationHandler method validateEnvironment.
private void validateEnvironment(Event<EnvironmentValidationDto> environmentDtoEvent, EnvironmentValidationDto environmentValidationDto, Environment environment) {
EnvironmentDto environmentDto = environmentValidationDto.getEnvironmentDto();
RegionWrapper regionWrapper = environment.getRegionWrapper();
CloudRegions cloudRegions = environmentService.getRegionsByEnvironment(environment);
ValidationResult.ValidationResultBuilder validationBuilder = validatorService.validateRegionsAndLocation(regionWrapper.getName(), regionWrapper.getRegions(), environment, cloudRegions);
validationBuilder.merge(validatorService.validateTelemetryLoggingStorageLocation(environment));
validationBuilder.merge(validatorService.validateTelemetryLoggingStorageConfig(environment));
validationBuilder.merge(validatorService.validateBackupStorageLocation(environment));
validationBuilder.merge(validatorService.validateBackupStorageConfig(environment));
validationBuilder.merge(validatorService.validateParameters(environmentValidationDto, environmentDto.getParameters()));
validationBuilder.merge(validatorService.validateNetworkWithProvider(environmentValidationDto));
validationBuilder.merge(validatorService.validateAuthentication(environmentValidationDto));
validationBuilder.merge(validatorService.validateAwsKeysPresent(environmentValidationDto));
ValidationResult validationResult = validationBuilder.build();
if (validationResult.hasError()) {
throw new EnvironmentServiceException(validationResult.getFormattedErrors());
}
}
Aggregations