Search in sources :

Example 1 with EnvironmentParametersConverter

use of com.sequenceiq.environment.parameters.v1.converter.EnvironmentParametersConverter in project cloudbreak by hortonworks.

the class ParametersService method saveParameters.

public BaseParameters saveParameters(Environment environment, ParametersDto parametersDto) {
    BaseParameters savedParameters = null;
    if (parametersDto != null) {
        LOGGER.debug("Saving parameters for environment. Parameters: {}", parametersDto);
        EnvironmentParametersConverter environmentParametersConverter = environmentParamsConverterMap.get(getCloudPlatform(environment));
        if (environmentParametersConverter != null) {
            BaseParameters parameters = environmentParametersConverter.convert(environment, parametersDto);
            parameters.setId(getIfNotNull(parametersDto, ParametersDto::getId));
            parameters.setAccountId(environment.getAccountId());
            savedParameters = save(parameters);
        }
    }
    return savedParameters;
}
Also used : EnvironmentParametersConverter(com.sequenceiq.environment.parameters.v1.converter.EnvironmentParametersConverter) BaseParameters(com.sequenceiq.environment.parameters.dao.domain.BaseParameters)

Aggregations

BaseParameters (com.sequenceiq.environment.parameters.dao.domain.BaseParameters)1 EnvironmentParametersConverter (com.sequenceiq.environment.parameters.v1.converter.EnvironmentParametersConverter)1