@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public class OperationResponsePollAlgorithm extends Object implements ResultRetryAlgorithm<OperationSnapshot>
OperationSnapshot.isDone() is
true.| Constructor and Description |
|---|
OperationResponsePollAlgorithm() |
| Modifier and Type | Method and Description |
|---|---|
TimedAttemptSettings |
createNextAttempt(Throwable prevThrowable,
OperationSnapshot prevResponse,
TimedAttemptSettings prevSettings)
Creates a next attempt
TimedAttemptSettings. |
boolean |
shouldRetry(Throwable prevThrowable,
OperationSnapshot prevResponse)
Returns
true if another attempt should be made, or false otherwise. |
public TimedAttemptSettings createNextAttempt(Throwable prevThrowable, OperationSnapshot prevResponse, TimedAttemptSettings prevSettings)
ResultRetryAlgorithmTimedAttemptSettings.createNextAttempt in interface ResultRetryAlgorithm<OperationSnapshot>prevThrowable - exception thrown by the previous attempt (null, if none)prevResponse - response returned by the previous attemptprevSettings - previous attempt settingsnull, if the implementing algorithm does not provide
specific settings for the next attemptpublic boolean shouldRetry(Throwable prevThrowable, OperationSnapshot prevResponse)
ResultRetryAlgorithmtrue if another attempt should be made, or false otherwise.shouldRetry in interface ResultRetryAlgorithm<OperationSnapshot>prevThrowable - exception thrown by the previous attempt (null, if none)prevResponse - response returned by the previous attempt