Class RetryOnStatusCodeCondition

  • All Implemented Interfaces:
    RetryCondition

    public final class RetryOnStatusCodeCondition
    extends Object
    implements RetryCondition
    Retry condition implementation that retries if the HTTP status code matches one of the provided status codes.
    • Method Detail

      • shouldRetry

        public boolean shouldRetry​(RetryPolicyContext context)
        Description copied from interface: RetryCondition
        Determine whether a request should or should not be retried.
        Specified by:
        shouldRetry in interface RetryCondition
        Parameters:
        context - Context about the state of the last request and information about the number of requests made.
        Returns:
        True if the HTTP status code matches one of the provided status codes. False if it doesn't match or the request failed for reasons other than an exceptional HTTP response (i.e. IOException).
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object