Class SdkDefaultClientBuilder<B extends SdkClientBuilder<B,C>,C>
- Type Parameters:
B
- The type of builder, for chaining.C
- The type of client generated by this builder.
- All Implemented Interfaces:
SdkClientBuilder<B,
,C> Buildable
,SdkBuilder<B,
C>
- Direct Known Subclasses:
AwsDefaultClientBuilder
SdkClientBuilder
, SdkAsyncClientBuilder
and
SdkSyncClientBuilder
. 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 SdkClientBuilder
s, this class is not thread safe.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Wrapper aroundSdkAsyncHttpClient
to prevent it from being closed.static final class
Wrapper aroundSdkHttpClient
to prevent it from being closed. -
Method Summary
Modifier and TypeMethodDescriptionfinal B
Adds a plugin to the client builder.final B
asyncConfiguration
(ClientAsyncConfiguration asyncConfiguration) final C
build()
Build a client using the current state of this builder.final B
endpointOverride
(URI endpointOverride) Configure the endpoint with which the SDK should communicate.final B
httpClient
(SdkAsyncHttpClient httpClient) final B
httpClient
(SdkHttpClient httpClient) final B
httpClientBuilder
(SdkAsyncHttpClient.Builder httpClientBuilder) final B
httpClientBuilder
(SdkHttpClient.Builder httpClientBuilder) final B
metricPublishers
(List<MetricPublisher> metricPublishers) Retrieve the current override configuration.final B
overrideConfiguration
(ClientOverrideConfiguration overrideConfig) Specify overrides to the default SDK configuration that should be used for clients created by this builder.plugins()
Returns the list of plugins configured on the client builder.final void
setAsyncConfiguration
(ClientAsyncConfiguration asyncConfiguration) final void
setEndpointOverride
(URI endpointOverride) final void
setOverrideConfiguration
(ClientOverrideConfiguration overrideConfiguration) Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation
Methods inherited from interface software.amazon.awssdk.core.client.builder.SdkClientBuilder
overrideConfiguration, putAuthScheme
-
Method Details
-
build
Build a client using the current state of this builder. This is marked final in order to allow this class to add standard "build" logic between all service clients. Service clients are expected to implement thebuildClient()
method, that accepts the immutable client configuration generated by this build method.- Specified by:
build
in interfaceBuildable
- Specified by:
build
in interfaceSdkBuilder<B extends SdkClientBuilder<B,
C>, C> - Returns:
- an instance of T
-
endpointOverride
Description copied from interface:SdkClientBuilder
Configure the endpoint with which the SDK should communicate.It is important to know that
EndpointProvider
s and the endpoint override on the client are not mutually exclusive. In all existing cases, the endpoint override is passed as a parameter to the provider and the provider *may* modify it. For example, the S3 provider may add the bucket name as a prefix to the endpoint override for virtual bucket addressing.- Specified by:
endpointOverride
in interfaceSdkClientBuilder<B extends SdkClientBuilder<B,
C>, C>
-
setEndpointOverride
-
asyncConfiguration
-
setAsyncConfiguration
-
overrideConfiguration
Description copied from interface:SdkClientBuilder
Specify overrides to the default SDK configuration that should be used for clients created by this builder.- Specified by:
overrideConfiguration
in interfaceSdkClientBuilder<B extends SdkClientBuilder<B,
C>, C>
-
setOverrideConfiguration
-
overrideConfiguration
Description copied from interface:SdkClientBuilder
Retrieve the current override configuration. This allows further overrides across calls. Can be modified by first converting to a builder withClientOverrideConfiguration.toBuilder()
.- Specified by:
overrideConfiguration
in interfaceSdkClientBuilder<B extends SdkClientBuilder<B,
C>, C> - Returns:
- The existing override configuration for the builder.
-
httpClient
-
httpClientBuilder
-
httpClient
-
httpClientBuilder
-
metricPublishers
-
addPlugin
Description copied from interface:SdkClientBuilder
Adds a plugin to the client builder. The plugins will be invoked when building the client to allow them to change the configuration of the built client.- Specified by:
addPlugin
in interfaceSdkClientBuilder<B extends SdkClientBuilder<B,
C>, C>
-
plugins
Description copied from interface:SdkClientBuilder
Returns the list of plugins configured on the client builder.- Specified by:
plugins
in interfaceSdkClientBuilder<B extends SdkClientBuilder<B,
C>, C>
-