Package org.kiwiproject.retry
Class KiwiRetryerPredicates
java.lang.Object
org.kiwiproject.retry.KiwiRetryerPredicates
Some potentially useful predicates that can be used out of the box with
KiwiRetryer or directly with
RetryerBuilder, or anything else that accepts a Predicate.
Note that the Jakarta RS-API needs to be available at runtime to use the Response predicates.
-
Field Summary
FieldsModifier and TypeFieldDescriptionCheck if a givenExceptionis or has a root cause ofConnectException.static final Predicate<jakarta.ws.rs.core.Response>Check if a given Jakarta RESTResponseis a client error (4xx).static final Predicate<jakarta.ws.rs.core.Response>Check if a given Jakarta RESTResponseis a server error (5xx).Check if a givenExceptionis or has a root cause ofNoRouteToHostException.Check if a givenExceptionis or has a root cause ofSocketTimeoutException.Check if a givenExceptionis or contains aSSLHandshakeExceptionsomewhere in the causal chain.Check if a givenExceptionis or has a root cause ofUnknownHostException. -
Method Summary
-
Field Details
-
UNKNOWN_HOST
Check if a givenExceptionis or has a root cause ofUnknownHostException.- Implementation Note:
- UnknownHostException does not have a cause, which is why we check only the instance and root cause
-
CONNECTION_ERROR
Check if a givenExceptionis or has a root cause ofConnectException.- Implementation Note:
- ConnectException does not have a cause, which is why we check only the instance and root cause
-
SOCKET_TIMEOUT
Check if a givenExceptionis or has a root cause ofSocketTimeoutException.- Implementation Note:
- SocketTimeoutException does not have a cause, which is why we check only the instance and root cause
-
SSL_HANDSHAKE_ERROR
Check if a givenExceptionis or contains aSSLHandshakeExceptionsomewhere in the causal chain. -
NO_ROUTE_TO_HOST
Check if a givenExceptionis or has a root cause ofNoRouteToHostException.- Implementation Note:
- NoRouteToHostException does not have a cause, which is why we check only the instance and root cause
-
IS_HTTP_400s
Check if a given Jakarta RESTResponseis a client error (4xx). -
IS_HTTP_500s
Check if a given Jakarta RESTResponseis a server error (5xx).
-