Class DefaultAdaptiveRetryStrategy
- All Implemented Interfaces:
AutoCloseable,AdaptiveRetryStrategy,RetryStrategy,DefaultAwareRetryStrategy,SdkAutoCloseable
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionThis method implements the logic ofRetryStrategy.acquireInitialToken(AcquireInitialTokenRequest).Acquire a retry token asynchronously.builder()voidclose()This method implements the logic ofRetryStrategy.refreshRetryToken(RefreshRetryTokenRequest).Refresh a retry token asynchronously.Create a newRetryStrategy.Builderwith the current configuration.Methods inherited from class software.amazon.awssdk.retries.internal.BaseRetryStrategy
addDefaults, hasRetryPredicates, maxAttempts, recordSuccess, retryPredicates, shouldAddDefaults, toString, useClientDefaultsMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awssdk.retries.api.RetryStrategy
maxAttempts, recordSuccess, useClientDefaults
-
Method Details
-
acquireInitialToken
Description copied from class:BaseRetryStrategyThis method implements the logic ofRetryStrategy.acquireInitialToken(AcquireInitialTokenRequest).- Specified by:
acquireInitialTokenin interfaceRetryStrategy- Overrides:
acquireInitialTokenin classBaseRetryStrategy- See Also:
-
refreshRetryToken
Description copied from class:BaseRetryStrategyThis method implements the logic ofRetryStrategy.refreshRetryToken(RefreshRetryTokenRequest).- Specified by:
refreshRetryTokenin interfaceRetryStrategy- Overrides:
refreshRetryTokenin classBaseRetryStrategy- See Also:
-
acquireInitialTokenAsync
public CompletableFuture<AcquireInitialTokenResponse> acquireInitialTokenAsync(AcquireInitialTokenRequest request) Description copied from interface:RetryStrategyAcquire a retry token asynchronously. 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).The future is completed exceptionally with
NullPointerExceptionif a required parameter isnull.The future is completed exceptionally with
TokenAcquisitionFailedExceptionif a token cannot be acquired.- Specified by:
acquireInitialTokenAsyncin interfaceRetryStrategy
-
refreshRetryTokenAsync
public CompletableFuture<RefreshRetryTokenResponse> refreshRetryTokenAsync(RefreshRetryTokenRequest request) Description copied from interface:RetryStrategyRefresh a retry token asynchronously. 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).The future is completed exceptionally with
NullPointerExceptionif a required parameter is not specified.The future is completed exceptionally with
IllegalArgumentExceptionif the provided token was not issued by this strategy or the provided token was already used for a previous refresh or success call.The future is completed exceptionally with
TokenAcquisitionFailedExceptionif a token cannot be acquired.- Specified by:
refreshRetryTokenAsyncin interfaceRetryStrategy
-
close
public void close()Description copied from interface:SdkAutoCloseable- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceRetryStrategy- Specified by:
closein interfaceSdkAutoCloseable
-
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 interfaceAdaptiveRetryStrategy- Specified by:
toBuilderin interfaceRetryStrategy
-
builder
-