public abstract class RetryPolicy extends Object
| Constructor and Description |
|---|
RetryPolicy() |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
checkRetries(int retries)
Check if we should retry given current number of retries.
|
static RetryPolicy |
createFixedRetryPolicy(int maxRetries,
long backOffPeriod)
Create a retry policy that retries a fixed number of times with a fixed interval.
|
static RetryPolicy |
createNoRetryPolicy()
Create a retry policy that never retries.
|
static RetryPolicy |
createSequenceRetryPolicy(long[] backOffPeriods)
Create a retry policy that retries with a provided set of back off periods.
|
public abstract boolean checkRetries(int retries)
retries - the current number of retries that have occurredpublic static RetryPolicy createNoRetryPolicy()
public static RetryPolicy createFixedRetryPolicy(int maxRetries, long backOffPeriod)
maxRetries - the maximum allowable number of retriesbackOffPeriod - the period to wait before retrying, in millisecondspublic static RetryPolicy createSequenceRetryPolicy(long[] backOffPeriods)
backOffPeriods - an array of times to wait between retries, in millisecondsCopyright 2014-Present by Jim Moores
${javadoc.footer.license}