- All Known Implementing Classes:
public interface RetryPolicy
Abstracts the policy to use when retrying connections
boolean allowRetry(int retryCount, long elapsedTimeMs, RetrySleeper sleeper)Called when an operation has failed for some reason. This method should return true to make another attempt.
retryCount- the number of times retried so far (0 the first time)
elapsedTimeMs- the elapsed time in ms since the operation was attempted
sleeper- use this to sleep - DO NOT call Thread.sleep
default boolean allowRetry(java.lang.Throwable exception)Called when an operation has failed with a specific exception. This method should return true to make another attempt.
exception- the cause that this operation failed