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 classA builder class to createDefaultRetryTokeninstances or to mutate them.static enumSet of possibles states on which the RetryToken can be, in-progress, succeeded and all the possible failure modes. -
Method Summary
Modifier and TypeMethodDescriptionintattempt()Returns the latest attempt count.static DefaultRetryToken.Builderbuilder()Returns a new builder to create new instances of theDefaultRetryTokenclass.intReturns the latest capacity acquired from the token bucket.intReturns 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, waitMethods 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:
toBuilderin interfaceToCopyableBuilder<DefaultRetryToken.Builder,DefaultRetryToken> - Returns:
- a builder for type T
-
toString
-
builder
Returns a new builder to create new instances of theDefaultRetryTokenclass.
-