Package com.fauna.client
Class ExponentialBackoffStrategy
- java.lang.Object
-
- com.fauna.client.ExponentialBackoffStrategy
-
- All Implemented Interfaces:
RetryStrategy
public class ExponentialBackoffStrategy extends java.lang.Object implements RetryStrategy
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExponentialBackoffStrategy.Builder
Build a new ExponentialBackoffStrategy.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExponentialBackoffStrategy.Builder
builder()
boolean
canRetry(int retryAttempt)
Returns true if the given retry attempt will be allowed by this strategy.int
getDelayMillis(int retryAttempt)
Return the number of milliseconds to delay the next attempt.int
getMaxRetryAttempts()
-
-
-
Method Detail
-
canRetry
public boolean canRetry(int retryAttempt)
Description copied from interface:RetryStrategy
Returns true if the given retry attempt will be allowed by this strategy.- Specified by:
canRetry
in interfaceRetryStrategy
- Parameters:
retryAttempt
- The retry attempt number, starting at 1 (i.e. the second overall attempt, or first retry is attempt 1).- Returns:
- True if this attempt can be retried, otherwise false.
-
getDelayMillis
public int getDelayMillis(int retryAttempt)
Description copied from interface:RetryStrategy
Return the number of milliseconds to delay the next attempt.- Specified by:
getDelayMillis
in interfaceRetryStrategy
- Parameters:
retryAttempt
- The retry attempt number, starting at 1 (i.e. the second overall attempt, or first retry is attempt 1).- Returns:
-
getMaxRetryAttempts
public int getMaxRetryAttempts()
- Specified by:
getMaxRetryAttempts
in interfaceRetryStrategy
-
builder
public static ExponentialBackoffStrategy.Builder builder()
-
-