Top Description Fields Constructors Methods
com.oracle.bmc.waiter

public Class MaxTimeTerminationStrategy

extends Object
implements TerminationStrategy
Class Inheritance
All Implemented Interfaces
com.oracle.bmc.waiter.TerminationStrategy
Imports
com.oracle.bmc.waiter.WaiterConfiguration.WaitContext, java.util.concurrent.TimeUnit

Termination strategy that allows up to X milliseconds to have elapsed before terminating.

Field Summary

Modifier and TypeField and Description
private final long
maxTimeInMillis

The max amount of time to wait (in millis) before returning.

Constructor Summary

AccessConstructor and Description
public
MaxTimeTerminationStrategy(final long maxTimeInMillis)

Method Summary

Modifier and TypeMethod and Description
public static MaxTimeTerminationStrategy

Returns:

termination strategy
ofMillis
(final long
number of milliseconds
maxTimeInMillis
)

Create a new termination strategy that allows up to the specified number of milliseconds to have elapsed before terminating.

public static MaxTimeTerminationStrategy

Returns:

termination strategy
ofMinutes
(final long
number of minutes
maxTimeInMinutes
)

Create a new termination strategy that allows up to the specified number of minutes to have elapsed before terminating.

public static MaxTimeTerminationStrategy

Returns:

termination strategy
ofSeconds
(final long
number of seconds
maxTimeInSeconds
)

Create a new termination strategy that allows up to the specified number of seconds to have elapsed before terminating.

public static MaxTimeTerminationStrategy

Returns:

termination strategy
ofTimeUnit
(final long
number of time units
maxTime
,
final TimeUnit
time unit
timeUnit
)

Create a new termination strategy that allows up to the specified number of time units to have elapsed before terminating.

public boolean
shouldTerminate(WaiterConfiguration.WaitContext
The context after the last poll attempt.
context
)

Implements com.oracle.bmc.waiter.TerminationStrategy.shouldTerminate.

Returns whether or not polling should be terminated.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

maxTimeInMillisback to summary
private final long maxTimeInMillis

The max amount of time to wait (in millis) before returning.

Constructor Detail

MaxTimeTerminationStrategyback to summary
public MaxTimeTerminationStrategy(final long maxTimeInMillis)
Annotations
@java.beans.ConstructorProperties

Method Detail

ofMillisback to summary
public static MaxTimeTerminationStrategy ofMillis(final long maxTimeInMillis)

Create a new termination strategy that allows up to the specified number of milliseconds to have elapsed before terminating.

Parameters
maxTimeInMillis:long

number of milliseconds

Returns:MaxTimeTerminationStrategy

termination strategy

ofMinutesback to summary
public static MaxTimeTerminationStrategy ofMinutes(final long maxTimeInMinutes)

Create a new termination strategy that allows up to the specified number of minutes to have elapsed before terminating.

Parameters
maxTimeInMinutes:long

number of minutes

Returns:MaxTimeTerminationStrategy

termination strategy

ofSecondsback to summary
public static MaxTimeTerminationStrategy ofSeconds(final long maxTimeInSeconds)

Create a new termination strategy that allows up to the specified number of seconds to have elapsed before terminating.

Parameters
maxTimeInSeconds:long

number of seconds

Returns:MaxTimeTerminationStrategy

termination strategy

ofTimeUnitback to summary
public static MaxTimeTerminationStrategy ofTimeUnit(final long maxTime, final TimeUnit timeUnit)

Create a new termination strategy that allows up to the specified number of time units to have elapsed before terminating.

Parameters
maxTime:long

number of time units

timeUnit:TimeUnit

time unit

Returns:MaxTimeTerminationStrategy

termination strategy

shouldTerminateback to summary
public boolean shouldTerminate(WaiterConfiguration.WaitContext context)

Implements com.oracle.bmc.waiter.TerminationStrategy.shouldTerminate.

Doc from com.oracle.bmc.waiter.TerminationStrategy.shouldTerminate.

Returns whether or not polling should be terminated.

Parameters
context:WaiterConfiguration.WaitContext

The context after the last poll attempt.

Returns:boolean

true to terminate polling, false to continue.

Annotations
@Override