Class HttpTransporter.ResolverServiceUnavailableRetryStrategy
- java.lang.Object
-
- org.eclipse.aether.transport.http.HttpTransporter.ResolverServiceUnavailableRetryStrategy
-
- All Implemented Interfaces:
org.apache.http.client.ServiceUnavailableRetryStrategy
- Enclosing class:
- HttpTransporter
private static class HttpTransporter.ResolverServiceUnavailableRetryStrategy extends java.lang.Object implements org.apache.http.client.ServiceUnavailableRetryStrategy
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.ThreadLocal<java.lang.Long>
RETRY_INTERVAL_HOLDER
Ugly, but forced by HttpClient APIServiceUnavailableRetryStrategy
: the calls forretryRequest(HttpResponse, int, HttpContext)
andgetRetryInterval()
are done by same thread and are actually done from spot that are very close to each other (almost subsequent calls).private int
retryCount
private long
retryInterval
private long
retryIntervalMax
private java.util.Set<java.lang.Integer>
serviceUnavailableHttpCodes
-
Constructor Summary
Constructors Modifier Constructor Description private
ResolverServiceUnavailableRetryStrategy(int retryCount, long retryInterval, long retryIntervalMax, java.util.Set<java.lang.Integer> serviceUnavailableHttpCodes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getRetryInterval()
private java.lang.Long
retryInterval(org.apache.http.HttpResponse httpResponse, int executionCount, org.apache.http.protocol.HttpContext httpContext)
Calculates retry interval in milliseconds.boolean
retryRequest(org.apache.http.HttpResponse response, int executionCount, org.apache.http.protocol.HttpContext context)
-
-
-
Field Detail
-
retryCount
private final int retryCount
-
retryInterval
private final long retryInterval
-
retryIntervalMax
private final long retryIntervalMax
-
serviceUnavailableHttpCodes
private final java.util.Set<java.lang.Integer> serviceUnavailableHttpCodes
-
RETRY_INTERVAL_HOLDER
private static final java.lang.ThreadLocal<java.lang.Long> RETRY_INTERVAL_HOLDER
Ugly, but forced by HttpClient APIServiceUnavailableRetryStrategy
: the calls forretryRequest(HttpResponse, int, HttpContext)
andgetRetryInterval()
are done by same thread and are actually done from spot that are very close to each other (almost subsequent calls).
-
-
Method Detail
-
retryRequest
public boolean retryRequest(org.apache.http.HttpResponse response, int executionCount, org.apache.http.protocol.HttpContext context)
- Specified by:
retryRequest
in interfaceorg.apache.http.client.ServiceUnavailableRetryStrategy
-
retryInterval
private java.lang.Long retryInterval(org.apache.http.HttpResponse httpResponse, int executionCount, org.apache.http.protocol.HttpContext httpContext)
Calculates retry interval in milliseconds. IfHttpHeaders.RETRY_AFTER
header present, it obeys it. Otherwise, it returns {@link this#retryInterval} long value multiplied withexecutionCount
(starts from 1 and goes 2, 3,...).- Returns:
- Long representing the retry interval as millis, or
null
if the request should be failed.
-
getRetryInterval
public long getRetryInterval()
- Specified by:
getRetryInterval
in interfaceorg.apache.http.client.ServiceUnavailableRetryStrategy
-
-