use of com.sequenceiq.environment.environment.validation.securitygroup.EnvironmentSecurityGroupValidator in project cloudbreak by hortonworks.
the class EnvironmentNetworkProviderValidator method validateSecurityGroup.
private void validateSecurityGroup(EnvironmentValidationDto environmentValidationDto, String cloudPlatform, ValidationResultBuilder resultBuilder) {
EnvironmentDto environmentDto = environmentValidationDto.getEnvironmentDto();
SecurityAccessDto securityAccess = environmentDto.getSecurityAccess();
NetworkDto networkDto = environmentDto.getNetwork();
if (securityAccess != null && networkDto != null) {
EnvironmentSecurityGroupValidator environmentSecurityGroupValidator = environmentSecurityGroupValidatorsByCloudPlatform.get(valueOf(cloudPlatform));
if (environmentSecurityGroupValidator != null) {
environmentSecurityGroupValidator.validate(environmentValidationDto, resultBuilder);
} else if (!MOCK.equalsIgnoreCase(cloudPlatform) && !YARN.equalsIgnoreCase(cloudPlatform) && !GCP.equalsIgnoreCase(cloudPlatform)) {
resultBuilder.error(String.format("Environment specific security group is not supported for cloud platform: '%s'!", cloudPlatform));
}
}
}
Aggregations