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.
Name | Description |
globalSettings | RetrySettings the settings |
Type | Description |
OperationTimedPollAlgorithm | timed poll algorithm |
create(RetrySettings globalSettings, ApiClock clock)
public static OperationTimedPollAlgorithm create(RetrySettings globalSettings, ApiClock clock)
Name | Description |
globalSettings | RetrySettings |
clock | ApiClock |
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.
Name | Description |
nextAttemptSettings | TimedAttemptSettings attempt settings, which will be used for the next attempt, if accepted |
Type | Description |
boolean |
|
Type | Description |
CancellationException | if no more attempts should be made |