Interface Waiter<T>
- Type Parameters:
T
- the type of the resource returned from the polling function
- All Known Implementing Classes:
DefaultWaiter
public interface Waiter<T>
Waiter utility class that waits for a resource to transition to the desired state.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Waiter.Builder
<T> Creates a newly initialized builder for the waiter object.default WaiterResponse
<T> It returns when the resource enters into a desired state or it is determined that the resource will never enter into the desired state.default WaiterResponse
<T> run
(Supplier<T> pollingFunction, Consumer<WaiterOverrideConfiguration.Builder> overrideConfig) It returns when the resource enters into a desired state or it is determined that the resource will never enter into the desired state.default WaiterResponse
<T> run
(Supplier<T> pollingFunction, WaiterOverrideConfiguration overrideConfig) It returns when the resource enters into a desired state or it is determined that the resource will never enter into the desired state.
-
Method Details
-
run
It returns when the resource enters into a desired state or it is determined that the resource will never enter into the desired state.- Parameters:
pollingFunction
- the polling function- Returns:
- the
WaiterResponse
containing either a response or an exception that has matched with the waiter success condition
-
run
default WaiterResponse<T> run(Supplier<T> pollingFunction, WaiterOverrideConfiguration overrideConfig) It returns when the resource enters into a desired state or it is determined that the resource will never enter into the desired state.- Parameters:
pollingFunction
- the polling functionoverrideConfig
- per request override configuration- Returns:
- the
WaiterResponse
containing either a response or an exception that has matched with the waiter success condition
-
run
default WaiterResponse<T> run(Supplier<T> pollingFunction, Consumer<WaiterOverrideConfiguration.Builder> overrideConfig) It returns when the resource enters into a desired state or it is determined that the resource will never enter into the desired state.- Parameters:
pollingFunction
- the polling functionoverrideConfig
- The consumer that will configure the per request override configuration for waiters- Returns:
- the
WaiterResponse
containing either a response or an exception that has matched with the waiter success condition
-
builder
Creates a newly initialized builder for the waiter object.- Type Parameters:
T
- the type of the response- Parameters:
responseClass
- the response class- Returns:
- a Waiter builder
-