Class DefaultRetryToken
java.lang.Object
software.amazon.awssdk.retries.internal.DefaultRetryToken
- All Implemented Interfaces:
RetryToken
,ToCopyableBuilder<DefaultRetryToken.Builder,
DefaultRetryToken>
public final class DefaultRetryToken
extends Object
implements RetryToken, ToCopyableBuilder<DefaultRetryToken.Builder,DefaultRetryToken>
A data rich
RetryToken
implementation. The data contained in this class is not part of the interface but is needed for
the calling code to test and generate meaningful logs using its current state.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A builder class to createDefaultRetryToken
instances or to mutate them.static enum
Set of possibles states on which the RetryToken can be, in-progress, succeeded and all the possible failure modes. -
Method Summary
Modifier and TypeMethodDescriptionint
attempt()
Returns the latest attempt count.static DefaultRetryToken.Builder
builder()
Returns a new builder to create new instances of theDefaultRetryToken
class.int
Returns the latest capacity acquired from the token bucket.int
Returns the capacity remaining in the token bucket when the last acquire request was done.scope()
Returns the token scope.state()
Returns the state of the token.Creates a new builder to mutate the current instance.toString()
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
attempt
public int attempt()Returns the latest attempt count. -
scope
Returns the token scope. -
capacityAcquired
public int capacityAcquired()Returns the latest capacity acquired from the token bucket. -
capacityRemaining
public int capacityRemaining()Returns the capacity remaining in the token bucket when the last acquire request was done. -
state
Returns the state of the token. -
toBuilder
Creates a new builder to mutate the current instance.- Specified by:
toBuilder
in interfaceToCopyableBuilder<DefaultRetryToken.Builder,
DefaultRetryToken> - Returns:
- a builder for type T
-
toString
-
builder
Returns a new builder to create new instances of theDefaultRetryToken
class.
-