SubclassT
- Concrete builder type, used for better fluent methods.TypeToBuildT
- Type that this builder builds.AwsAsyncClientBuilder
, AwsSyncClientBuilder
@NotThreadSafe public abstract class AwsClientBuilder<SubclassT extends AwsClientBuilder,TypeToBuildT> extends Object
Modifier and Type | Class | Description |
---|---|---|
static class |
AwsClientBuilder.EndpointConfiguration |
A container for configuration required to submit requests to a service (service endpoint and signing region)
|
Modifier and Type | Method | Description |
---|---|---|
abstract TypeToBuildT |
build() |
Builds a client with the configure properties.
|
LegacyClientConfiguration |
getClientConfiguration() |
Gets the ClientConfiguration currently configured in the builder
|
AwsCredentialsProvider |
getCredentials() |
Gets the AWSCredentialsProvider currently configured in the builder.
|
AwsClientBuilder.EndpointConfiguration |
getEndpoint() |
Gets the service endpointConfiguration in use by the builder
|
abstract String |
getEndpointPrefix() |
|
RequestMetricCollector |
getMetricsCollector() |
Gets the
RequestMetricCollector in use by the builder. |
String |
getRegion() |
Gets the region in use by the builder.
|
List<RequestHandler> |
getRequestHandlers() |
Gets the list of request handlers in use by the builder.
|
abstract String |
getServiceName() |
|
void |
setClientConfiguration(LegacyClientConfiguration config) |
Sets the ClientConfiguration to be used by the client.
|
void |
setCredentials(AwsCredentialsProvider credentialsProvider) |
Sets the AWSCredentialsProvider used by the client.
|
void |
setEndpointConfiguration(AwsClientBuilder.EndpointConfiguration endpointConfiguration) |
Sets the endpoint configuration (service endpoint & signing region) to be used for requests.
|
void |
setMetricsCollector(RequestMetricCollector metrics) |
Sets a custom RequestMetricCollector to use for the client.
|
void |
setRegion(String region) |
Sets the region to be used by the client.
|
void |
setRequestHandlers(RequestHandler... handlers) |
Sets the request handlers to use in the client.
|
SubclassT |
withClientConfiguration(LegacyClientConfiguration config) |
Sets the ClientConfiguration to be used by the client.
|
SubclassT |
withCredentials(AwsCredentialsProvider credentialsProvider) |
Sets the AWSCredentialsProvider used by the client.
|
SubclassT |
withEndpointConfiguration(AwsClientBuilder.EndpointConfiguration endpointConfiguration) |
Sets the endpoint configuration (service endpoint & signing region) to be used for requests.
|
SubclassT |
withMetricsCollector(RequestMetricCollector metrics) |
Sets a custom RequestMetricCollector to use for the client.
|
SubclassT |
withRegion(Region region) |
Sets the region to be used by the client.
|
SubclassT |
withRequestHandlers(RequestHandler... handlers) |
Sets the request handlers to use in the client.
|
public final AwsCredentialsProvider getCredentials()
public final void setCredentials(AwsCredentialsProvider credentialsProvider)
DefaultCredentialsProvider
.credentialsProvider
- New AWSCredentialsProvider to use.public final SubclassT withCredentials(AwsCredentialsProvider credentialsProvider)
DefaultCredentialsProvider
.credentialsProvider
- New AWSCredentialsProvider to use.public final LegacyClientConfiguration getClientConfiguration()
public final void setClientConfiguration(LegacyClientConfiguration config)
PredefinedLegacyClientConfigurations#defaultConfig
but may differ per service.config
- Custom configuration to usepublic final SubclassT withClientConfiguration(LegacyClientConfiguration config)
PredefinedLegacyClientConfigurations#defaultConfig
but may differ per service.config
- Custom configuration to usepublic final RequestMetricCollector getMetricsCollector()
RequestMetricCollector
in use by the builder.public final void setMetricsCollector(RequestMetricCollector metrics)
metrics
- Custom RequestMetricCollector to use.public final SubclassT withMetricsCollector(RequestMetricCollector metrics)
metrics
- Custom RequestMetricCollector to use.public final String getRegion()
public final void setRegion(String region)
setEndpointConfiguration(EndpointConfiguration)
are explicitly provided in the builder the DEFAULT_REGION_PROVIDER
is consulted.region
- Region to usepublic SubclassT withRegion(Region region)
setEndpointConfiguration(EndpointConfiguration)
are explicitly provided in the builder the DEFAULT_REGION_PROVIDER
is consulted.region
- Region to use, this will be used to determine both service endpoint
and the signing regionpublic final AwsClientBuilder.EndpointConfiguration getEndpoint()
public final void setEndpointConfiguration(AwsClientBuilder.EndpointConfiguration endpointConfiguration)
setRegion(String)
or endpoint configuration are explicitly provided in the builder the
DEFAULT_REGION_PROVIDER
is consulted.
Only use this if using a non-standard service endpoint - the recommended approach for configuring a client is to use
setRegion(String)
endpointConfiguration
- The endpointConfiguration to usepublic final SubclassT withEndpointConfiguration(AwsClientBuilder.EndpointConfiguration endpointConfiguration)
withRegion(Region)
or endpoint configuration are explicitly provided in the builder the
DEFAULT_REGION_PROVIDER
is consulted.
Only use this if using a non-standard service endpoint - the recommended approach for configuring a client is to use
withRegion(Region)
endpointConfiguration
- The endpointConfiguration to usepublic final List<RequestHandler> getRequestHandlers()
public final void setRequestHandlers(RequestHandler... handlers)
handlers
- Request handlers to use for client.public final SubclassT withRequestHandlers(RequestHandler... handlers)
handlers
- Request handlers to use for client.public abstract TypeToBuildT build()
public abstract String getServiceName()
public abstract String getEndpointPrefix()
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.