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>

    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.

    • Constructor Detail

      • AwsDefaultClientBuilder

        protected AwsDefaultClientBuilder()
    • Method Detail

      • serviceEndpointPrefix

        protected abstract String 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

        protected abstract String signingName()
        Implemented by child classes to define the signing-name that should be used when signing requests when communicating with AWS.
      • serviceName

        protected abstract String serviceName()
        Implemented by child classes to define the service name used to identify the request in things like metrics.
      • serviceHttpConfig

        protected AttributeMap serviceHttpConfig()
        Optionally overridden by child classes to define service-specific HTTP configuration defaults.
      • finalizeServiceConfiguration

        protected SdkClientConfiguration finalizeServiceConfiguration​(SdkClientConfiguration configuration)
        Optionally overridden by child classes to derive service-specific configuration from the default-applied configuration.
      • 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)
      • 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:
        DefaultsMode
      • setDefaultsMode

        public final void setDefaultsMode​(DefaultsMode defaultsMode)