Class AwsDefaultClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>
- Type Parameters:
BuilderT- The type of builder, for chaining.ClientT- The type of client generated by this builder.
- All Implemented Interfaces:
AwsClientBuilder<BuilderT,,ClientT> SdkClientBuilder<BuilderT,,ClientT> Buildable,SdkBuilder<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.
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder
SdkDefaultClientBuilder.NonManagedSdkAsyncHttpClient, SdkDefaultClientBuilder.NonManagedSdkHttpClient -
Field Summary
Fields inherited from class software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder
clientConfiguration, clientContextParams, overrideConfig -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal BuilderTcredentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider) Configure the credentials that should be used to authenticate with AWS.final BuilderTdefaultsMode(DefaultsMode defaultsMode) Sets theDefaultsModethat will be used to determine how certain default configuration options are resolved in the SDK.dualstackEnabled(Boolean dualstackEndpointEnabled) Configure whether the SDK should use the AWS dualstack endpoint.protected final SdkClientConfigurationfinalizeChildConfiguration(SdkClientConfiguration configuration) Return a client configuration object, populated with the following chain of priorities.protected SdkClientConfigurationfinalizeServiceConfiguration(SdkClientConfiguration configuration) Optionally overridden by child classes to derive service-specific configuration from the default-applied configuration.fipsEnabled(Boolean dualstackEndpointEnabled) Configure whether the SDK should use the AWS fips endpoints.protected final SdkClientConfigurationmergeChildDefaults(SdkClientConfiguration configuration) protected SdkClientConfigurationmergeInternalDefaults(SdkClientConfiguration configuration) Optionally overridden by child classes to define internal default configuration.protected SdkClientConfigurationmergeServiceDefaults(SdkClientConfiguration configuration) Optionally overridden by child classes to define service-specific default configuration.final BuilderTConfigure the region with which the SDK should communicate.protected abstract StringImplemented by child classes to define the endpoint prefix used when communicating with AWS.protected AttributeMapOptionally overridden by child classes to define service-specific HTTP configuration defaults.protected abstract StringImplemented by child classes to define the service name used to identify the request in things like metrics.final voidsetCredentialsProvider(AwsCredentialsProvider credentialsProvider) final voidsetCredentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider) final voidsetDefaultsMode(DefaultsMode defaultsMode) final voidsetDualstackEnabled(Boolean dualstackEndpointEnabled) final voidsetFipsEnabled(Boolean fipsEndpointEnabled) protected final SdkClientConfigurationsetOverrides(SdkClientConfiguration configuration) Apply the client override configuration to the provided configuration.final voidprotected abstract StringImplemented by child classes to define the signing-name that should be used when signing requests when communicating with AWS.Methods inherited from class software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder
addPlugin, asyncClientConfiguration, asyncConfiguration, build, buildClient, childHttpConfig, childHttpConfig, endpointOverride, httpClient, httpClient, httpClientBuilder, httpClientBuilder, invokePlugins, metricPublishers, overrideConfiguration, overrideConfiguration, plugins, setAsyncConfiguration, setEndpointOverride, setOverrideConfiguration, syncClientConfiguration, thisBuilderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.awssdk.awscore.client.builder.AwsClientBuilder
credentialsProviderMethods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, buildMethods inherited from interface software.amazon.awssdk.core.client.builder.SdkClientBuilder
addPlugin, endpointOverride, overrideConfiguration, overrideConfiguration, overrideConfiguration, plugins, putAuthScheme
-
Constructor Details
-
AwsDefaultClientBuilder
protected AwsDefaultClientBuilder()
-
-
Method Details
-
serviceEndpointPrefix
Implemented by child classes to define the endpoint prefix used when communicating with AWS. This constitutes the first part of the URL in the DNS name for the service. Eg. in the endpoint "dynamodb.amazonaws.com", this is the "dynamodb".For standard services, this should match the "endpointPrefix" field in the AWS model.
-
signingName
Implemented by child classes to define the signing-name that should be used when signing requests when communicating with AWS. -
serviceName
Implemented by child classes to define the service name used to identify the request in things like metrics. -
mergeChildDefaults
- Overrides:
mergeChildDefaultsin classSdkDefaultClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>, ClientT>
-
mergeServiceDefaults
Optionally overridden by child classes to define service-specific default configuration. -
mergeInternalDefaults
Optionally overridden by child classes to define internal default configuration. -
finalizeChildConfiguration
protected final SdkClientConfiguration finalizeChildConfiguration(SdkClientConfiguration configuration) Return a client configuration object, populated with the following chain of priorities.- Defaults vended from
DefaultsMode - AWS Global Defaults
- Overrides:
finalizeChildConfigurationin classSdkDefaultClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>, ClientT>
- Defaults vended from
-
setOverrides
Apply the client override configuration to the provided configuration.- Overrides:
setOverridesin classSdkDefaultClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>, ClientT>
-
serviceHttpConfig
Optionally overridden by child classes to define service-specific HTTP configuration defaults. -
finalizeServiceConfiguration
Optionally overridden by child classes to derive service-specific configuration from the default-applied configuration. -
region
Description copied from interface:AwsClientBuilderConfigure the region with which the SDK should communicate.If this is not specified, the SDK will attempt to identify the endpoint automatically using the following logic:
- Check the 'aws.region' system property for the region.
- Check the 'AWS_REGION' environment variable for the region.
- Check the {user.home}/.aws/credentials and {user.home}/.aws/config files for the region.
- If running in EC2, check the EC2 metadata service for the region.
If the region is not found in any of the locations above, an exception will be thrown at
SdkBuilder.build()time.- Specified by:
regionin interfaceAwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>, ClientT>
-
setRegion
-
dualstackEnabled
Description copied from interface:AwsClientBuilderConfigure whether the SDK should use the AWS dualstack endpoint.If this is not specified, the SDK will attempt to determine whether the dualstack endpoint should be used automatically using the following logic:
- Check the 'aws.useDualstackEndpoint' system property for 'true' or 'false'.
- Check the 'AWS_USE_DUALSTACK_ENDPOINT' environment variable for 'true' or 'false'.
- Check the {user.home}/.aws/credentials and {user.home}/.aws/config files for the 'use_dualstack_endpoint' property set to 'true' or 'false'.
If the setting is not found in any of the locations above, 'false' will be used.
- Specified by:
dualstackEnabledin interfaceAwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>, ClientT>
-
setDualstackEnabled
-
fipsEnabled
Description copied from interface:AwsClientBuilderConfigure whether the SDK should use the AWS fips endpoints.If this is not specified, the SDK will attempt to determine whether the fips endpoint should be used automatically using the following logic:
- Check the 'aws.useFipsEndpoint' system property for 'true' or 'false'.
- Check the 'AWS_USE_FIPS_ENDPOINT' environment variable for 'true' or 'false'.
- Check the {user.home}/.aws/credentials and {user.home}/.aws/config files for the 'use_fips_endpoint' property set to 'true' or 'false'.
If the setting is not found in any of the locations above, 'false' will be used.
- Specified by:
fipsEnabledin interfaceAwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>, ClientT>
-
setFipsEnabled
-
setCredentialsProvider
-
credentialsProvider
public final BuilderT credentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider) Description copied from interface:AwsClientBuilderConfigure the credentials that should be used to authenticate with AWS.The default provider will attempt to identify the credentials automatically using the following checks:
- Java System Properties -
aws.accessKeyIdandaws.secretAccessKey - Environment Variables -
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY - Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
- Credentials delivered through the Amazon EC2 container service if AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variable is set and security manager has permission to access the variable.
- Instance profile credentials delivered through the Amazon EC2 metadata service
If the credentials are not found in any of the locations above, an exception will be thrown at
SdkBuilder.build()time.The last of
AwsClientBuilder.credentialsProvider(AwsCredentialsProvider)orAwsClientBuilder.credentialsProvider(IdentityProvider)wins.- Specified by:
credentialsProviderin interfaceAwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>, ClientT>
- Java System Properties -
-
setCredentialsProvider
public final void setCredentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider) -
defaultsMode
Description copied from interface:AwsClientBuilderSets theDefaultsModethat 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:
- Check the "defaults_mode" profile file property.
- Check "aws.defaultsMode" system property.
- Check the "AWS_DEFAULTS_MODE" environment variable.
- Specified by:
defaultsModein interfaceAwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>, ClientT> - Parameters:
defaultsMode- the defaultsMode to use- Returns:
- This object for method chaining.
- See Also:
-
setDefaultsMode
-