RetryInterceptor.Builder |
RetryInterceptor.Builder.backoff(RetryInterceptor.BackoffStrategy backoffStrategy) |
Specifies the BackoffStrategy to apply every retry.
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.beginWith(java.util.function.Function<java.net.http.HttpRequest,java.net.http.HttpRequest> requestModifier) |
Specifies the request modifier to be applied before the request is sent for the first time
(attempt 0, not a retry).
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.listener(RetryInterceptor.Listener listener) |
Sets the listener for retry events.
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.maxRetries(int maxRetries) |
Specifies the maximum times the interceptor is allowed to retry the request.
|
static RetryInterceptor.Builder |
RetryInterceptor.newBuilder() |
Returns a new builder of RetryInterceptor instances.
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.on(java.util.function.Predicate<RetryInterceptor.Context<?>> predicate) |
Specifies that the interceptor is to retry the request if the retry RetryInterceptor.Context satisfies
the given predicate.
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.on(java.util.function.Predicate<RetryInterceptor.Context<?>> predicate,
java.util.function.Function<RetryInterceptor.Context<?>,java.net.http.HttpRequest> requestModifier) |
Specifies that the interceptor is to retry the request, after applying the given request
modifier, if the retry RetryInterceptor.Context satisfies the given predicate.
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.onException(java.lang.Class<? extends java.lang.Throwable>... exceptionTypes) |
Specifies that the interceptor is to retry the request if an exception with any of the given
types is thrown.
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.onException(java.util.function.Predicate<java.lang.Throwable> exceptionPredicate) |
Specifies that the interceptor is to retry the request if an exception that satisfies the
given predicate is thrown.
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.onException(java.util.function.Predicate<java.lang.Throwable> exceptionPredicate,
java.util.function.Function<RetryInterceptor.Context<?>,java.net.http.HttpRequest> requestModifier) |
Specifies that the interceptor is to retry the request, after applying the given request
modifier, if an exception that satisfies the given predicate is thrown.
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.onException(java.util.Set<java.lang.Class<? extends java.lang.Throwable>> exceptionTypes,
java.util.function.Function<RetryInterceptor.Context<?>,java.net.http.HttpRequest> requestModifier) |
Specifies that the interceptor is to retry the request, after applying the given request
modifier, if an exception with any of the given types is thrown.
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.onResponse(java.util.function.Predicate<java.net.http.HttpResponse<?>> responsePredicate) |
Specifies that the interceptor is to retry the request if a response that satisfies the given
predicate is received.
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.onResponse(java.util.function.Predicate<java.net.http.HttpResponse<?>> responsePredicate,
java.util.function.Function<RetryInterceptor.Context<?>,java.net.http.HttpRequest> requestModifier) |
Specifies that the interceptor is to retry the request, after applying the given request
modifier, if a response that satisfies the given predicate is received.
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.onStatus(int... codes) |
Specifies that the interceptor is to retry the request if a response with any of the given
status codes is received.
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.onStatus(java.util.function.Predicate<java.lang.Integer> statusPredicate) |
Specifies that the interceptor is to retry the request if a response whose code satisfies the
given predicate is received.
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.onStatus(java.util.function.Predicate<java.lang.Integer> statusPredicate,
java.util.function.Function<RetryInterceptor.Context<?>,java.net.http.HttpRequest> requestModifier) |
Specifies that the interceptor is to retry the request, after applying the given request
modifier, if a response whose code satisfies the given predicate is received.
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.onStatus(java.util.Set<java.lang.Integer> codes,
java.util.function.Function<RetryInterceptor.Context<?>,java.net.http.HttpRequest> requestModifier) |
Specifies that the interceptor is to retry the request, after applying the given request
modifier, if a response with any of the given status codes is received.
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.retryNonIdempotent() |
Specifies that requests that are not idempotent are to be
retried.
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.throwOnExhaustion() |
Specifies that the interceptor is to throw an HttpRetriesExhaustedException if the
maximum number of retries is exceeded, with the last-thrown exception (if any) added as a
suppressed exception.
|
RetryInterceptor.Builder |
RetryInterceptor.Builder.timeout(java.time.Duration timeout) |
Sets a timeout for the entire retry process.
|