public class RetryableStageHelper
extends java.lang.Object
RetryableStage
and
AsyncRetryableStage
when querying and interacting with a
RetryPolicy
.Constructor and Description |
---|
RetryableStageHelper(software.amazon.awssdk.http.SdkHttpFullRequest request,
software.amazon.awssdk.core.internal.http.RequestExecutionContext context,
software.amazon.awssdk.core.internal.http.HttpClientDependencies dependencies) |
Modifier and Type | Method and Description |
---|---|
void |
adjustClockIfClockSkew(software.amazon.awssdk.core.Response<?> response)
Adjust the client-side clock skew if the provided response indicates that
there is a large skew between the client and service.
|
void |
attemptSucceeded()
Notify the retry policy that the request attempt succeeded.
|
int |
getAttemptNumber()
Retrieve the current attempt number, updated whenever
startingAttempt() is invoked. |
java.time.Duration |
getBackoffDelay()
Get the amount of time that the request should be delayed before being sent.
|
software.amazon.awssdk.core.exception.SdkException |
getLastException()
Retrieve the last call failure exception encountered by this execution,
updated whenever
setLastException(java.lang.Throwable) is invoked. |
void |
logBackingOff(java.time.Duration backoffDelay)
Log a message to the user at the debug level to indicate how long we will
wait before retrying the request.
|
void |
logSendingRequest()
Log a message to the user at the debug level to indicate that we are sending
the request to the service.
|
software.amazon.awssdk.http.SdkHttpFullRequest |
requestToSend()
Retrieve the request to send to the service, including any detailed retry
information headers.
|
boolean |
retryPolicyAllowsRetry()
Returns true if the retry policy allows this attempt.
|
software.amazon.awssdk.core.exception.SdkException |
retryPolicyDisallowedRetryException()
Return the exception that should be thrown, because the retry policy did not
allow the request to be retried.
|
void |
setLastException(java.lang.Throwable lastException)
Update the
getLastException() value for this helper. |
void |
setLastResponse(software.amazon.awssdk.http.SdkHttpResponse lastResponse)
Set the last HTTP response returned by the service.
|
void |
startingAttempt()
Invoke when starting a request attempt, before querying the retry policy.
|
public RetryableStageHelper(software.amazon.awssdk.http.SdkHttpFullRequest request, software.amazon.awssdk.core.internal.http.RequestExecutionContext context, software.amazon.awssdk.core.internal.http.HttpClientDependencies dependencies)
public void startingAttempt()
public boolean retryPolicyAllowsRetry()
public software.amazon.awssdk.core.exception.SdkException retryPolicyDisallowedRetryException()
public java.time.Duration getBackoffDelay()
Duration.ZERO
, such as for the first request in the
request series.public void logBackingOff(java.time.Duration backoffDelay)
public software.amazon.awssdk.http.SdkHttpFullRequest requestToSend()
public void logSendingRequest()
public void adjustClockIfClockSkew(software.amazon.awssdk.core.Response<?> response)
public void attemptSucceeded()
public int getAttemptNumber()
startingAttempt()
is invoked.public software.amazon.awssdk.core.exception.SdkException getLastException()
setLastException(java.lang.Throwable)
is invoked.public void setLastException(java.lang.Throwable lastException)
getLastException()
value for this helper. This will be
used to determine whether the request should be retried.public void setLastResponse(software.amazon.awssdk.http.SdkHttpResponse lastResponse)
Copyright © 2021. All Rights Reserved.