/** * Sets the endpoint configuration (service endpoint & signing region) to be used for requests. If neither region {@link #setRegion(String)} * or endpoint configuration are explicitly provided in the builder the {@link #DEFAULT_REGION_PROVIDER} is consulted. * * <p><b>Only use this if using a non-standard service endpoint - the recommended approach for configuring a client is to use {@link #setRegion(String)}</b> * * @param endpointConfiguration The endpointConfiguration to use */ public final void setEndpointConfiguration(EndpointConfiguration endpointConfiguration) { withEndpointConfiguration(endpointConfiguration); }
/** * Sets the endpoint configuration (service endpoint & signing region) to be used for requests. If neither region {@link #setRegion(String)} * or endpoint configuration are explicitly provided in the builder the {@link #DEFAULT_REGION_PROVIDER} is consulted. * * <p><b>Only use this if using a non-standard service endpoint - the recommended approach for configuring a client is to use {@link #setRegion(String)}</b> * * @param endpointConfiguration The endpointConfiguration to use */ public final void setEndpointConfiguration(EndpointConfiguration endpointConfiguration) { withEndpointConfiguration(endpointConfiguration); }
/** * Sets the endpoint configuration (service endpoint & signing region) to be used for requests. If neither region {@link #setRegion(String)} * or endpoint configuration are explicitly provided in the builder the {@link #DEFAULT_REGION_PROVIDER} is consulted. * * <p><b>Only use this if using a non-standard service endpoint - the recommended approach for configuring a client is to use {@link #setRegion(String)}</b> * * @param endpointConfiguration The endpointConfiguration to use */ public final void setEndpointConfiguration(EndpointConfiguration endpointConfiguration) { withEndpointConfiguration(endpointConfiguration); }
<R, T extends AwsClientBuilder<T, R>> R createClient(final T builder, final AWSCredentialsProvider credentialsProvider, final ClientConfiguration clientConfiguration, final String endpointUrl, final String region) { if (credentialsProvider != null) { builder.withCredentials(credentialsProvider); } if (clientConfiguration != null) { builder.withClientConfiguration(clientConfiguration); } if (StringUtils.isNotEmpty(endpointUrl)) { LOG.warn("Received configuration for endpoint as " + endpointUrl + ", and region as " + region + "."); builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpointUrl, region)); } else if (StringUtils.isNotEmpty(region)) { LOG.warn("Received configuration for region as " + region + "."); builder.withRegion(region); } else { LOG.warn("No configuration received for endpoint and region, will default region to us-east-1"); builder.withRegion(Regions.US_EAST_1); } return builder.build(); } }
builder.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, finalRegion));