private void setRegion(AmazonWebServiceClient client) { if (region != null && endpointConfiguration != null) { throw new IllegalStateException("Only one of Region or EndpointConfiguration may be set."); } if (endpointConfiguration != null) { client.setEndpoint(endpointConfiguration.getServiceEndpoint()); client.setSignerRegionOverride(endpointConfiguration.getSigningRegion()); } else if (region != null) { client.setRegion(region); } else { final String region = determineRegionFromRegionProvider(); if (region != null) { client.setRegion(getRegionObject(region)); } else { throw new SdkClientException( "Unable to find a region via the region provider chain. " + "Must provide an explicit region in the builder or setup environment to supply a region."); } } }
private void setRegion(AmazonWebServiceClient client) { if (region != null && endpointConfiguration != null) { throw new IllegalStateException("Only one of Region or EndpointConfiguration may be set."); } if (endpointConfiguration != null) { client.setEndpoint(endpointConfiguration.getServiceEndpoint()); client.setSignerRegionOverride(endpointConfiguration.getSigningRegion()); } else if (region != null) { client.setRegion(region); } else { final String region = determineRegionFromRegionProvider(); if (region != null) { client.setRegion(getRegionObject(region)); } else { throw new SdkClientException( "Unable to find a region via the region provider chain. " + "Must provide an explicit region in the builder or setup environment to supply a region."); } } }
private void setRegion(AmazonWebServiceClient client) { if (region != null && endpointConfiguration != null) { throw new IllegalStateException("Only one of Region or EndpointConfiguration may be set."); } if (endpointConfiguration != null) { client.setEndpoint(endpointConfiguration.getServiceEndpoint()); client.setSignerRegionOverride(endpointConfiguration.getSigningRegion()); } else if (region != null) { client.setRegion(region); } else { final String region = determineRegionFromRegionProvider(); if (region != null) { client.setRegion(RegionUtils.getRegion(region)); } else { throw new SdkClientException( "Unable to find a region via the region provider chain. " + "Must provide an explicit region in the builder or setup environment to supply a region."); } } }