Subclass
- Concrete builder type, used for better fluent methods.TypeToBuild
- Type that this builder builds.@NotThreadSafe public abstract class AwsClientBuilder<Subclass extends AwsClientBuilder,TypeToBuild> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AwsClientBuilder.EndpointConfiguration
A container for configuration required to submit requests to a service (service endpoint and signing region)
|
protected class |
AwsClientBuilder.SyncBuilderParams
Presents a view of the builder to be used in a client constructor.
|
Modifier | Constructor and Description |
---|---|
protected |
AwsClientBuilder(ClientConfigurationFactory clientConfigFactory) |
protected |
AwsClientBuilder(ClientConfigurationFactory clientConfigFactory,
AwsRegionProvider regionProvider) |
Modifier and Type | Method and Description |
---|---|
abstract TypeToBuild |
build()
Builds a client with the configure properties.
|
ClientConfiguration |
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
|
RequestMetricCollector |
getMetricsCollector()
Gets the
RequestMetricCollector in use by the builder. |
String |
getRegion()
Gets the region in use by the builder.
|
List<RequestHandler2> |
getRequestHandlers()
Gets the list of request handlers in use by the builder.
|
protected Subclass |
getSubclass() |
protected AwsSyncClientParams |
getSyncClientParams() |
void |
setClientConfiguration(ClientConfiguration 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(RequestHandler2... handlers)
Sets the request handlers to use in the client.
|
Subclass |
withClientConfiguration(ClientConfiguration config)
Sets the ClientConfiguration to be used by the client.
|
Subclass |
withCredentials(AWSCredentialsProvider credentialsProvider)
Sets the AWSCredentialsProvider used by the client.
|
Subclass |
withEndpointConfiguration(AwsClientBuilder.EndpointConfiguration endpointConfiguration)
Sets the endpoint configuration (service endpoint & signing region) to be used for requests.
|
Subclass |
withIAMEndpoint(String iamEndpoint)
Sets the IAM endpoint to use for token retrieval by the DefaultTokenManager
and the DefaultTokenProvider.
|
Subclass |
withIAMMaxRetry(int retryCount)
Sets the maximum number of attempts for retrieving/refreshing IAM token by the DefaultTokenManager.
|
Subclass |
withIAMTokenRefresh(double offset)
Sets the time offset used for IAM token refresh by the DefaultTokenManager.
|
Subclass |
withMetricsCollector(RequestMetricCollector metrics)
Sets a custom RequestMetricCollector to use for the client.
|
Subclass |
withRegion(Regions region)
Sets the region to be used by the client.
|
Subclass |
withRegion(String region)
Sets the region to be used by the client.
|
Subclass |
withRequestHandlers(RequestHandler2... handlers)
Sets the request handlers to use in the client.
|
protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory)
protected AwsClientBuilder(ClientConfigurationFactory clientConfigFactory, AwsRegionProvider regionProvider)
public final AWSCredentialsProvider getCredentials()
public final void setCredentials(AWSCredentialsProvider credentialsProvider)
DefaultAWSCredentialsProviderChain
.credentialsProvider
- New AWSCredentialsProvider to use.public final Subclass withCredentials(AWSCredentialsProvider credentialsProvider)
DefaultAWSCredentialsProviderChain
.credentialsProvider
- New AWSCredentialsProvider to use.public Subclass withIAMEndpoint(String iamEndpoint)
iamEndpoint,
- http endpoint for token retrievalpublic Subclass withIAMTokenRefresh(double offset)
offset,
- percentage of token life before expiration that token should be refreshed.public Subclass withIAMMaxRetry(int retryCount)
offset,
- offset in seconds from token expiry time.public final ClientConfiguration getClientConfiguration()
public final void setClientConfiguration(ClientConfiguration config)
PredefinedClientConfigurations.defaultConfig()
but may differ per service.config
- Custom configuration to usepublic final Subclass withClientConfiguration(ClientConfiguration config)
PredefinedClientConfigurations.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 Subclass withMetricsCollector(RequestMetricCollector metrics)
metrics
- Custom RequestMetricCollector to use.public final String getRegion()
public final void setRegion(String region)
AwsClientBuilder.setEndpointConfiguration(EndpointConfiguration)
are explicitly provided in the builder the AwsClientBuilder.DEFAULT_REGION_PROVIDER
is consulted.region
- Region to usepublic final Subclass withRegion(Regions region)
AwsClientBuilder.setEndpointConfiguration(EndpointConfiguration)
are explicitly provided in the builder the AwsClientBuilder.DEFAULT_REGION_PROVIDER
is consulted.
For regions not explicitly in the Regions
enum use the AwsClientBuilder.withRegion(String)
overload.
region
- Region to usepublic final Subclass withRegion(String region)
AwsClientBuilder.setEndpointConfiguration(EndpointConfiguration)
are explicitly provided in the builder the AwsClientBuilder.DEFAULT_REGION_PROVIDER
is consulted.region
- Region to usepublic final AwsClientBuilder.EndpointConfiguration getEndpoint()
public final void setEndpointConfiguration(AwsClientBuilder.EndpointConfiguration endpointConfiguration)
AwsClientBuilder.setRegion(String)
or endpoint configuration are explicitly provided in the builder the AwsClientBuilder.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 AwsClientBuilder.setRegion(String)
endpointConfiguration
- The endpointConfiguration to usepublic final Subclass withEndpointConfiguration(AwsClientBuilder.EndpointConfiguration endpointConfiguration)
AwsClientBuilder.withRegion(String)
or endpoint configuration are explicitly provided in the builder the AwsClientBuilder.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 AwsClientBuilder.withRegion(String)
endpointConfiguration
- The endpointConfiguration to usepublic final List<RequestHandler2> getRequestHandlers()
public final void setRequestHandlers(RequestHandler2... handlers)
handlers
- Request handlers to use for client.public final Subclass withRequestHandlers(RequestHandler2... handlers)
handlers
- Request handlers to use for client.public abstract TypeToBuild build()
protected final AwsSyncClientParams getSyncClientParams()
protected final Subclass getSubclass()
Copyright © 2024. All rights reserved.