com.amazonaws.retry
Interface RetryPolicy.RetryCondition

All Known Implementing Classes:
PredefinedRetryPolicies.SDKDefaultRetryCondition
Enclosing class:
RetryPolicy

public static interface RetryPolicy.RetryCondition

The hook for providing custom condition on whether a failed request should be retried.


Method Summary
 boolean shouldRetry(AmazonWebServiceRequest originalRequest, AmazonClientException exception, int retriesAttempted)
          Returns whether a failed request should be retried according to the given request context.
 

Method Detail

shouldRetry

boolean shouldRetry(AmazonWebServiceRequest originalRequest,
                    AmazonClientException exception,
                    int retriesAttempted)
Returns whether a failed request should be retried according to the given request context. In the following circumstances, the request will fail directly without consulting this method:

Parameters:
originalRequest - The original request object being executed. For performance reason, this object is not a defensive copy, and caller should not attempt to modify its data.
exception - The exception from the failed request, represented as an AmazonClientException object. There are two types of exception that will be passed to this method:
  • AmazonServiceException (sub-class of AmazonClientException) indicating a service error
  • AmazonClientException caused by an IOException when executing the HTTP request.
Any other exceptions are regarded as unexpected failures and are thrown immediately without any retry. For performance reason, this object is not a defensive copy, and caller should not attempt to modify its data.
retriesAttempted - The number of times the current request has been attempted.
Returns:
True if the failed request should be retried.


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.