org.apache.hc.client5.http.impl.classic

## Class NullBackoffStrategy

- java.lang.Object
- - org.apache.hc.client5.http.impl.classic.NullBackoffStrategy

- All Implemented Interfaces:
    ConnectionBackoffStrategy

      public class NullBackoffStrategy
      extends Object
      implements ConnectionBackoffStrategy

  This is a `ConnectionBackoffStrategy` that never backs off, for compatibility with existing behavior.
  Since:
    4.2

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NullBackoffStrategy()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `shouldBackoff(org.apache.hc.core5.http.HttpResponse response)` Determines whether receiving the given `HttpResponse` as a result of request execution should result in a backoff signal.
    `boolean` | `shouldBackoff(Throwable t)` Determines whether seeing the given `Throwable` as a result of request execution should result in a backoff signal.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NullBackoffStrategy

          public NullBackoffStrategy()

  - ### Method Detail

    - #### shouldBackoff

          public boolean shouldBackoff(Throwable t)

      Description copied from interface: `ConnectionBackoffStrategy`
      Determines whether seeing the given `Throwable` as a result of request execution should result in a backoff signal.
      Specified by:
        `shouldBackoff` in interface `ConnectionBackoffStrategy`
      Parameters:
        `t` - the `Throwable` that happened
      Returns:
        `true` if a backoff signal should be given

    - #### shouldBackoff

          public boolean shouldBackoff(org.apache.hc.core5.http.HttpResponse response)

      Description copied from interface: `ConnectionBackoffStrategy`
      Determines whether receiving the given `HttpResponse` as a result of request execution should result in a backoff signal. Implementations MUST restrict themselves to examining the response header and MUST NOT consume any of the response body, if any.
      Specified by:
        `shouldBackoff` in interface `ConnectionBackoffStrategy`
      Parameters:
        `response` - the `HttpResponse` that was received
      Returns:
        `true` if a backoff signal should be given

Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.