use of com.sequenceiq.redbeams.exception.NotFoundException in project cloudbreak by hortonworks.
the class DatabaseServerV4Controller method updateClusterCrn.
@Override
@InternalOnly
public void updateClusterCrn(String environmentCrn, String currentClusterCrn, String newClusterCrn, @InitiatorUserCrn String initiatorUserCrn) {
DatabaseServerConfig databaseServerConfig = databaseServerConfigService.findByEnvironmentCrnAndClusterCrn(environmentCrn, currentClusterCrn).orElseThrow(() -> new NotFoundException(String.format("No %s found with cluster CRN '%s' in environment '%s'", DatabaseServerConfig.class.getSimpleName(), currentClusterCrn, environmentCrn)));
databaseServerConfig.setClusterCrn(newClusterCrn);
databaseServerConfigService.update(databaseServerConfig);
}
Aggregations