public final class RetryStrategy extends Object
A retry strategy will be applied when an initial to attempt to open a session
fails with a SessionEstablishmentTransientException
.
A retry strategy will be applied when recovering by a
RecoverableUpdateStream
following a recoverable exception.
The strategy is defined in terms of the number of milliseconds between retries and the maximum number of retries to attempt.
Modifier and Type | Field and Description |
---|---|
static RetryStrategy |
NO_RETRY
The retry strategy that indicates that no retry is to be attempted.
|
Constructor and Description |
---|
RetryStrategy(long interval)
Creates a new retry strategy that will retry indefinitely at the
specified interval.
|
RetryStrategy(long interval,
int attempts)
Creates a new retry strategy object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
getAttempts()
Returns the number of retry attempts.
|
long |
getInterval()
Returns the time interval between attempts.
|
int |
hashCode() |
String |
toString() |
public static final RetryStrategy NO_RETRY
public RetryStrategy(long interval, int attempts)
interval
- the number of milliseconds before the first retry and
between subsequent retriesattempts
- the number of retry attemptspublic RetryStrategy(long interval)
interval
- the number of milliseconds before the first retry and
between subsequent retriesCopyright © 2024 DiffusionData Ltd. All Rights Reserved.