use of com.sequenceiq.cloudbreak.domain.CustomConfigurations in project cloudbreak by hortonworks.
the class CustomConfigurationsService method cloneByName.
public CustomConfigurations cloneByName(String name, String newName, String newRuntimeVersion, String accountId) {
CustomConfigurations customConfigurationsByName = getByName(name, accountId);
CustomConfigurations newCustomConfigurations = cloneCustomConfigs(customConfigurationsByName, newName, newRuntimeVersion);
return create(newCustomConfigurations, accountId);
}
use of com.sequenceiq.cloudbreak.domain.CustomConfigurations in project cloudbreak by hortonworks.
the class CustomConfigurationsService method cloneCustomConfigs.
private CustomConfigurations cloneCustomConfigs(CustomConfigurations existingCustomConfigurations, String newName, String newRuntimeVersion) {
CustomConfigurations clone = new CustomConfigurations(existingCustomConfigurations);
Set<CustomConfigurationProperty> newConfigSet = existingCustomConfigurations.getConfigurations().stream().map(config -> new CustomConfigurationProperty(config.getName(), config.getValue(), config.getRoleType(), config.getServiceType())).collect(Collectors.toSet());
clone.setConfigurations(newConfigSet);
clone.setName(newName);
clone.setRuntimeVersion(newRuntimeVersion);
return clone;
}
use of com.sequenceiq.cloudbreak.domain.CustomConfigurations in project cloudbreak by hortonworks.
the class CustomConfigurationsService method cloneByCrn.
public CustomConfigurations cloneByCrn(String crn, String newName, String newRuntimeVersion, String accountId) {
CustomConfigurations customConfigurationsByCrn = getByCrn(crn);
CustomConfigurations newCustomConfigurations = cloneCustomConfigs(customConfigurationsByCrn, newName, newRuntimeVersion);
return create(newCustomConfigurations, accountId);
}
use of com.sequenceiq.cloudbreak.domain.CustomConfigurations in project cloudbreak by hortonworks.
the class CustomConfigurationsService method deleteByCrn.
public CustomConfigurations deleteByCrn(String crn) {
CustomConfigurations customConfigurationsByCrn = getByCrn(crn);
prepareDeletion(customConfigurationsByCrn);
customConfigurationPropertyRepository.deleteAll(customConfigurationsByCrn.getConfigurations());
ownerAssignmentService.notifyResourceDeleted(crn, MDCUtils.getRequestId());
return customConfigurationsByCrn;
}
use of com.sequenceiq.cloudbreak.domain.CustomConfigurations in project cloudbreak by hortonworks.
the class CustomConfigurationsToCustomConfigurationsDetailsConverterTest method testConvertEmptyNoNPE.
@Test
void testConvertEmptyNoNPE() {
CustomConfigurations customConfigurations = new CustomConfigurations();
CustomConfigurationsDetails customConfigurationsDetails = underTest.convert(customConfigurations);
assertThat(customConfigurationsDetails).isNotNull();
}
Aggregations