Search in sources :

Example 1 with LocationSupportException

use of alien4cloud.exception.LocationSupportException in project alien4cloud by alien4cloud.

the class LocationService method ensureMultipleLocations.

/**
 * ensure that we cannot create more locations than supported by the orchestrator
 *
 * @param orchestratorId
 */
private void ensureMultipleLocations(String orchestratorId) {
    LocationSupport locationSupport = orchestratorService.getLocationSupport(orchestratorId);
    List<Location> locations = getAll(orchestratorId);
    if (!locationSupport.isMultipleLocations() && !locations.isEmpty()) {
        throw new LocationSupportException("The orchestrator <" + orchestratorId + "> already has a location and does'nt support multiple locations.");
    }
}
Also used : LocationSupport(alien4cloud.model.orchestrators.locations.LocationSupport) LocationSupportException(alien4cloud.exception.LocationSupportException) Location(alien4cloud.model.orchestrators.locations.Location)

Aggregations

LocationSupportException (alien4cloud.exception.LocationSupportException)1 Location (alien4cloud.model.orchestrators.locations.Location)1 LocationSupport (alien4cloud.model.orchestrators.locations.LocationSupport)1