Enum DefaultsMode

java.lang.Object
java.lang.Enum<DefaultsMode>
software.amazon.awssdk.awscore.defaultsmode.DefaultsMode
All Implemented Interfaces:
Serializable, Comparable<DefaultsMode>

@Generated("software.amazon.awssdk:codegen") public enum DefaultsMode extends Enum<DefaultsMode>
A defaults mode determines how certain default configuration options are resolved in the SDK. Based on the provided mode, the SDK will vend sensible default values tailored to the mode for the following settings:
  • retryMode:

    A retry mode specifies how the SDK attempts retries. See Retry Mode

  • s3UsEast1RegionalEndpoints:

    Specifies how the SDK determines the AWS service endpoint that it uses to talk to the Amazon S3 for the us-east-1 region

  • connectTimeoutInMillis:

    The amount of time after making an initial connection attempt on a socket, where if the client does not receive a completion of the connect handshake, the client gives up and fails the operation

  • tlsNegotiationTimeoutInMillis:

    The maximum amount of time that a TLS handshake is allowed to take from the time the CLIENT HELLO message is sent to ethe time the client and server have fully negotiated ciphers and exchanged keys

All options above can be configured by users, and the overridden value will take precedence.

Note: for any mode other than LEGACY, the vended default values might change as best practices may evolve. As a result, it is encouraged to perform testing when upgrading the SDK if you are using a mode other than LEGACY

While the LEGACY defaults mode is specific to Java, other modes are standardized across all of the AWS SDKs

The defaults mode can be configured:

  1. Directly on a client via AwsClientBuilder.Builder#defaultsMode(DefaultsMode).
  2. On a configuration profile via the "defaults_mode" profile file property.
  3. Globally via the "aws.defaultsMode" system property.
  4. Globally via the "AWS_DEFAULTS_MODE" environment variable.
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The AUTO mode is an experimental mode that builds on the standard mode.
    The CROSS_REGION mode builds on the standard mode and includes optimization tailored for applications which call AWS services in a different region
    The IN_REGION mode builds on the standard mode and includes optimization tailored for applications which call AWS services from within the same AWS region
    The LEGACY mode provides default settings that vary per SDK and were used prior to establishment of defaults_mode
    The MOBILE mode builds on the standard mode and includes optimization tailored for mobile applications
    The STANDARD mode provides the latest recommended default values that should be safe to run in most scenarios
  • Method Summary

    Modifier and Type
    Method
    Description
    Use this in place of valueOf to convert the raw string returned by the service into the enum value.
     
    Returns the enum constant of this type with the specified name.
    static DefaultsMode[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • LEGACY

      public static final DefaultsMode LEGACY

      The LEGACY mode provides default settings that vary per SDK and were used prior to establishment of defaults_mode

    • STANDARD

      public static final DefaultsMode STANDARD

      The STANDARD mode provides the latest recommended default values that should be safe to run in most scenarios

      Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK

    • MOBILE

      public static final DefaultsMode MOBILE

      The MOBILE mode builds on the standard mode and includes optimization tailored for mobile applications

      Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK

    • CROSS_REGION

      public static final DefaultsMode CROSS_REGION

      The CROSS_REGION mode builds on the standard mode and includes optimization tailored for applications which call AWS services in a different region

      Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK

    • IN_REGION

      public static final DefaultsMode IN_REGION

      The IN_REGION mode builds on the standard mode and includes optimization tailored for applications which call AWS services from within the same AWS region

      Note that the default values vended from this mode might change as best practices may evolve. As a result, it is encouraged to perform tests when upgrading the SDK

    • AUTO

      public static final DefaultsMode AUTO

      The AUTO mode is an experimental mode that builds on the standard mode. The SDK will attempt to discover the execution environment to determine the appropriate settings automatically.

      Note that the auto detection is heuristics-based and does not guarantee 100% accuracy. STANDARD mode will be used if the execution environment cannot be determined. The auto detection might query EC2 Instance Metadata service, which might introduce latency. Therefore we recommend choosing an explicit defaults_mode instead if startup latency is critical to your application

  • Method Details

    • values

      public static DefaultsMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static DefaultsMode valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • fromValue

      public static DefaultsMode fromValue(String value)
      Use this in place of valueOf to convert the raw string returned by the service into the enum value.
      Parameters:
      value - real value
      Returns:
      DefaultsMode corresponding to the value
    • toString

      public String toString()
      Overrides:
      toString in class Enum<DefaultsMode>