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.Builder
builder()
boolean
int
Returns 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.Builder
with the current configuration.
-
Method Details
-
acquireInitialToken
Description copied from interface:RetryStrategy
Invoked before the first request attempt.Callers MUST wait for the
delay
returned 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:
acquireInitialToken
in interfaceRetryStrategy
-
refreshRetryToken
Description copied from interface:RetryStrategy
Invoked before each subsequent (non-first) request attempt.Callers MUST wait for the
delay
returned 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:
refreshRetryToken
in interfaceRetryStrategy
-
recordSuccess
Description copied from interface:RetryStrategy
Invoked after an attempt succeeds.- Specified by:
recordSuccess
in interfaceRetryStrategy
-
maxAttempts
public int maxAttempts()Description copied from interface:RetryStrategy
Returns the maximum numbers attempts that this retry policy will allow.- Specified by:
maxAttempts
in interfaceRetryStrategy
- Returns:
- the maximum numbers attempts that this retry policy will allow.
-
toBuilder
Description copied from interface:RetryStrategy
Create a newRetryStrategy.Builder
with the current configuration.This is useful for modifying the strategy's behavior, like conditions or max retries.
- Specified by:
toBuilder
in interfaceRetryStrategy
-
isInitialized
public boolean isInitialized() -
builder
-