B
- The type of builder, for chaining.C
- The type of client generated by this builder.public abstract class DefaultClientBuilder<B extends ClientBuilder<B,C>,C> extends Object implements ClientBuilder<B,C>
ClientBuilder
, AsyncClientBuilder
and
SyncClientBuilder
. This implements all methods required by those interfaces, allowing service-specific builders to
just
implement the configuration they wish to add.
By implementing both the sync and async interface's methods, service-specific builders can share code between their sync and async variants without needing one to extend the other. Note: This only defines the methods in the sync and async builder interfaces. It does not implement the interfaces themselves. This is because the sync and async client builder interfaces both require a type-constrained parameter for use in fluent chaining, and a generic type parameter conflict is introduced into the class hierarchy by this interface extending the builder interfaces themselves.
Like all ClientBuilder
s, this class is not thread safe.
Modifier and Type | Method and Description |
---|---|
B |
asyncExecutorProvider(ExecutorProvider asyncExecutorProvider) |
B |
asyncHttpConfiguration(ClientAsyncHttpConfiguration asyncHttpConfiguration) |
C |
build()
Build a client using the current state of this builder.
|
B |
credentialsProvider(AwsCredentialsProvider credentialsProvider)
Configure the credentials that should be used to authenticate with AWS.
|
B |
endpointOverride(URI endpointOverride)
Configure the endpoint with which the SDK should communicate.
|
B |
httpConfiguration(ClientHttpConfiguration httpConfiguration) |
B |
overrideConfiguration(ClientOverrideConfiguration overrideConfiguration)
Specify overrides to the default SDK configuration that should be used for clients created by this builder.
|
B |
region(Region region)
Configure the region with which the SDK should communicate.
|
void |
setAsyncExecutorProvider(ExecutorProvider asyncExecutorProvider) |
void |
setAsyncHttpConfiguration(ClientAsyncHttpConfiguration asyncHttpConfiguration) |
void |
setCredentialsProvider(AwsCredentialsProvider credentialsProvider) |
void |
setEndpointOverride(URI endpointOverride) |
void |
setHttpConfiguration(ClientHttpConfiguration httpConfiguration) |
void |
setOverrideConfiguration(ClientOverrideConfiguration overrideConfiguration) |
void |
setRegion(Region region) |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
overrideConfiguration
apply
public final C build()
buildClient()
method, that
accepts the immutable client configuration generated by this build method.build
in interface SdkBuilder<B extends ClientBuilder<B,C>,C>
public final B region(Region region)
ClientBuilder
If this is not specified, the SDK will attempt to identify the endpoint automatically using the following logic:
region
in interface ClientBuilder<B extends ClientBuilder<B,C>,C>
public final void setRegion(Region region)
public B endpointOverride(URI endpointOverride)
ClientBuilder
ClientBuilder.region(Region)
. Even when this is used, the ClientBuilder.region(Region)
must still be specified for the purposes of
message signing.endpointOverride
in interface ClientBuilder<B extends ClientBuilder<B,C>,C>
public void setEndpointOverride(URI endpointOverride)
public B asyncExecutorProvider(ExecutorProvider asyncExecutorProvider)
public void setAsyncExecutorProvider(ExecutorProvider asyncExecutorProvider)
public final B overrideConfiguration(ClientOverrideConfiguration overrideConfiguration)
ClientBuilder
overrideConfiguration
in interface ClientBuilder<B extends ClientBuilder<B,C>,C>
public final void setOverrideConfiguration(ClientOverrideConfiguration overrideConfiguration)
public final B httpConfiguration(ClientHttpConfiguration httpConfiguration)
public final void setHttpConfiguration(ClientHttpConfiguration httpConfiguration)
public final B asyncHttpConfiguration(ClientAsyncHttpConfiguration asyncHttpConfiguration)
public final void setAsyncHttpConfiguration(ClientAsyncHttpConfiguration asyncHttpConfiguration)
public final B credentialsProvider(AwsCredentialsProvider credentialsProvider)
ClientBuilder
The default provider will attempt to identify the credentials automatically using the following checks:
aws.accessKeyId
and aws.secretKey
AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
If the credentials are not found in any of the locations above, an exception will be thrown at SdkBuilder.build()
time.
credentialsProvider
in interface ClientBuilder<B extends ClientBuilder<B,C>,C>
public final void setCredentialsProvider(AwsCredentialsProvider credentialsProvider)
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.