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 Object
implements org.apache.http.client.ServiceUnavailableRetryStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ThreadLocal
<Long> 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 final int
private final long
private final long
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ResolverServiceUnavailableRetryStrategy
(int retryCount, long retryInterval, long retryIntervalMax, Set<Integer> serviceUnavailableHttpCodes) -
Method Summary
Modifier and TypeMethodDescriptionlong
private 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 Details
-
retryCount
private final int retryCount -
retryInterval
private final long retryInterval -
retryIntervalMax
private final long retryIntervalMax -
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).
-
-
Constructor Details
-
ResolverServiceUnavailableRetryStrategy
-
-
Method Details
-
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 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 returnsinvalid @link
{@link this#retryInterval
executionCount
(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
-