Class AwsDefaultClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>

java.lang.Object
software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder<BuilderT,ClientT>
software.amazon.awssdk.awscore.client.builder.AwsDefaultClientBuilder<BuilderT,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>

public abstract class AwsDefaultClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT> extends SdkDefaultClientBuilder<BuilderT,ClientT> implements AwsClientBuilder<BuilderT,ClientT>
An SDK-internal implementation of the methods in 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.

  • Method Details

    • region

      public final BuilderT region(Region region)
      Description copied from interface: AwsClientBuilder
      Configure 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:

      1. Check the 'aws.region' system property for the region.
      2. Check the 'AWS_REGION' environment variable for the region.
      3. Check the {user.home}/.aws/credentials and {user.home}/.aws/config files for the region.
      4. 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:
      region in interface AwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>
    • setRegion

      public final void setRegion(Region region)
    • dualstackEnabled

      public BuilderT dualstackEnabled(Boolean dualstackEndpointEnabled)
      Description copied from interface: AwsClientBuilder
      Configure 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:

      1. Check the 'aws.useDualstackEndpoint' system property for 'true' or 'false'.
      2. Check the 'AWS_USE_DUALSTACK_ENDPOINT' environment variable for 'true' or 'false'.
      3. 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:
      dualstackEnabled in interface AwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>
    • setDualstackEnabled

      public final void setDualstackEnabled(Boolean dualstackEndpointEnabled)
    • fipsEnabled

      public BuilderT fipsEnabled(Boolean dualstackEndpointEnabled)
      Description copied from interface: AwsClientBuilder
      Configure 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:

      1. Check the 'aws.useFipsEndpoint' system property for 'true' or 'false'.
      2. Check the 'AWS_USE_FIPS_ENDPOINT' environment variable for 'true' or 'false'.
      3. 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:
      fipsEnabled in interface AwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>
    • setFipsEnabled

      public final void setFipsEnabled(Boolean fipsEndpointEnabled)
    • setCredentialsProvider

      public final void setCredentialsProvider(AwsCredentialsProvider credentialsProvider)
    • credentialsProvider

      public final BuilderT credentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider)
      Description copied from interface: AwsClientBuilder
      Configure the credentials that should be used to authenticate with AWS.

      The default provider will attempt to identify the credentials automatically using the following checks:

      1. Java System Properties - aws.accessKeyId and aws.secretAccessKey
      2. Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
      3. Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
      4. 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.
      5. 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) or AwsClientBuilder.credentialsProvider(IdentityProvider) wins.

      Specified by:
      credentialsProvider in interface AwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>
    • setCredentialsProvider

      public final void setCredentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> identityProvider)
    • defaultsMode

      public final BuilderT defaultsMode(DefaultsMode defaultsMode)
      Description copied from interface: AwsClientBuilder
      Sets the DefaultsMode 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:

      1. Check the "defaults_mode" profile file property.
      2. Check "aws.defaultsMode" system property.
      3. Check the "AWS_DEFAULTS_MODE" environment variable.
      Specified by:
      defaultsMode in interface AwsClientBuilder<BuilderT extends AwsClientBuilder<BuilderT,ClientT>,ClientT>
      Parameters:
      defaultsMode - the defaultsMode to use
      Returns:
      This object for method chaining.
      See Also:
    • setDefaultsMode

      public final void setDefaultsMode(DefaultsMode defaultsMode)