Class TarantoolRequestRetryPolicies.AttemptsBoundRetryPolicyFactory<T extends Predicate<Throwable>>

    • Constructor Detail

      • AttemptsBoundRetryPolicyFactory

        public AttemptsBoundRetryPolicyFactory​(int numberOfAttempts,
                                               long requestTimeout,
                                               long delay,
                                               T exceptionCheck)
        Basic constructor with timeout and delay
        Parameters:
        numberOfAttempts - maximum number of retry attempts
        requestTimeout - timeout for one retry attempt, in milliseconds
        delay - delay between retry attempts, in milliseconds
        exceptionCheck - predicate checking whether the given exception may be retried
    • Method Detail

      • create

        public RequestRetryPolicy create()
        Description copied from interface: RequestRetryPolicyFactory
        Instantiate a new request retry policy instance. The policy may be either stateful or stateless, so depending on that the policy may be either instantiated as a singleton or once per request.
        Specified by:
        create in interface RequestRetryPolicyFactory
        Returns:
        new policy instance
      • getNumberOfAttempts

        public int getNumberOfAttempts()
        Getter for number of attempts
        Returns:
        number of attempts
      • getExceptionCheck

        public T getExceptionCheck()
        Getter for exception handler
        Returns:
        exception handler
      • getDelay

        public long getDelay()
        Getter for delay
        Returns:
        delay in milliseconds
      • getRequestTimeout

        public long getRequestTimeout()
        Getter for request timeout
        Returns:
        request timeout in milliseconds