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 int
getMaxAttempts()
The maximum number of attempts to make.boolean
shouldTerminate(WaiterConfiguration.WaitContext context)
Returns whether or not polling should be terminated.String
toString()
-
-
-
Constructor Detail
-
MaxAttemptsTerminationStrategy
@ConstructorProperties("maxAttempts") public MaxAttemptsTerminationStrategy(int maxAttempts)
-
-
Method Detail
-
shouldTerminate
public boolean shouldTerminate(WaiterConfiguration.WaitContext context)
Description copied from interface:TerminationStrategy
Returns whether or not polling should be terminated.- Specified by:
shouldTerminate
in 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.
-
-