@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public class OperationTimedPollAlgorithm extends ExponentialRetryAlgorithm
| Modifier and Type | Method and Description |
|---|---|
static OperationTimedPollAlgorithm |
create(RetrySettings globalSettings)
Creates the polling algorithm, using the default
NanoClock for time computations. |
static OperationTimedPollAlgorithm |
create(RetrySettings globalSettings,
com.google.api.core.ApiClock clock) |
boolean |
shouldRetry(TimedAttemptSettings nextAttemptSettings)
Returns
true if another poll operation should be made or throws CancellationException otherwise. |
createFirstAttempt, createNextAttempt, nextRandomLongpublic static OperationTimedPollAlgorithm create(RetrySettings globalSettings)
NanoClock for time computations.globalSettings - the settingspublic static OperationTimedPollAlgorithm create(RetrySettings globalSettings, com.google.api.core.ApiClock clock)
public boolean shouldRetry(TimedAttemptSettings nextAttemptSettings) throws CancellationException
true if another poll operation should be made or throws CancellationException otherwise.shouldRetry in interface TimedRetryAlgorithmshouldRetry in class ExponentialRetryAlgorithmnextAttemptSettings - attempt settings, which will be used for the next attempt, if
acceptedtrue if more attempts should be made, never returns false (throws
CancellationException instead)CancellationException - if no more attempts should be made