Package org.kiwiproject.retry
Class KiwiRetryerPredicates
- java.lang.Object
-
- org.kiwiproject.retry.KiwiRetryerPredicates
-
public class KiwiRetryerPredicates extends Object
Some potentially useful predicates that can be used out of the box withKiwiRetryeror directly withRetryerBuilder, or anything else that accepts aPredicate.Note that the Jakarta RS-API needs to be available at runtime to use the
Responsepredicates.
-
-
Field Summary
Fields Modifier and Type Field Description static Predicate<Exception>CONNECTION_ERRORCheck if a givenExceptionis or has a root cause ofConnectException.static Predicate<javax.ws.rs.core.Response>IS_HTTP_400sCheck if a given JAX-RSResponseis a client error (4xx).static Predicate<javax.ws.rs.core.Response>IS_HTTP_500sCheck if a given JAX-RSResponseis a server error (5xx).static Predicate<Exception>NO_ROUTE_TO_HOSTCheck if a givenExceptionis or has a root cause ofNoRouteToHostException.static Predicate<Exception>SOCKET_TIMEOUTCheck if a givenExceptionis or has a root cause ofSocketTimeoutException.static Predicate<Exception>SSL_HANDSHAKE_ERRORCheck if a givenExceptionis or contains aSSLHandshakeExceptionsomewhere in the causal chain.static Predicate<Exception>UNKNOWN_HOSTCheck if a givenExceptionis or has a root cause ofUnknownHostException.
-
Constructor Summary
Constructors Constructor Description KiwiRetryerPredicates()
-
-
-
Field Detail
-
UNKNOWN_HOST
public static final Predicate<Exception> 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
public static final Predicate<Exception> 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
public static final Predicate<Exception> 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
public static final Predicate<Exception> SSL_HANDSHAKE_ERROR
Check if a givenExceptionis or contains aSSLHandshakeExceptionsomewhere in the causal chain.
-
NO_ROUTE_TO_HOST
public static final Predicate<Exception> 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
public static final Predicate<javax.ws.rs.core.Response> IS_HTTP_400s
Check if a given JAX-RSResponseis a client error (4xx).
-
IS_HTTP_500s
public static final Predicate<javax.ws.rs.core.Response> IS_HTTP_500s
Check if a given JAX-RSResponseis a server error (5xx).
-
-