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| Modifier | Constructor and Description |
|---|---|
protected |
AwsDefaultClientBuilder() |
| Modifier and Type | Method and Description |
|---|---|
protected AttributeMap |
childHttpConfig() |
BuilderT |
credentialsProvider(AwsCredentialsProvider credentialsProvider)
Configure the credentials that should be used to authenticate with AWS.
|
protected SdkClientConfiguration |
finalizeChildConfiguration(SdkClientConfiguration configuration) |
protected SdkClientConfiguration |
finalizeServiceConfiguration(SdkClientConfiguration configuration)
Optionally overridden by child classes to derive service-specific configuration from the default-applied configuration.
|
protected SdkClientConfiguration |
mergeChildDefaults(SdkClientConfiguration 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 |
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, setAsyncConfiguration, setEndpointOverride, setOverrideConfiguration, syncClientConfiguration, thisBuilderclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitendpointOverride, 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 AttributeMap serviceHttpConfig()
protected final SdkClientConfiguration mergeChildDefaults(SdkClientConfiguration configuration)
mergeChildDefaults in class SdkDefaultClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>protected SdkClientConfiguration mergeServiceDefaults(SdkClientConfiguration configuration)
protected final SdkClientConfiguration finalizeChildConfiguration(SdkClientConfiguration configuration)
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:
region in interface AwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>public final void setRegion(Region region)
public final BuilderT credentialsProvider(AwsCredentialsProvider credentialsProvider)
AwsClientBuilderThe default provider will attempt to identify the credentials automatically using the following checks:
aws.accessKeyId and aws.secretKeyAWS_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)
Copyright © 2021. All rights reserved.