Class SimpleRetryHandler

  • All Implemented Interfaces:

    public class SimpleRetryHandler
    extends Object
    implements RetryHandler
    Handle retry attempts with the given checker and delay policy.
    • Constructor Detail

      • SimpleRetryHandler

        public SimpleRetryHandler​(RetryChecker retryChecker,
                                  DelayPolicy delayPolicy,
                                  int maxAttempts)
        retryChecker - the retry checker
        delayPolicy - the delay policy
        maxAttempts - the maximum number of allowed attempts
    • Method Detail

      • shouldRetry

        public Duration shouldRetry​(int attempts,
                                    CdpClientException exception)
        Description copied from interface: RetryHandler
        Returns the duration the caller need to wait before retrying or null if no retry should be attempted according to the retry policy.
        Specified by:
        shouldRetry in interface RetryHandler
        attempts - the number of attempts so far
        exception - the request exception
        the duration to wait for the next attempt or null if no retry should be attempted