software.amazon.awssdk.services.databasemigration.waiters.DatabaseMigrationWaiter Maven / Gradle / Ivy
Show all versions of databasemigration Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.databasemigration.waiters;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.Immutable;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.annotations.ThreadSafe;
import software.amazon.awssdk.core.waiters.WaiterOverrideConfiguration;
import software.amazon.awssdk.core.waiters.WaiterResponse;
import software.amazon.awssdk.services.databasemigration.DatabaseMigrationClient;
import software.amazon.awssdk.services.databasemigration.model.DescribeConnectionsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeConnectionsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeEndpointsRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeEndpointsResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationInstancesRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationInstancesResponse;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationTasksRequest;
import software.amazon.awssdk.services.databasemigration.model.DescribeReplicationTasksResponse;
import software.amazon.awssdk.utils.SdkAutoCloseable;
/**
* Waiter utility class that polls a resource until a desired state is reached or until it is determined that the
* resource will never enter into the desired state. This can be created using the static {@link #builder()} method
*/
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
@ThreadSafe
@Immutable
public interface DatabaseMigrationWaiter extends SdkAutoCloseable {
/**
* Polls {@link DatabaseMigrationClient#describeEndpoints} API until the desired condition {@code EndpointDeleted}
* is met, or until it is determined that the resource will never enter into the desired state
*
* @param describeEndpointsRequest
* the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilEndpointDeleted(DescribeEndpointsRequest describeEndpointsRequest) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link DatabaseMigrationClient#describeEndpoints} API until the desired condition {@code EndpointDeleted}
* is met, or until it is determined that the resource will never enter into the desired state.
*
* This is a convenience method to create an instance of the request builder without the need to create one manually
* using {@link DescribeEndpointsRequest#builder()}
*
* @param describeEndpointsRequest
* The consumer that will configure the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilEndpointDeleted(
Consumer describeEndpointsRequest) {
return waitUntilEndpointDeleted(DescribeEndpointsRequest.builder().applyMutation(describeEndpointsRequest).build());
}
/**
* Polls {@link DatabaseMigrationClient#describeEndpoints} API until the desired condition {@code EndpointDeleted}
* is met, or until it is determined that the resource will never enter into the desired state
*
* @param describeEndpointsRequest
* The request to be used for polling
* @param overrideConfig
* Per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilEndpointDeleted(DescribeEndpointsRequest describeEndpointsRequest,
WaiterOverrideConfiguration overrideConfig) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link DatabaseMigrationClient#describeEndpoints} API until the desired condition {@code EndpointDeleted}
* is met, or until it is determined that the resource will never enter into the desired state.
*
* This is a convenience method to create an instance of the request builder and instance of the override config
* builder
*
* @param describeEndpointsRequest
* The consumer that will configure the request to be used for polling
* @param overrideConfig
* The consumer that will configure the per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilEndpointDeleted(
Consumer describeEndpointsRequest,
Consumer overrideConfig) {
return waitUntilEndpointDeleted(DescribeEndpointsRequest.builder().applyMutation(describeEndpointsRequest).build(),
WaiterOverrideConfiguration.builder().applyMutation(overrideConfig).build());
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationInstances} API until the desired condition
* {@code ReplicationInstanceAvailable} is met, or until it is determined that the resource will never enter into
* the desired state
*
* @param describeReplicationInstancesRequest
* the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationInstanceAvailable(
DescribeReplicationInstancesRequest describeReplicationInstancesRequest) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationInstances} API until the desired condition
* {@code ReplicationInstanceAvailable} is met, or until it is determined that the resource will never enter into
* the desired state.
*
* This is a convenience method to create an instance of the request builder without the need to create one manually
* using {@link DescribeReplicationInstancesRequest#builder()}
*
* @param describeReplicationInstancesRequest
* The consumer that will configure the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationInstanceAvailable(
Consumer describeReplicationInstancesRequest) {
return waitUntilReplicationInstanceAvailable(DescribeReplicationInstancesRequest.builder()
.applyMutation(describeReplicationInstancesRequest).build());
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationInstances} API until the desired condition
* {@code ReplicationInstanceAvailable} is met, or until it is determined that the resource will never enter into
* the desired state
*
* @param describeReplicationInstancesRequest
* The request to be used for polling
* @param overrideConfig
* Per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationInstanceAvailable(
DescribeReplicationInstancesRequest describeReplicationInstancesRequest, WaiterOverrideConfiguration overrideConfig) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationInstances} API until the desired condition
* {@code ReplicationInstanceAvailable} is met, or until it is determined that the resource will never enter into
* the desired state.
*
* This is a convenience method to create an instance of the request builder and instance of the override config
* builder
*
* @param describeReplicationInstancesRequest
* The consumer that will configure the request to be used for polling
* @param overrideConfig
* The consumer that will configure the per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationInstanceAvailable(
Consumer describeReplicationInstancesRequest,
Consumer overrideConfig) {
return waitUntilReplicationInstanceAvailable(
DescribeReplicationInstancesRequest.builder().applyMutation(describeReplicationInstancesRequest).build(),
WaiterOverrideConfiguration.builder().applyMutation(overrideConfig).build());
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationInstances} API until the desired condition
* {@code ReplicationInstanceDeleted} is met, or until it is determined that the resource will never enter into the
* desired state
*
* @param describeReplicationInstancesRequest
* the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationInstanceDeleted(
DescribeReplicationInstancesRequest describeReplicationInstancesRequest) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationInstances} API until the desired condition
* {@code ReplicationInstanceDeleted} is met, or until it is determined that the resource will never enter into the
* desired state.
*
* This is a convenience method to create an instance of the request builder without the need to create one manually
* using {@link DescribeReplicationInstancesRequest#builder()}
*
* @param describeReplicationInstancesRequest
* The consumer that will configure the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationInstanceDeleted(
Consumer describeReplicationInstancesRequest) {
return waitUntilReplicationInstanceDeleted(DescribeReplicationInstancesRequest.builder()
.applyMutation(describeReplicationInstancesRequest).build());
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationInstances} API until the desired condition
* {@code ReplicationInstanceDeleted} is met, or until it is determined that the resource will never enter into the
* desired state
*
* @param describeReplicationInstancesRequest
* The request to be used for polling
* @param overrideConfig
* Per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationInstanceDeleted(
DescribeReplicationInstancesRequest describeReplicationInstancesRequest, WaiterOverrideConfiguration overrideConfig) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationInstances} API until the desired condition
* {@code ReplicationInstanceDeleted} is met, or until it is determined that the resource will never enter into the
* desired state.
*
* This is a convenience method to create an instance of the request builder and instance of the override config
* builder
*
* @param describeReplicationInstancesRequest
* The consumer that will configure the request to be used for polling
* @param overrideConfig
* The consumer that will configure the per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationInstanceDeleted(
Consumer describeReplicationInstancesRequest,
Consumer overrideConfig) {
return waitUntilReplicationInstanceDeleted(
DescribeReplicationInstancesRequest.builder().applyMutation(describeReplicationInstancesRequest).build(),
WaiterOverrideConfiguration.builder().applyMutation(overrideConfig).build());
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationTasks} API until the desired condition
* {@code ReplicationTaskDeleted} is met, or until it is determined that the resource will never enter into the
* desired state
*
* @param describeReplicationTasksRequest
* the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationTaskDeleted(
DescribeReplicationTasksRequest describeReplicationTasksRequest) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationTasks} API until the desired condition
* {@code ReplicationTaskDeleted} is met, or until it is determined that the resource will never enter into the
* desired state.
*
* This is a convenience method to create an instance of the request builder without the need to create one manually
* using {@link DescribeReplicationTasksRequest#builder()}
*
* @param describeReplicationTasksRequest
* The consumer that will configure the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationTaskDeleted(
Consumer describeReplicationTasksRequest) {
return waitUntilReplicationTaskDeleted(DescribeReplicationTasksRequest.builder()
.applyMutation(describeReplicationTasksRequest).build());
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationTasks} API until the desired condition
* {@code ReplicationTaskDeleted} is met, or until it is determined that the resource will never enter into the
* desired state
*
* @param describeReplicationTasksRequest
* The request to be used for polling
* @param overrideConfig
* Per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationTaskDeleted(
DescribeReplicationTasksRequest describeReplicationTasksRequest, WaiterOverrideConfiguration overrideConfig) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationTasks} API until the desired condition
* {@code ReplicationTaskDeleted} is met, or until it is determined that the resource will never enter into the
* desired state.
*
* This is a convenience method to create an instance of the request builder and instance of the override config
* builder
*
* @param describeReplicationTasksRequest
* The consumer that will configure the request to be used for polling
* @param overrideConfig
* The consumer that will configure the per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationTaskDeleted(
Consumer describeReplicationTasksRequest,
Consumer overrideConfig) {
return waitUntilReplicationTaskDeleted(
DescribeReplicationTasksRequest.builder().applyMutation(describeReplicationTasksRequest).build(),
WaiterOverrideConfiguration.builder().applyMutation(overrideConfig).build());
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationTasks} API until the desired condition
* {@code ReplicationTaskReady} is met, or until it is determined that the resource will never enter into the
* desired state
*
* @param describeReplicationTasksRequest
* the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationTaskReady(
DescribeReplicationTasksRequest describeReplicationTasksRequest) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationTasks} API until the desired condition
* {@code ReplicationTaskReady} is met, or until it is determined that the resource will never enter into the
* desired state.
*
* This is a convenience method to create an instance of the request builder without the need to create one manually
* using {@link DescribeReplicationTasksRequest#builder()}
*
* @param describeReplicationTasksRequest
* The consumer that will configure the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationTaskReady(
Consumer describeReplicationTasksRequest) {
return waitUntilReplicationTaskReady(DescribeReplicationTasksRequest.builder()
.applyMutation(describeReplicationTasksRequest).build());
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationTasks} API until the desired condition
* {@code ReplicationTaskReady} is met, or until it is determined that the resource will never enter into the
* desired state
*
* @param describeReplicationTasksRequest
* The request to be used for polling
* @param overrideConfig
* Per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationTaskReady(
DescribeReplicationTasksRequest describeReplicationTasksRequest, WaiterOverrideConfiguration overrideConfig) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationTasks} API until the desired condition
* {@code ReplicationTaskReady} is met, or until it is determined that the resource will never enter into the
* desired state.
*
* This is a convenience method to create an instance of the request builder and instance of the override config
* builder
*
* @param describeReplicationTasksRequest
* The consumer that will configure the request to be used for polling
* @param overrideConfig
* The consumer that will configure the per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationTaskReady(
Consumer describeReplicationTasksRequest,
Consumer overrideConfig) {
return waitUntilReplicationTaskReady(
DescribeReplicationTasksRequest.builder().applyMutation(describeReplicationTasksRequest).build(),
WaiterOverrideConfiguration.builder().applyMutation(overrideConfig).build());
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationTasks} API until the desired condition
* {@code ReplicationTaskRunning} is met, or until it is determined that the resource will never enter into the
* desired state
*
* @param describeReplicationTasksRequest
* the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationTaskRunning(
DescribeReplicationTasksRequest describeReplicationTasksRequest) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationTasks} API until the desired condition
* {@code ReplicationTaskRunning} is met, or until it is determined that the resource will never enter into the
* desired state.
*
* This is a convenience method to create an instance of the request builder without the need to create one manually
* using {@link DescribeReplicationTasksRequest#builder()}
*
* @param describeReplicationTasksRequest
* The consumer that will configure the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationTaskRunning(
Consumer describeReplicationTasksRequest) {
return waitUntilReplicationTaskRunning(DescribeReplicationTasksRequest.builder()
.applyMutation(describeReplicationTasksRequest).build());
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationTasks} API until the desired condition
* {@code ReplicationTaskRunning} is met, or until it is determined that the resource will never enter into the
* desired state
*
* @param describeReplicationTasksRequest
* The request to be used for polling
* @param overrideConfig
* Per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationTaskRunning(
DescribeReplicationTasksRequest describeReplicationTasksRequest, WaiterOverrideConfiguration overrideConfig) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationTasks} API until the desired condition
* {@code ReplicationTaskRunning} is met, or until it is determined that the resource will never enter into the
* desired state.
*
* This is a convenience method to create an instance of the request builder and instance of the override config
* builder
*
* @param describeReplicationTasksRequest
* The consumer that will configure the request to be used for polling
* @param overrideConfig
* The consumer that will configure the per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationTaskRunning(
Consumer describeReplicationTasksRequest,
Consumer overrideConfig) {
return waitUntilReplicationTaskRunning(
DescribeReplicationTasksRequest.builder().applyMutation(describeReplicationTasksRequest).build(),
WaiterOverrideConfiguration.builder().applyMutation(overrideConfig).build());
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationTasks} API until the desired condition
* {@code ReplicationTaskStopped} is met, or until it is determined that the resource will never enter into the
* desired state
*
* @param describeReplicationTasksRequest
* the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationTaskStopped(
DescribeReplicationTasksRequest describeReplicationTasksRequest) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationTasks} API until the desired condition
* {@code ReplicationTaskStopped} is met, or until it is determined that the resource will never enter into the
* desired state.
*
* This is a convenience method to create an instance of the request builder without the need to create one manually
* using {@link DescribeReplicationTasksRequest#builder()}
*
* @param describeReplicationTasksRequest
* The consumer that will configure the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationTaskStopped(
Consumer describeReplicationTasksRequest) {
return waitUntilReplicationTaskStopped(DescribeReplicationTasksRequest.builder()
.applyMutation(describeReplicationTasksRequest).build());
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationTasks} API until the desired condition
* {@code ReplicationTaskStopped} is met, or until it is determined that the resource will never enter into the
* desired state
*
* @param describeReplicationTasksRequest
* The request to be used for polling
* @param overrideConfig
* Per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationTaskStopped(
DescribeReplicationTasksRequest describeReplicationTasksRequest, WaiterOverrideConfiguration overrideConfig) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link DatabaseMigrationClient#describeReplicationTasks} API until the desired condition
* {@code ReplicationTaskStopped} is met, or until it is determined that the resource will never enter into the
* desired state.
*
* This is a convenience method to create an instance of the request builder and instance of the override config
* builder
*
* @param describeReplicationTasksRequest
* The consumer that will configure the request to be used for polling
* @param overrideConfig
* The consumer that will configure the per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilReplicationTaskStopped(
Consumer describeReplicationTasksRequest,
Consumer overrideConfig) {
return waitUntilReplicationTaskStopped(
DescribeReplicationTasksRequest.builder().applyMutation(describeReplicationTasksRequest).build(),
WaiterOverrideConfiguration.builder().applyMutation(overrideConfig).build());
}
/**
* Polls {@link DatabaseMigrationClient#describeConnections} API until the desired condition
* {@code TestConnectionSucceeds} is met, or until it is determined that the resource will never enter into the
* desired state
*
* @param describeConnectionsRequest
* the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilTestConnectionSucceeds(
DescribeConnectionsRequest describeConnectionsRequest) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link DatabaseMigrationClient#describeConnections} API until the desired condition
* {@code TestConnectionSucceeds} is met, or until it is determined that the resource will never enter into the
* desired state.
*
* This is a convenience method to create an instance of the request builder without the need to create one manually
* using {@link DescribeConnectionsRequest#builder()}
*
* @param describeConnectionsRequest
* The consumer that will configure the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilTestConnectionSucceeds(
Consumer describeConnectionsRequest) {
return waitUntilTestConnectionSucceeds(DescribeConnectionsRequest.builder().applyMutation(describeConnectionsRequest)
.build());
}
/**
* Polls {@link DatabaseMigrationClient#describeConnections} API until the desired condition
* {@code TestConnectionSucceeds} is met, or until it is determined that the resource will never enter into the
* desired state
*
* @param describeConnectionsRequest
* The request to be used for polling
* @param overrideConfig
* Per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilTestConnectionSucceeds(
DescribeConnectionsRequest describeConnectionsRequest, WaiterOverrideConfiguration overrideConfig) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link DatabaseMigrationClient#describeConnections} API until the desired condition
* {@code TestConnectionSucceeds} is met, or until it is determined that the resource will never enter into the
* desired state.
*
* This is a convenience method to create an instance of the request builder and instance of the override config
* builder
*
* @param describeConnectionsRequest
* The consumer that will configure the request to be used for polling
* @param overrideConfig
* The consumer that will configure the per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse waitUntilTestConnectionSucceeds(
Consumer describeConnectionsRequest,
Consumer overrideConfig) {
return waitUntilTestConnectionSucceeds(DescribeConnectionsRequest.builder().applyMutation(describeConnectionsRequest)
.build(), WaiterOverrideConfiguration.builder().applyMutation(overrideConfig).build());
}
/**
* Create a builder that can be used to configure and create a {@link DatabaseMigrationWaiter}.
*
* @return a builder
*/
static Builder builder() {
return DefaultDatabaseMigrationWaiter.builder();
}
/**
* Create an instance of {@link DatabaseMigrationWaiter} with the default configuration.
*
* A default {@link DatabaseMigrationClient} will be created to poll resources. It is recommended to share a
* single instance of the waiter created via this method. If it is not desirable to share a waiter instance, invoke
* {@link #close()} to release the resources once the waiter is not needed.
*
* @return an instance of {@link DatabaseMigrationWaiter}
*/
static DatabaseMigrationWaiter create() {
return DefaultDatabaseMigrationWaiter.builder().build();
}
interface Builder {
/**
* Defines overrides to the default SDK waiter configuration that should be used for waiters created from this
* builder
*
* @param overrideConfiguration
* the override configuration to set
* @return a reference to this object so that method calls can be chained together.
*/
Builder overrideConfiguration(WaiterOverrideConfiguration overrideConfiguration);
/**
* This is a convenient method to pass the override configuration without the need to create an instance
* manually via {@link WaiterOverrideConfiguration#builder()}
*
* @param overrideConfiguration
* The consumer that will configure the overrideConfiguration
* @return a reference to this object so that method calls can be chained together.
* @see #overrideConfiguration(WaiterOverrideConfiguration)
*/
default Builder overrideConfiguration(Consumer overrideConfiguration) {
WaiterOverrideConfiguration.Builder builder = WaiterOverrideConfiguration.builder();
overrideConfiguration.accept(builder);
return overrideConfiguration(builder.build());
}
/**
* Sets a custom {@link DatabaseMigrationClient} that will be used to poll the resource
*
* This SDK client must be closed by the caller when it is ready to be disposed. The SDK will not close the
* client when the waiter is closed
*
* @param client
* the client to send the request
* @return a reference to this object so that method calls can be chained together.
*/
Builder client(DatabaseMigrationClient client);
/**
* Builds an instance of {@link DatabaseMigrationWaiter} based on the configurations supplied to this builder
*
* @return An initialized {@link DatabaseMigrationWaiter}
*/
DatabaseMigrationWaiter build();
}
}