Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.http.impl.client
Class DefaultHttpRequestRetryHandler

    java.lang.Object
      org.apache.http.impl.client.DefaultHttpRequestRetryHandler

All Implemented Interfaces:
  HttpRequestRetryHandler

Direct Known Subclasses:
  StandardHttpRequestRetryHandler

    @Immutable
    public class DefaultHttpRequestRetryHandler

extends Object
implements HttpRequestRetryHandler

The default `HttpRequestRetryHandler` used by request executors.

Since:
  4.0

Constructor Summary
`DefaultHttpRequestRetryHandler()` Default constructor
`DefaultHttpRequestRetryHandler(int retryCount, boolean requestSentRetryEnabled)` Default constructor

Method Summary
`int` | `getRetryCount()`
`protected boolean` | `handleAsIdempotent(HttpRequest request)`
`boolean` | `isRequestSentRetryEnabled()`
`protected boolean` | `requestIsAborted(HttpRequest request)`
`boolean` | `retryRequest(IOException exception, int executionCount, HttpContext context)` Used `retryCount` and `requestSentRetryEnabled` to determine if the given method should be retried.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DefaultHttpRequestRetryHandler

    public DefaultHttpRequestRetryHandler(int retryCount,
                                          boolean requestSentRetryEnabled)

  Default constructor

### DefaultHttpRequestRetryHandler

    public DefaultHttpRequestRetryHandler()

  Default constructor

Method Detail

### retryRequest

    public boolean retryRequest(IOException exception,
                                int executionCount,
                                HttpContext context)

  Used `retryCount` and `requestSentRetryEnabled` to determine if the given method should be retried.

  Specified by:
    `retryRequest` in interface `HttpRequestRetryHandler`
  Parameters:
    `exception` - the exception that occurred
    `executionCount` - the number of times this method has been unsuccessfully executed
    `context` - the context for the request execution
  Returns:
    `true` if the method should be retried, `false` otherwise

### isRequestSentRetryEnabled

    public boolean isRequestSentRetryEnabled()

  Returns:
    `true` if this handler will retry methods that have successfully sent their request, `false` otherwise

### getRetryCount

    public int getRetryCount()

  Returns:
    the maximum number of times a method will be retried

### handleAsIdempotent

    protected boolean handleAsIdempotent(HttpRequest request)

  Since:
    4.2

### requestIsAborted

    protected boolean requestIsAborted(HttpRequest request)

  Since:
    4.2

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1999-2013 The Apache Software Foundation. All Rights Reserved.