Package org.apache.stratos.cloud.controller.exception

Examples of org.apache.stratos.cloud.controller.exception.InvalidRegionException


        if (region == null || iaasInfo == null) {
            String msg =
                         "Region or IaaSProvider is null: region: " + region + " - IaaSProvider: " +
                                 iaasInfo;
            log.error(msg);
            throw new InvalidRegionException(msg);
        }
       
        ComputeServiceContext context = iaasInfo.getComputeService().getContext();
        Set<String> regions = context.unwrapApi(AWSEC2Api.class).getConfiguredRegions();
        for (String configuredRegion : regions) {
            if (region.equalsIgnoreCase(configuredRegion)) {
                if (log.isDebugEnabled()) {
                    log.debug("Found a matching region: " + region);
                }
                return true;
            }
        }
        String msg = "Invalid region: " + region +" in the iaas: "+iaasInfo.getType();
        log.error(msg);
        throw new InvalidRegionException(msg);
    }
View Full Code Here


        if (region == null || iaasInfo == null) {
            String msg =
                         "Region or IaaSProvider is null: region: " + region + " - IaaSProvider: " +
                                 iaasInfo;
            log.error(msg);
            throw new InvalidRegionException(msg);
        }
       
        ComputeServiceContext context = iaasInfo.getComputeService().getContext();
        RestContext<NovaApi, NovaAsyncApi> nova = context.unwrap();
        Set<String> zones = nova.getApi().getConfiguredZones();
        for (String configuredZone : zones) {
            if (region.equalsIgnoreCase(configuredZone)) {
                if (log.isDebugEnabled()) {
                    log.debug("Found a matching region: " + region);
                }
                return true;
            }
        }
       
        String msg = "Invalid region: " + region +" in the iaas: "+iaasInfo.getType();
        log.error(msg);
        throw new InvalidRegionException(msg);
    }
View Full Code Here

TOP

Related Classes of org.apache.stratos.cloud.controller.exception.InvalidRegionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.