public final class RetryPolicyAdapter extends Object implements RetryStrategy
RetryStrategy interface by wrapping a RetryPolicy instance.| Modifier and Type | Class and Description |
|---|---|
static class |
RetryPolicyAdapter.Builder |
| Modifier and Type | Method and Description |
|---|---|
AcquireInitialTokenResponse |
acquireInitialToken(AcquireInitialTokenRequest request)
Invoked before the first request attempt.
|
static RetryPolicyAdapter.Builder |
builder() |
boolean |
isInitialized() |
int |
maxAttempts()
Returns the maximum numbers attempts that this retry policy will allow.
|
RecordSuccessResponse |
recordSuccess(RecordSuccessRequest request)
Invoked after an attempt succeeds.
|
RefreshRetryTokenResponse |
refreshRetryToken(RefreshRetryTokenRequest request)
Invoked before each subsequent (non-first) request attempt.
|
RetryPolicyAdapter.Builder |
toBuilder()
Create a new
RetryStrategy.Builder with the current configuration. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waituseClientDefaultspublic AcquireInitialTokenResponse acquireInitialToken(AcquireInitialTokenRequest request)
RetryStrategyCallers MUST wait for the delay returned by this call before making the first attempt. Callers that wish to
retry a failed attempt MUST call RetryStrategy.refreshRetryToken(com.ibm.cos.v2.retries.api.RefreshRetryTokenRequest) before doing so.
If the attempt was successful, callers MUST call RetryStrategy.recordSuccess(com.ibm.cos.v2.retries.api.RecordSuccessRequest).
acquireInitialToken in interface RetryStrategypublic RefreshRetryTokenResponse refreshRetryToken(RefreshRetryTokenRequest request)
RetryStrategyCallers MUST wait for the delay returned by this call before making the next attempt. If the next attempt
fails, callers MUST re-call RetryStrategy.refreshRetryToken(com.ibm.cos.v2.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(com.ibm.cos.v2.retries.api.RecordSuccessRequest).
refreshRetryToken in interface RetryStrategypublic RecordSuccessResponse recordSuccess(RecordSuccessRequest request)
RetryStrategyrecordSuccess in interface RetryStrategypublic int maxAttempts()
RetryStrategymaxAttempts in interface RetryStrategypublic RetryPolicyAdapter.Builder toBuilder()
RetryStrategyRetryStrategy.Builder with the current configuration.
This is useful for modifying the strategy's behavior, like conditions or max retries.
toBuilder in interface RetryStrategypublic boolean isInitialized()
public static RetryPolicyAdapter.Builder builder()
Copyright © 2026. All rights reserved.