Class ExecutionContext


  • public class ExecutionContext
    extends Object
    a single request lifecycle.
    • Constructor Detail

      • ExecutionContext

        public ExecutionContext​(boolean isMetricEnabled)
        For testing purposes.
      • ExecutionContext

        public ExecutionContext()
        For testing purposes.
    • Method Detail

      • setSigner

        public void setSigner​(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. 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

        public Signer getSignerByURI​(URI uri)
        Returns the signer for the given uri. Note S3 in particular overrides this method.
      • setCredentialsProvider

        public void setCredentialsProvider​(AWSCredentialsProvider credentialsProvider)
        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 fetch AWSCredentials
      • getCredentialsProvider

        public AWSCredentialsProvider 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:
        getAuthErrorRetryStrategy()