@NotThreadSafe public class ExecutionContext extends Object
Modifier and Type | Field and Description |
---|---|
private com.amazonaws.retry.internal.AuthErrorRetryStrategy |
authErrorRetryStrategy
An internal retry strategy for auth errors.
|
private AmazonWebserviceClient |
awsClient |
private com.amazonaws.util.AWSRequestMetrics |
awsRequestMetrics |
private com.amazonaws.http.timers.client.ClientExecutionAbortTrackerTask |
clientExecutionTrackerTask |
private com.amazonaws.auth.AWSCredentialsProvider |
credentialsProvider
Optional credentials to enable the runtime layer to handle signing requests (and resigning on
retries).
|
private List<com.amazonaws.handlers.RequestHandler2> |
requestHandler2s |
private boolean |
retryCapacityConsumed |
Constructor and Description |
---|
ExecutionContext()
For testing purposes.
|
ExecutionContext(boolean isMetricEnabled)
For testing purposes.
|
ExecutionContext(List<com.amazonaws.handlers.RequestHandler2> requestHandler2s,
boolean isMetricEnabled,
AmazonWebserviceClient awsClient) |
Modifier and Type | Method and Description |
---|---|
com.amazonaws.retry.internal.AuthErrorRetryStrategy |
getAuthErrorRetryStrategy()
Returns the retry strategy for auth errors.
|
protected AmazonWebserviceClient |
getAwsClient() |
com.amazonaws.util.AWSRequestMetrics |
getAwsRequestMetrics() |
com.amazonaws.http.timers.client.ClientExecutionAbortTrackerTask |
getClientExecutionTrackerTask() |
com.amazonaws.auth.AWSCredentialsProvider |
getCredentialsProvider()
Returns the credentials provider used for fetching the credentials.
|
List<com.amazonaws.handlers.RequestHandler2> |
getRequestHandler2s() |
com.amazonaws.auth.Signer |
getSignerByURI(URI uri)
Returns the signer for the given uri.
|
void |
markRetryCapacityConsumed()
Marks that a retry during this request lifecycle has consumed retry capacity.
|
boolean |
retryCapacityConsumed()
Returns whether retry capacity was consumed during this request lifecycle.
|
void |
setAuthErrorRetryStrategy(com.amazonaws.retry.internal.AuthErrorRetryStrategy authErrorRetryStrategy)
Sets the optional auth error retry strategy for this request execution.
|
void |
setClientExecutionTrackerTask(com.amazonaws.http.timers.client.ClientExecutionAbortTrackerTask clientExecutionTrackerTask) |
void |
setCredentialsProvider(com.amazonaws.auth.AWSCredentialsProvider credentialsProvider)
Sets the credentials provider used for fetching the credentials.
|
void |
setSigner(com.amazonaws.auth.Signer signer)
There is in general no need to set the signer in the execution context, since the signer for
each request may differ depending on the URI of the request.
|
private final com.amazonaws.util.AWSRequestMetrics awsRequestMetrics
private final List<com.amazonaws.handlers.RequestHandler2> requestHandler2s
private final AmazonWebserviceClient awsClient
private boolean retryCapacityConsumed
private com.amazonaws.auth.AWSCredentialsProvider credentialsProvider
private com.amazonaws.retry.internal.AuthErrorRetryStrategy authErrorRetryStrategy
private com.amazonaws.http.timers.client.ClientExecutionAbortTrackerTask clientExecutionTrackerTask
public ExecutionContext(boolean isMetricEnabled)
public ExecutionContext()
public ExecutionContext(List<com.amazonaws.handlers.RequestHandler2> requestHandler2s, boolean isMetricEnabled, AmazonWebserviceClient awsClient)
public List<com.amazonaws.handlers.RequestHandler2> getRequestHandler2s()
public com.amazonaws.util.AWSRequestMetrics getAwsRequestMetrics()
protected AmazonWebserviceClient getAwsClient()
public void setSigner(com.amazonaws.auth.Signer signer)
public boolean retryCapacityConsumed()
public void markRetryCapacityConsumed()
public com.amazonaws.auth.Signer getSignerByURI(URI uri)
public void setCredentialsProvider(com.amazonaws.auth.AWSCredentialsProvider credentialsProvider)
credentialsProvider
- the credentials provider to fetch AWSCredentials
public com.amazonaws.auth.AWSCredentialsProvider getCredentialsProvider()
AWSCredentials
public com.amazonaws.retry.internal.AuthErrorRetryStrategy getAuthErrorRetryStrategy()
Note that this will be checked BEFORE the HTTP client consults the user-specified RetryPolicy. i.e. if the configured AuthErrorRetryStrategy says the request should be retried, the retry will be performed internally and the effect is transparent to the user's RetryPolicy.
public void setAuthErrorRetryStrategy(com.amazonaws.retry.internal.AuthErrorRetryStrategy authErrorRetryStrategy)
getAuthErrorRetryStrategy()
public com.amazonaws.http.timers.client.ClientExecutionAbortTrackerTask getClientExecutionTrackerTask()
public void setClientExecutionTrackerTask(com.amazonaws.http.timers.client.ClientExecutionAbortTrackerTask clientExecutionTrackerTask)