DefaultHttpMethodRetryHandler (HttpClient Library (Version 3.1))
Date: 2019-01-01

org.apache.commons.httpclient

## Class DefaultHttpMethodRetryHandler

- java.lang.Object
- - org.apache.commons.httpclient.DefaultHttpMethodRetryHandler

- All Implemented Interfaces:
    HttpMethodRetryHandler

      public class DefaultHttpMethodRetryHandler
      extends java.lang.Object
      implements HttpMethodRetryHandler

  The default `HttpMethodRetryHandler` used by `HttpMethod`s.
  Author:
    Michael Becke, Oleg Kalnichevski

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultHttpMethodRetryHandler()` Creates a new DefaultHttpMethodRetryHandler that retries up to 3 times but does not retry methods that have successfully sent their requests.
    `DefaultHttpMethodRetryHandler(int retryCount, boolean requestSentRetryEnabled)` Creates a new DefaultHttpMethodRetryHandler.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getRetryCount()`
    `boolean` | `isRequestSentRetryEnabled()`
    `boolean` | `retryMethod(HttpMethod method, java.io.IOException exception, int executionCount)` 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

    - #### DefaultHttpMethodRetryHandler

          public DefaultHttpMethodRetryHandler(int retryCount,
                                               boolean requestSentRetryEnabled)

      Creates a new DefaultHttpMethodRetryHandler.
      Parameters:
        `retryCount` - the number of times a method will be retried
        `requestSentRetryEnabled` - if true, methods that have successfully sent their request will be retried

    - #### DefaultHttpMethodRetryHandler

          public DefaultHttpMethodRetryHandler()

      Creates a new DefaultHttpMethodRetryHandler that retries up to 3 times but does not retry methods that have successfully sent their requests.

  - ### Method Detail

    - #### retryMethod

          public boolean retryMethod(HttpMethod method,
                                     java.io.IOException exception,
                                     int executionCount)

      Used `retryCount` and `requestSentRetryEnabled` to determine if the given method should be retried.
      Specified by:
        `retryMethod` in interface `HttpMethodRetryHandler`
      Parameters:
        `method` - the method being executed
        `exception` - the exception that occurred
        `executionCount` - the number of times this method has been unsuccessfully executed
      Returns:
        `true` if the method should be retried, `false` otherwise
      See Also:
        `HttpMethodRetryHandler.retryMethod(HttpMethod, IOException, int)`

    - #### 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

Copyright (c) 1999-2005 - Apache Software Foundation