Class RetryRuleWithContentBuilder<T extends Response>
java.lang.Object
com.linecorp.armeria.client.retry.RetryRuleWithContentBuilder<T>
public final class RetryRuleWithContentBuilder<T extends Response> extends Object
A builder which creates a
RetryRuleWithContent
.-
Method Summary
Modifier and Type Method Description RetryRuleWithContentBuilder<T>
onException()
RetryRuleWithContentBuilder<T>
onException(Class<? extends Throwable> exception)
RetryRuleWithContentBuilder<T>
onException(Predicate<? super Throwable> exceptionFilter)
RetryRuleWithContentBuilder<T>
onResponse(Function<? super T,? extends CompletionStage<Boolean>> retryFunction)
Adds the specifiedretryFunction
for aRetryRuleWithContent
which will retry if the specifiedretryFunction
completes withtrue
.RetryRuleWithContentBuilder<T>
onResponseHeaders(Predicate<? super ResponseHeaders> responseHeadersFilter)
Adds the specifiedresponseHeadersFilter
for aRetryRule
which will retry if theresponseHeadersFilter
returnstrue
.RetryRuleWithContentBuilder<T>
onServerErrorStatus()
Adds theHttpStatusClass.SERVER_ERROR
for aRetryRule
which will retry if the class of the response status isHttpStatusClass.SERVER_ERROR
.RetryRuleWithContentBuilder<T>
onStatus(HttpStatus... statuses)
Adds the specifiedHttpStatus
es for aRetryRule
which will retry if the response status is one of the specifiedHttpStatus
es.RetryRuleWithContentBuilder<T>
onStatus(Iterable<HttpStatus> statuses)
Adds the specifiedHttpStatus
es for aRetryRule
which will retry if the response status is one of the specifiedHttpStatus
es.RetryRuleWithContentBuilder<T>
onStatus(Predicate<? super HttpStatus> statusFilter)
Adds the specifiedstatusFilter
for aRetryRule
which will retry if the response status matches the specifiedstatusFilter
.RetryRuleWithContentBuilder<T>
onStatusClass(HttpStatusClass... statusClasses)
Adds the specifiedHttpStatusClass
es for aRetryRule
which will retry if the class of the response status is one of the specifiedHttpStatusClass
es.RetryRuleWithContentBuilder<T>
onStatusClass(Iterable<HttpStatusClass> statusClasses)
Adds the specifiedHttpStatusClass
es for aRetryRule
which will retry if the class of the response status is one of the specifiedHttpStatusClass
es.RetryRuleWithContentBuilder<T>
onUnprocessed()
Makes aRetryRule
retry on anUnprocessedRequestException
which means that the request has not been processed by the server.RetryRuleWithContent<T>
thenBackoff()
Sets the default backoff and returns a newly createdRetryRuleWithContent
.RetryRuleWithContent<T>
thenBackoff(Backoff backoff)
Sets the specifiedBackoff
and returns a newly createdRetryRuleWithContent
.RetryRuleWithContent<T>
thenNoRetry()
Returns a newly createdRetryRuleWithContent
that never retries.String
toString()
-
Method Details
-
onResponse
public RetryRuleWithContentBuilder<T> onResponse(Function<? super T,? extends CompletionStage<Boolean>> retryFunction)Adds the specifiedretryFunction
for aRetryRuleWithContent
which will retry if the specifiedretryFunction
completes withtrue
. -
thenBackoff
Sets the default backoff and returns a newly createdRetryRuleWithContent
. -
thenBackoff
Sets the specifiedBackoff
and returns a newly createdRetryRuleWithContent
. -
thenNoRetry
Returns a newly createdRetryRuleWithContent
that never retries. -
toString
-
onResponseHeaders
public RetryRuleWithContentBuilder<T> onResponseHeaders(Predicate<? super ResponseHeaders> responseHeadersFilter)Adds the specifiedresponseHeadersFilter
for aRetryRule
which will retry if theresponseHeadersFilter
returnstrue
. -
onStatusClass
Adds the specifiedHttpStatusClass
es for aRetryRule
which will retry if the class of the response status is one of the specifiedHttpStatusClass
es. -
onStatusClass
Adds the specifiedHttpStatusClass
es for aRetryRule
which will retry if the class of the response status is one of the specifiedHttpStatusClass
es. -
onServerErrorStatus
Adds theHttpStatusClass.SERVER_ERROR
for aRetryRule
which will retry if the class of the response status isHttpStatusClass.SERVER_ERROR
. -
onStatus
Adds the specifiedHttpStatus
es for aRetryRule
which will retry if the response status is one of the specifiedHttpStatus
es. -
onStatus
Adds the specifiedHttpStatus
es for aRetryRule
which will retry if the response status is one of the specifiedHttpStatus
es. -
onStatus
Adds the specifiedstatusFilter
for aRetryRule
which will retry if the response status matches the specifiedstatusFilter
. -
onException
-
onException
-
onException
-
onUnprocessed
Makes aRetryRule
retry on anUnprocessedRequestException
which means that the request has not been processed by the server. Therefore, you can safely retry the request without worrying about the idempotency of the request.
-