Package com.oracle.bmc.waiter
Class MaxAttemptsTerminationStrategy
- java.lang.Object
-
- com.oracle.bmc.waiter.MaxAttemptsTerminationStrategy
-
- All Implemented Interfaces:
TerminationStrategy
public class MaxAttemptsTerminationStrategy extends Object implements TerminationStrategy
Termination strategy that allows up to X attempts before terminating.
-
-
Constructor Summary
Constructors Constructor Description MaxAttemptsTerminationStrategy(int maxAttempts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetMaxAttempts()The maximum number of attempts to make.booleanshouldTerminate(WaiterConfiguration.WaitContext context)Returns whether or not polling should be terminated.StringtoString()
-
-
-
Constructor Detail
-
MaxAttemptsTerminationStrategy
@ConstructorProperties("maxAttempts") public MaxAttemptsTerminationStrategy(int maxAttempts)
-
-
Method Detail
-
shouldTerminate
public boolean shouldTerminate(WaiterConfiguration.WaitContext context)
Description copied from interface:TerminationStrategyReturns whether or not polling should be terminated.- Specified by:
shouldTerminatein interfaceTerminationStrategy- Parameters:
context- The context after the last poll attempt.- Returns:
- true to terminate polling, false to continue.
-
getMaxAttempts
public int getMaxAttempts()
The maximum number of attempts to make.
-
-