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 richRetryTokenimplementation. 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 Classes Modifier and Type Class Description static classDefaultRetryToken.BuilderA builder class to createDefaultRetryTokeninstances or to mutate them.static classDefaultRetryToken.TokenStateSet of possibles states on which the RetryToken can be, in-progress, succeeded and all the possible failure modes.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intattempt()Returns the latest attempt count.static DefaultRetryToken.Builderbuilder()Returns a new builder to create new instances of theDefaultRetryTokenclass.intcapacityAcquired()Returns the latest capacity acquired from the token bucket.intcapacityRemaining()Returns the capacity remaining in the token bucket when the last acquire request was done.Stringscope()Returns the token scope.DefaultRetryToken.TokenStatestate()Returns the state of the token.DefaultRetryToken.BuildertoBuilder()Creates a new builder to mutate the current instance.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
attempt
public int attempt()
Returns the latest attempt count.
-
scope
public String 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
public DefaultRetryToken.TokenState state()
Returns the state of the token.
-
toBuilder
public DefaultRetryToken.Builder toBuilder()
Creates a new builder to mutate the current instance.- Specified by:
toBuilderin interfaceToCopyableBuilder<DefaultRetryToken.Builder,DefaultRetryToken>
-
builder
public static DefaultRetryToken.Builder builder()
Returns a new builder to create new instances of theDefaultRetryTokenclass.
-
-