Class WaiterOverrideConfiguration.Builder

java.lang.Object
software.amazon.awssdk.core.waiters.WaiterOverrideConfiguration.Builder
  • Method Details

    • backoffStrategy

      public WaiterOverrideConfiguration.Builder backoffStrategy(BackoffStrategy backoffStrategy)
      Deprecated.
      Define the BackoffStrategy that computes the delay between resource polling. Only one of
      invalid reference
      Builder#backoffStrategy()
      and
      invalid reference
      Builder#backoffStrategyV2()
      may be defined.
      Parameters:
      backoffStrategy - The new backoffStrategy value.
      Returns:
      This object for method chaining.
    • backoffStrategyV2

      public WaiterOverrideConfiguration.Builder backoffStrategyV2(BackoffStrategy backoffStrategy)
      Define the BackoffStrategy that computes the delay between resource polling. Only one of
      invalid reference
      Builder#backoffStrategy()
      and
      invalid reference
      Builder#backoffStrategyV2()
      may be defined.
      Parameters:
      backoffStrategy - The new backoffStrategy value.
      Returns:
      This object for method chaining.
    • maxAttempts

      public WaiterOverrideConfiguration.Builder maxAttempts(Integer maxAttempts)
      Define the maximum number of attempts to try before transitioning the waiter to a failure state.

      maxAttempts works alongside waitTimeout(Duration), which, when set, acts as an upper bound on the total wait time. The waiter transitions to a failure state as soon as either limit is reached.

      Parameters:
      maxAttempts - The new maxAttempts value.
      Returns:
      This object for method chaining.
    • waitTimeout

      public WaiterOverrideConfiguration.Builder waitTimeout(Duration waitTimeout)
      Define the amount of time to wait for the resource to transition to the desired state before timing out. This wait timeout doesn't have strict guarantees on how quickly a request is aborted when the timeout is breached. The request can timeout early if it is determined that the next retry will breach the max wait time. It's disabled by default.

      When set, waitTimeout is an upper bound on the total wait time and works alongside maxAttempts(Integer), which caps the number of polling attempts (with a service-provided default). The waiter transitions to a failure state as soon as either limit is reached — the waiter may error out at the attempt limit before waitTimeout elapses. For example, if a service defines a default maxAttempts=100 with a 6-second delay between polls, setting only waitTimeout(Duration.ofMinutes(30)) still terminates the waiter at ~10 minutes because maxAttempts is reached first.

      To wait longer than the service-provided default, override maxAttempts(Integer) to increase the number of polling attempts or backoffStrategyV2(BackoffStrategy) to lengthen the delay between polls.

      Parameters:
      waitTimeout - The new waitTimeout value.
      Returns:
      This object for method chaining.
    • build

      Description copied from interface: SdkBuilder
      An immutable object that is created from the properties that have been set on the builder.
      Specified by:
      build in interface Buildable
      Specified by:
      build in interface SdkBuilder<WaiterOverrideConfiguration.Builder,WaiterOverrideConfiguration>
      Returns:
      an instance of T