Package com.amazonaws.http
Class ExecutionContext
java.lang.Object
com.amazonaws.http.ExecutionContext
a single request lifecycle.
-
Constructor Summary
ConstructorsConstructorDescriptionFor testing purposes.ExecutionContext
(boolean isMetricEnabled) For testing purposes.ExecutionContext
(List<RequestHandler2> requestHandler2s, boolean isMetricEnabled, AmazonWebServiceClient awsClient) -
Method Summary
Modifier and TypeMethodDescriptioncom.amazonaws.retry.internal.AuthErrorRetryStrategy
Returns the retry strategy for auth errors.protected AmazonWebServiceClient
Returns the credentials provider used for fetching the credentials.getSignerByURI
(URI uri) Returns the signer for the given uri.void
Marks that a retry during this request lifecycle has consumed retry capacity.boolean
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
(ClientExecutionAbortTrackerTask clientExecutionTrackerTask) void
setCredentialsProvider
(AWSCredentialsProvider credentialsProvider) Sets the credentials provider used for fetching the credentials.void
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.
-
Constructor Details
-
ExecutionContext
public ExecutionContext(boolean isMetricEnabled) For testing purposes. -
ExecutionContext
public ExecutionContext()For testing purposes. -
ExecutionContext
public ExecutionContext(List<RequestHandler2> requestHandler2s, boolean isMetricEnabled, AmazonWebServiceClient awsClient)
-
-
Method Details
-
getRequestHandler2s
-
getAwsRequestMetrics
-
getAwsClient
-
setSigner
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. The exception is S3 where the signer is currently determined only when the S3 client is constructed. Hence the need for this method. We may consider supporting a per request level signer determination for S3 later on. -
retryCapacityConsumed
public boolean retryCapacityConsumed()Returns whether retry capacity was consumed during this request lifecycle. This can be inspected to determine whether capacity should be released if a retry succeeds.- Returns:
- true if retry capacity was consumed
-
markRetryCapacityConsumed
public void markRetryCapacityConsumed()Marks that a retry during this request lifecycle has consumed retry capacity. This is inspected when determining if capacity should be released if a retry succeeds. -
getSignerByURI
Returns the signer for the given uri. Note S3 in particular overrides this method. -
setCredentialsProvider
Sets the credentials provider used for fetching the credentials. The credentials fetched is used for signing the request. If there is no credential provider, then the runtime will not attempt to sign (or resign on retries) requests.- Parameters:
credentialsProvider
- the credentials provider to fetchAWSCredentials
-
getCredentialsProvider
Returns the credentials provider used for fetching the credentials. The credentials fetched is used for signing the request. If there is no credential provider, then the runtime will not attempt to sign (or resign on retries) requests.- Returns:
- the credentials provider to fetch
AWSCredentials
-
getAuthErrorRetryStrategy
public com.amazonaws.retry.internal.AuthErrorRetryStrategy getAuthErrorRetryStrategy()Returns the retry strategy for auth errors. This is currently only used by the S3 client for auto-resolving sigv4-required regions.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.
-
setAuthErrorRetryStrategy
public void setAuthErrorRetryStrategy(com.amazonaws.retry.internal.AuthErrorRetryStrategy authErrorRetryStrategy) Sets the optional auth error retry strategy for this request execution.- See Also:
-
getClientExecutionTrackerTask
-
setClientExecutionTrackerTask
public void setClientExecutionTrackerTask(ClientExecutionAbortTrackerTask clientExecutionTrackerTask)
-