Package com.oracle.bmc.waiter
Class MaxTimeTerminationStrategy
- java.lang.Object
-
- com.oracle.bmc.waiter.MaxTimeTerminationStrategy
-
- All Implemented Interfaces:
TerminationStrategy
public class MaxTimeTerminationStrategy extends Object implements TerminationStrategy
Termination strategy that allows up to X milliseconds to have elapsed before terminating.
-
-
Constructor Summary
Constructors Constructor Description MaxTimeTerminationStrategy(long maxTimeInMillis)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MaxTimeTerminationStrategyofMillis(long maxTimeInMillis)Create a new termination strategy that allows up to the specified number of milliseconds to have elapsed before terminating.static MaxTimeTerminationStrategyofMinutes(long maxTimeInMinutes)Create a new termination strategy that allows up to the specified number of minutes to have elapsed before terminating.static MaxTimeTerminationStrategyofSeconds(long maxTimeInSeconds)Create a new termination strategy that allows up to the specified number of seconds to have elapsed before terminating.static MaxTimeTerminationStrategyofTimeUnit(long maxTime, TimeUnit timeUnit)Create a new termination strategy that allows up to the specified number of time units to have elapsed before terminating.booleanshouldTerminate(WaiterConfiguration.WaitContext context)Returns whether or not polling should be terminated.
-
-
-
Constructor Detail
-
MaxTimeTerminationStrategy
@ConstructorProperties("maxTimeInMillis") public MaxTimeTerminationStrategy(long maxTimeInMillis)
-
-
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.
-
ofTimeUnit
public static MaxTimeTerminationStrategy ofTimeUnit(long maxTime, TimeUnit timeUnit)
Create a new termination strategy that allows up to the specified number of time units to have elapsed before terminating.- Parameters:
maxTime- number of time unitstimeUnit- time unit- Returns:
- termination strategy
-
ofMillis
public static MaxTimeTerminationStrategy ofMillis(long maxTimeInMillis)
Create a new termination strategy that allows up to the specified number of milliseconds to have elapsed before terminating.- Parameters:
maxTimeInMillis- number of milliseconds- Returns:
- termination strategy
-
ofSeconds
public static MaxTimeTerminationStrategy ofSeconds(long maxTimeInSeconds)
Create a new termination strategy that allows up to the specified number of seconds to have elapsed before terminating.- Parameters:
maxTimeInSeconds- number of seconds- Returns:
- termination strategy
-
ofMinutes
public static MaxTimeTerminationStrategy ofMinutes(long maxTimeInMinutes)
Create a new termination strategy that allows up to the specified number of minutes to have elapsed before terminating.- Parameters:
maxTimeInMinutes- number of minutes- Returns:
- termination strategy
-
-