Class RetryPolicyAdapter
- All Implemented Interfaces:
RetryStrategy
RetryStrategy interface by wrapping a RetryPolicy instance.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionInvoked before the first request attempt.static RetryPolicyAdapter.Builderbuilder()booleanintReturns the maximum numbers attempts that this retry policy will allow.recordSuccess(RecordSuccessRequest request) Invoked after an attempt succeeds.Invoked before each subsequent (non-first) request attempt.Create a newRetryStrategy.Builderwith the current configuration.
-
Method Details
-
acquireInitialToken
Description copied from interface:RetryStrategyInvoked 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:RetryStrategyInvoked 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
-