BuilderT - The type of builder, for chaining.ClientT - The type of client generated by this builder.public abstract class AwsDefaultClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT> extends SdkDefaultClientBuilder<BuilderT,ClientT> implements AwsClientBuilder<BuilderT,ClientT>
AwsClientBuilder, AwsAsyncClientBuilder and
AwsSyncClientBuilder. 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 AwsClientBuilders, this class is not thread safe.
SdkDefaultClientBuilder.NonManagedSdkAsyncHttpClient, SdkDefaultClientBuilder.NonManagedSdkHttpClientclientConfiguration, clientContextParams| Modifier | Constructor and Description |
|---|---|
protected |
AwsDefaultClientBuilder() |
| Modifier and Type | Method and Description |
|---|---|
protected AttributeMap |
childHttpConfig() |
protected AttributeMap |
childHttpConfig(SdkClientConfiguration configuration)
Return HTTP related defaults with the following chain of priorities.
|
BuilderT |
credentialsProvider(AwsCredentialsProvider credentialsProvider)
Configure the credentials that should be used to authenticate with AWS.
|
BuilderT |
defaultsMode(DefaultsMode defaultsMode)
Sets the
DefaultsMode that will be used to determine how certain default configuration options are resolved in
the SDK. |
BuilderT |
dualstackEnabled(Boolean dualstackEndpointEnabled)
Configure whether the SDK should use the AWS dualstack endpoint.
|
protected SdkClientConfiguration |
finalizeChildConfiguration(SdkClientConfiguration configuration)
Return a client configuration object, populated with the following chain of priorities.
|
protected SdkClientConfiguration |
finalizeServiceConfiguration(SdkClientConfiguration configuration)
Optionally overridden by child classes to derive service-specific configuration from the default-applied configuration.
|
BuilderT |
fipsEnabled(Boolean dualstackEndpointEnabled)
Configure whether the SDK should use the AWS fips endpoints.
|
protected SdkClientConfiguration |
mergeChildDefaults(SdkClientConfiguration configuration) |
protected SdkClientConfiguration |
mergeInternalDefaults(SdkClientConfiguration configuration)
Optionally overridden by child classes to define internal default configuration.
|
protected SdkClientConfiguration |
mergeServiceDefaults(SdkClientConfiguration configuration)
Optionally overridden by child classes to define service-specific default configuration.
|
BuilderT |
region(Region region)
Configure the region with which the SDK should communicate.
|
protected abstract String |
serviceEndpointPrefix()
Implemented by child classes to define the endpoint prefix used when communicating with AWS.
|
protected AttributeMap |
serviceHttpConfig()
Optionally overridden by child classes to define service-specific HTTP configuration defaults.
|
protected abstract String |
serviceName()
Implemented by child classes to define the service name used to identify the request in things like metrics.
|
void |
setCredentialsProvider(AwsCredentialsProvider credentialsProvider) |
void |
setDefaultsMode(DefaultsMode defaultsMode) |
void |
setDualstackEnabled(Boolean dualstackEndpointEnabled) |
void |
setFipsEnabled(Boolean fipsEndpointEnabled) |
void |
setRegion(Region region) |
protected abstract String |
signingName()
Implemented by child classes to define the signing-name that should be used when signing requests when communicating with
AWS.
|
asyncClientConfiguration, asyncConfiguration, build, buildClient, endpointOverride, httpClient, httpClient, httpClientBuilder, httpClientBuilder, metricPublishers, overrideConfiguration, overrideConfiguration, setAsyncConfiguration, setEndpointOverride, setOverrideConfiguration, syncClientConfiguration, thisBuilderclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitendpointOverride, overrideConfiguration, overrideConfiguration, overrideConfigurationapplyMutation, buildprotected abstract String serviceEndpointPrefix()
For standard services, this should match the "endpointPrefix" field in the AWS model.
protected abstract String signingName()
protected abstract String serviceName()
protected final AttributeMap childHttpConfig()
childHttpConfig in class SdkDefaultClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>protected final AttributeMap childHttpConfig(SdkClientConfiguration configuration)
DefaultsModechildHttpConfig in class SdkDefaultClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>protected AttributeMap serviceHttpConfig()
protected final SdkClientConfiguration mergeChildDefaults(SdkClientConfiguration configuration)
mergeChildDefaults in class SdkDefaultClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>protected SdkClientConfiguration mergeServiceDefaults(SdkClientConfiguration configuration)
protected SdkClientConfiguration mergeInternalDefaults(SdkClientConfiguration configuration)
protected final SdkClientConfiguration finalizeChildConfiguration(SdkClientConfiguration configuration)
DefaultsMode finalizeChildConfiguration in class SdkDefaultClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>protected SdkClientConfiguration finalizeServiceConfiguration(SdkClientConfiguration configuration)
public final BuilderT region(Region region)
AwsClientBuilderIf this is not specified, the SDK will attempt to identify the endpoint automatically using the following logic:
If the region is not found in any of the locations above, an exception will be thrown at SdkBuilder.build() time.
region in interface AwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>public final void setRegion(Region region)
public BuilderT dualstackEnabled(Boolean dualstackEndpointEnabled)
AwsClientBuilderIf this is not specified, the SDK will attempt to determine whether the dualstack endpoint should be used automatically using the following logic:
If the setting is not found in any of the locations above, 'false' will be used.
dualstackEnabled in interface AwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>public final void setDualstackEnabled(Boolean dualstackEndpointEnabled)
public BuilderT fipsEnabled(Boolean dualstackEndpointEnabled)
AwsClientBuilderIf this is not specified, the SDK will attempt to determine whether the fips endpoint should be used automatically using the following logic:
If the setting is not found in any of the locations above, 'false' will be used.
fipsEnabled in interface AwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>public final void setFipsEnabled(Boolean fipsEndpointEnabled)
public final BuilderT credentialsProvider(AwsCredentialsProvider credentialsProvider)
AwsClientBuilderThe default provider will attempt to identify the credentials automatically using the following checks:
aws.accessKeyId and aws.secretAccessKeyAWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEYIf the credentials are not found in any of the locations above, an exception will be thrown at SdkBuilder.build() time.
credentialsProvider in interface AwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>public final void setCredentialsProvider(AwsCredentialsProvider credentialsProvider)
public final BuilderT defaultsMode(DefaultsMode defaultsMode)
AwsClientBuilderDefaultsMode that will be used to determine how certain default configuration options are resolved in
the SDK.
If this is not specified, the SDK will attempt to identify the defaults mode automatically using the following logic:
defaultsMode in interface AwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>defaultsMode - the defaultsMode to useDefaultsModepublic final void setDefaultsMode(DefaultsMode defaultsMode)
Copyright © 2022. All rights reserved.