Class KiwiRetryerPredicates

java.lang.Object
org.kiwiproject.retry.KiwiRetryerPredicates

public final class KiwiRetryerPredicates extends Object
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 Details

    • UNKNOWN_HOST

      public static final Predicate<Exception> UNKNOWN_HOST
      Check if a given Exception is or has a root cause of UnknownHostException.
      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 given Exception is or has a root cause of ConnectException.
      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 given Exception is or has a root cause of SocketTimeoutException.
      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 given Exception is or contains a SSLHandshakeException somewhere in the causal chain.
    • NO_ROUTE_TO_HOST

      public static final Predicate<Exception> NO_ROUTE_TO_HOST
      Check if a given Exception is or has a root cause of NoRouteToHostException.
      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<jakarta.ws.rs.core.Response> IS_HTTP_400s
      Check if a given Jakarta REST Response is a client error (4xx).
    • IS_HTTP_500s

      public static final Predicate<jakarta.ws.rs.core.Response> IS_HTTP_500s
      Check if a given Jakarta REST Response is a server error (5xx).