Package org.jclouds.aws.handlers
Class AWSServerErrorRetryHandler
- java.lang.Object
-
- org.jclouds.http.handlers.BackoffLimitedRetryHandler
-
- org.jclouds.aws.handlers.AWSServerErrorRetryHandler
-
- All Implemented Interfaces:
HttpRetryHandler
,IOExceptionRetryHandler
public class AWSServerErrorRetryHandler extends BackoffLimitedRetryHandler
Handles Retryable responses with error codes in the 5xx range
-
-
Field Summary
-
Fields inherited from class org.jclouds.http.handlers.BackoffLimitedRetryHandler
INSTANCE, logger
-
Fields inherited from interface org.jclouds.http.HttpRetryHandler
ALWAYS_RETRY, NEVER_RETRY
-
Fields inherited from interface org.jclouds.http.IOExceptionRetryHandler
ALWAYS_RETRY, NEVER_RETRY
-
-
Constructor Summary
Constructors Constructor Description AWSServerErrorRetryHandler(AWSUtils utils, Set<String> retryableServerCodes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
imposeBackoffExponentialDelay(long period, int pow, int failureCount, int max, String commandDescription)
boolean
shouldRetryRequest(HttpCommand command, HttpResponse response)
Return true if the command should be retried.protected boolean
shouldRetryRequestOnError(HttpCommand command, HttpResponse response, AWSError error)
-
Methods inherited from class org.jclouds.http.handlers.BackoffLimitedRetryHandler
imposeBackoffExponentialDelay, imposeBackoffExponentialDelay, shouldRetryRequest
-
-
-
-
Method Detail
-
shouldRetryRequest
public boolean shouldRetryRequest(HttpCommand command, HttpResponse response)
Description copied from interface:HttpRetryHandler
Return true if the command should be retried. This method should only be invoked when the response has failed with a HTTP 5xx error indicating a server-side error.- Specified by:
shouldRetryRequest
in interfaceHttpRetryHandler
- Overrides:
shouldRetryRequest
in classBackoffLimitedRetryHandler
-
shouldRetryRequestOnError
protected boolean shouldRetryRequestOnError(HttpCommand command, HttpResponse response, AWSError error)
-
imposeBackoffExponentialDelay
public void imposeBackoffExponentialDelay(long period, int pow, int failureCount, int max, String commandDescription)
- Overrides:
imposeBackoffExponentialDelay
in classBackoffLimitedRetryHandler
-
-