Class RetryPolicyAdapter
- All Implemented Interfaces:
AutoCloseable,RetryStrategy,SdkAutoCloseable
RetryStrategy interface by wrapping a RetryPolicy instance.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionAcquire a retry token synchronously.static RetryPolicyAdapter.Builderbuilder()booleanintReturns the maximum numbers attempts that this retry policy will allow.recordSuccess(RecordSuccessRequest request) Invoked after an attempt succeeds.Refresh a retry token synchronously.Create a newRetryStrategy.Builderwith the current configuration.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.awssdk.retries.api.RetryStrategy
acquireInitialTokenAsync, close, refreshRetryTokenAsync, useClientDefaults
-
Method Details
-
acquireInitialToken
Description copied from interface:RetryStrategyAcquire a retry token synchronously. Invoked before the first request attempt.Callers MUST wait for the
delayreturned by this call before making the first attempt. Callers that wish to retry a failed attempt MUST callRetryStrategy.refreshRetryToken(software.amazon.awssdk.retries.api.RefreshRetryTokenRequest)before doing so.If the attempt was successful, callers MUST call
RetryStrategy.recordSuccess(software.amazon.awssdk.retries.api.RecordSuccessRequest).- Specified by:
acquireInitialTokenin interfaceRetryStrategy
-
refreshRetryToken
Description copied from interface:RetryStrategyRefresh a retry token synchronously. Invoked before each subsequent (non-first) request attempt.Callers MUST wait for the
delayreturned by this call before making the next attempt. If the next attempt fails, callers MUST re-callRetryStrategy.refreshRetryToken(software.amazon.awssdk.retries.api.RefreshRetryTokenRequest)before attempting another retry. This call invalidates the provided token, and returns a new one. Callers MUST use the new token.If the attempt was successful, callers MUST call
RetryStrategy.recordSuccess(software.amazon.awssdk.retries.api.RecordSuccessRequest).- Specified by:
refreshRetryTokenin interfaceRetryStrategy
-
recordSuccess
Description copied from interface:RetryStrategyInvoked after an attempt succeeds.- Specified by:
recordSuccessin interfaceRetryStrategy
-
maxAttempts
public int maxAttempts()Description copied from interface:RetryStrategyReturns the maximum numbers attempts that this retry policy will allow.- Specified by:
maxAttemptsin interfaceRetryStrategy- Returns:
- the maximum numbers attempts that this retry policy will allow.
-
toBuilder
Description copied from interface:RetryStrategyCreate a newRetryStrategy.Builderwith the current configuration.This is useful for modifying the strategy's behavior, like conditions or max retries.
- Specified by:
toBuilderin interfaceRetryStrategy
-
isInitialized
public boolean isInitialized() -
builder
-