Package org.apache.http.impl.client
Class DefaultServiceUnavailableRetryStrategy
- java.lang.Object
-
- org.apache.http.impl.client.DefaultServiceUnavailableRetryStrategy
-
- All Implemented Interfaces:
ServiceUnavailableRetryStrategy
@Contract(threading=IMMUTABLE) public class DefaultServiceUnavailableRetryStrategy extends java.lang.Object implements ServiceUnavailableRetryStrategy
Default implementation of theServiceUnavailableRetryStrategy
interface. that retries503
(Service Unavailable) responses for a fixed number of times at a fixed interval.- Since:
- 4.2
-
-
Constructor Summary
Constructors Constructor Description DefaultServiceUnavailableRetryStrategy()
DefaultServiceUnavailableRetryStrategy(int maxRetries, int retryInterval)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getRetryInterval()
boolean
retryRequest(HttpResponse response, int executionCount, HttpContext context)
Determines if a method should be retried given the response from the target server.
-
-
-
Method Detail
-
retryRequest
public boolean retryRequest(HttpResponse response, int executionCount, HttpContext context)
Description copied from interface:ServiceUnavailableRetryStrategy
Determines if a method should be retried given the response from the target server.- Specified by:
retryRequest
in interfaceServiceUnavailableRetryStrategy
- Parameters:
response
- the response from the target serverexecutionCount
- the number of times this method has been unsuccessfully executedcontext
- the context for the request execution- Returns:
true
if the method should be retried,false
otherwise
-
getRetryInterval
public long getRetryInterval()
- Specified by:
getRetryInterval
in interfaceServiceUnavailableRetryStrategy
- Returns:
- The interval between the subsequent auto-retries.
-
-