Search in sources :

Example 1 with EnvironmentSecurityGroupValidator

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));
        }
    }
}
Also used : NetworkDto(com.sequenceiq.environment.network.dto.NetworkDto) EnvironmentSecurityGroupValidator(com.sequenceiq.environment.environment.validation.securitygroup.EnvironmentSecurityGroupValidator) EnvironmentDto(com.sequenceiq.environment.environment.dto.EnvironmentDto) SecurityAccessDto(com.sequenceiq.environment.environment.dto.SecurityAccessDto)

Aggregations

EnvironmentDto (com.sequenceiq.environment.environment.dto.EnvironmentDto)1 SecurityAccessDto (com.sequenceiq.environment.environment.dto.SecurityAccessDto)1 EnvironmentSecurityGroupValidator (com.sequenceiq.environment.environment.validation.securitygroup.EnvironmentSecurityGroupValidator)1 NetworkDto (com.sequenceiq.environment.network.dto.NetworkDto)1