org.apache.http.impl.client
Class DefaultBackoffStrategy
java.lang.Object
   org.apache.http.impl.client.DefaultBackoffStrategy
org.apache.http.impl.client.DefaultBackoffStrategy
- All Implemented Interfaces: 
- ConnectionBackoffStrategy
- public class DefaultBackoffStrategy 
- extends Object- implements ConnectionBackoffStrategy
This ConnectionBackoffStrategy backs off either for a raw
 network socket or connection timeout or if the server explicitly
 sends a 503 (Service Unavailable) response.
- Since:
- 4.2
 
| Method Summary | 
|  boolean | shouldBackoff(org.apache.http.HttpResponse resp)Determines whether receiving the given
 HttpResponseas
 a result of request execution should result in a backoff
 signal. | 
|  boolean | shouldBackoff(Throwable t)Determines whether seeing the given
 Throwableas
 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 | 
 
DefaultBackoffStrategy
public DefaultBackoffStrategy()
shouldBackoff
public boolean shouldBackoff(Throwable t)
- Description copied from interface: ConnectionBackoffStrategy
- Determines whether seeing the given Throwableas
 a result of request execution should result in a backoff
 signal.
 
- 
- Specified by:
- shouldBackoffin interface- ConnectionBackoffStrategy
 
- 
- Parameters:
- t- the- Throwablethat happened
- Returns:
- trueif a backoff signal should be
   given
 
shouldBackoff
public boolean shouldBackoff(org.apache.http.HttpResponse resp)
- Description copied from interface: ConnectionBackoffStrategy
- Determines whether receiving the given HttpResponseas
 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:
- shouldBackoffin interface- ConnectionBackoffStrategy
 
- 
- Parameters:
- resp- the- HttpResponsethat was received
- Returns:
- trueif a backoff signal should be
   given
 
Copyright © 1999–2020 The Apache Software Foundation. All rights reserved.