public class OperationTimedPollAlgorithm extends ExponentialRetryAlgorithm
Operation timed polling algorithm, which uses exponential backoff factor for determining when the next polling operation should be executed. If the polling exceeds the total timeout this algorithm cancels polling.
Static Methods
create(RetrySettings globalSettings)
public static OperationTimedPollAlgorithm create(RetrySettings globalSettings)
Creates the polling algorithm, using the default NanoClock
for time computations.
Parameter | |
---|---|
Name | Description |
globalSettings | RetrySettings the settings |
Returns | |
---|---|
Type | Description |
OperationTimedPollAlgorithm | timed poll algorithm |
create(RetrySettings globalSettings, ApiClock clock)
public static OperationTimedPollAlgorithm create(RetrySettings globalSettings, ApiClock clock)
Parameters | |
---|---|
Name | Description |
globalSettings | RetrySettings |
clock | ApiClock |
Returns | |
---|---|
Type | Description |
OperationTimedPollAlgorithm |
Methods
shouldRetry(TimedAttemptSettings nextAttemptSettings)
public boolean shouldRetry(TimedAttemptSettings nextAttemptSettings)
Returns true
if another poll operation should be made or throws CancellationException otherwise.
Parameter | |
---|---|
Name | Description |
nextAttemptSettings | TimedAttemptSettings attempt settings, which will be used for the next attempt, if accepted |
Returns | |
---|---|
Type | Description |
boolean |
|
Exceptions | |
---|---|
Type | Description |
CancellationException | if no more attempts should be made |