Search in sources :

Example 21 with AwsParameters

use of com.sequenceiq.environment.parameters.dao.domain.AwsParameters in project cloudbreak by hortonworks.

the class AwsEnvironmentParametersConverter method postConvert.

@Override
protected void postConvert(BaseParameters baseParameters, Environment environment, ParametersDto parametersDto) {
    super.postConvert(baseParameters, environment, parametersDto);
    AwsParameters awsParameters = (AwsParameters) baseParameters;
    Optional<AwsParametersDto> awsParametersDto = Optional.of(parametersDto).map(ParametersDto::getAwsParametersDto);
    awsParameters.setS3guardTableName(awsParametersDto.map(AwsParametersDto::getS3GuardTableName).orElse(null));
    awsParameters.setS3guardTableCreation(awsParametersDto.map(AwsParametersDto::getDynamoDbTableCreation).orElse(null));
    awsParameters.setFreeIpaSpotPercentage(awsParametersDto.map(AwsParametersDto::getFreeIpaSpotPercentage).orElse(0));
    awsParameters.setFreeIpaSpotMaxPrice(awsParametersDto.map(AwsParametersDto::getFreeIpaSpotMaxPrice).orElse(null));
    awsParameters.setEncryptionKeyArn(awsParametersDto.map(AwsParametersDto::getAwsDiskEncryptionParametersDto).map(AwsDiskEncryptionParametersDto::getEncryptionKeyArn).orElse(null));
}
Also used : AwsParametersDto(com.sequenceiq.environment.parameter.dto.AwsParametersDto) AwsDiskEncryptionParametersDto(com.sequenceiq.environment.parameter.dto.AwsDiskEncryptionParametersDto) AwsParameters(com.sequenceiq.environment.parameters.dao.domain.AwsParameters) AwsDiskEncryptionParametersDto(com.sequenceiq.environment.parameter.dto.AwsDiskEncryptionParametersDto) ParametersDto(com.sequenceiq.environment.parameter.dto.ParametersDto) AwsParametersDto(com.sequenceiq.environment.parameter.dto.AwsParametersDto)

Aggregations

AwsParameters (com.sequenceiq.environment.parameters.dao.domain.AwsParameters)21 Test (org.junit.jupiter.api.Test)13 Environment (com.sequenceiq.environment.environment.domain.Environment)8 ParametersDto (com.sequenceiq.environment.parameter.dto.ParametersDto)8 BaseParameters (com.sequenceiq.environment.parameters.dao.domain.BaseParameters)7 AwsParametersDto (com.sequenceiq.environment.parameter.dto.AwsParametersDto)6 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)5 EnvironmentEditDto (com.sequenceiq.environment.environment.dto.EnvironmentEditDto)4 AzureResourceEncryptionParametersDto (com.sequenceiq.environment.parameter.dto.AzureResourceEncryptionParametersDto)4 GcpParametersDto (com.sequenceiq.environment.parameter.dto.GcpParametersDto)4 GcpResourceEncryptionParametersDto (com.sequenceiq.environment.parameter.dto.GcpResourceEncryptionParametersDto)4 CloudCredential (com.sequenceiq.cloudbreak.cloud.model.CloudCredential)3 NoSqlTableDeleteRequest (com.sequenceiq.cloudbreak.cloud.model.nosql.NoSqlTableDeleteRequest)3 NoSqlTableMetadataRequest (com.sequenceiq.cloudbreak.cloud.model.nosql.NoSqlTableMetadataRequest)3 EnvironmentDto (com.sequenceiq.environment.environment.dto.EnvironmentDto)3 AwsDiskEncryptionParametersDto (com.sequenceiq.environment.parameter.dto.AwsDiskEncryptionParametersDto)3 ValidationResult (com.sequenceiq.cloudbreak.validation.ValidationResult)2 UpdateAwsDiskEncryptionParametersDto (com.sequenceiq.environment.environment.dto.UpdateAwsDiskEncryptionParametersDto)2 BadRequestException (javax.ws.rs.BadRequestException)2 CloudConnectorException (com.sequenceiq.cloudbreak.cloud.exception.CloudConnectorException)1