com.amazonaws.services.databasemigrationservice.AWSDatabaseMigrationServiceAsyncClient Maven / Gradle / Ivy
/*
* Copyright 2012-2017 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 com.amazonaws.services.databasemigrationservice;
import static java.util.concurrent.Executors.newFixedThreadPool;
import javax.annotation.Generated;
import com.amazonaws.services.databasemigrationservice.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSCredentialsProvider;
import java.util.concurrent.ExecutorService;
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
/**
* Client for accessing AWS Database Migration Service asynchronously. Each asynchronous method will return a Java
* Future object representing the asynchronous operation; overloads which accept an {@code AsyncHandler} can be used to
* receive notification when an asynchronous operation completes.
*
* AWS Database Migration Service
*
* AWS Database Migration Service (AWS DMS) can migrate your data to and from the most widely used commercial and
* open-source databases such as Oracle, PostgreSQL, Microsoft SQL Server, Amazon Redshift, MariaDB, Amazon Aurora,
* MySQL, and SAP Adaptive Server Enterprise (ASE). The service supports homogeneous migrations such as Oracle to
* Oracle, as well as heterogeneous migrations between different database platforms, such as Oracle to MySQL or SQL
* Server to PostgreSQL.
*
*
* For more information about AWS DMS, see the AWS DMS user guide at What Is AWS Database Migration Service?
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSDatabaseMigrationServiceAsyncClient extends AWSDatabaseMigrationServiceClient implements AWSDatabaseMigrationServiceAsync {
private static final int DEFAULT_THREAD_POOL_SIZE = 50;
private final java.util.concurrent.ExecutorService executorService;
/**
* Constructs a new asynchronous client to invoke service methods on AWS Database Migration Service. A credentials
* provider chain will be used that searches for credentials in this order:
*
* - Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
* - Java System Properties - aws.accessKeyId and aws.secretKey
* - Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
* - Instance profile credentials delivered through the Amazon EC2 metadata service
*
*
* Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default
* maximum number of concurrent connections to the service).
*
* @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
* @deprecated use {@link AWSDatabaseMigrationServiceAsyncClientBuilder#defaultClient()}
*/
@Deprecated
public AWSDatabaseMigrationServiceAsyncClient() {
this(DefaultAWSCredentialsProviderChain.getInstance());
}
/**
* Constructs a new asynchronous client to invoke service methods on AWS Database Migration Service. A credentials
* provider chain will be used that searches for credentials in this order:
*
* - Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
* - Java System Properties - aws.accessKeyId and aws.secretKey
* - Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
* - Instance profile credentials delivered through the Amazon EC2 metadata service
*
*
* Asynchronous methods are delegated to a fixed-size thread pool containing a number of threads equal to the
* maximum number of concurrent connections configured via {@code ClientConfiguration.getMaxConnections()}.
*
* @param clientConfiguration
* The client configuration options controlling how this client connects to AWS Database Migration Service
* (ex: proxy settings, retry counts, etc).
*
* @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
* @deprecated use
* {@link AWSDatabaseMigrationServiceAsyncClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AWSDatabaseMigrationServiceAsyncClient(ClientConfiguration clientConfiguration) {
this(DefaultAWSCredentialsProviderChain.getInstance(), clientConfiguration, newFixedThreadPool(clientConfiguration.getMaxConnections()));
}
/**
* Constructs a new asynchronous client to invoke service methods on AWS Database Migration Service using the
* specified AWS account credentials.
*
* Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default
* maximum number of concurrent connections to the service).
*
* @param awsCredentials
* The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
* @deprecated use {@link AWSDatabaseMigrationServiceAsyncClientBuilder#withCredentials(AWSCredentialsProvider)}
*/
@Deprecated
public AWSDatabaseMigrationServiceAsyncClient(AWSCredentials awsCredentials) {
this(awsCredentials, newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE));
}
/**
* Constructs a new asynchronous client to invoke service methods on AWS Database Migration Service using the
* specified AWS account credentials and executor service. Default client settings will be used.
*
* @param awsCredentials
* The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
* @param executorService
* The executor service by which all asynchronous requests will be executed.
* @deprecated use {@link AWSDatabaseMigrationServiceAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AWSDatabaseMigrationServiceAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AWSDatabaseMigrationServiceAsyncClient(AWSCredentials awsCredentials, ExecutorService executorService) {
this(awsCredentials, configFactory.getConfig(), executorService);
}
/**
* Constructs a new asynchronous client to invoke service methods on AWS Database Migration Service using the
* specified AWS account credentials, executor service, and client configuration options.
*
* @param awsCredentials
* The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
* @param clientConfiguration
* Client configuration options (ex: max retry limit, proxy settings, etc).
* @param executorService
* The executor service by which all asynchronous requests will be executed.
* @deprecated use {@link AWSDatabaseMigrationServiceAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AWSDatabaseMigrationServiceAsyncClientBuilder#withClientConfiguration(ClientConfiguration)}
* and
* {@link AWSDatabaseMigrationServiceAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AWSDatabaseMigrationServiceAsyncClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration, ExecutorService executorService) {
super(awsCredentials, clientConfiguration);
this.executorService = executorService;
}
/**
* Constructs a new asynchronous client to invoke service methods on AWS Database Migration Service using the
* specified AWS account credentials provider. Default client settings will be used.
*
* Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default
* maximum number of concurrent connections to the service).
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
* @deprecated use {@link AWSDatabaseMigrationServiceAsyncClientBuilder#withCredentials(AWSCredentialsProvider)}
*/
@Deprecated
public AWSDatabaseMigrationServiceAsyncClient(AWSCredentialsProvider awsCredentialsProvider) {
this(awsCredentialsProvider, newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE));
}
/**
* Constructs a new asynchronous client to invoke service methods on AWS Database Migration Service using the
* provided AWS account credentials provider and client configuration options.
*
* Asynchronous methods are delegated to a fixed-size thread pool containing a number of threads equal to the
* maximum number of concurrent connections configured via {@code ClientConfiguration.getMaxConnections()}.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
* @param clientConfiguration
* Client configuration options (ex: max retry limit, proxy settings, etc).
*
* @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
* @deprecated use {@link AWSDatabaseMigrationServiceAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AWSDatabaseMigrationServiceAsyncClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AWSDatabaseMigrationServiceAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) {
this(awsCredentialsProvider, clientConfiguration, newFixedThreadPool(clientConfiguration.getMaxConnections()));
}
/**
* Constructs a new asynchronous client to invoke service methods on AWS Database Migration Service using the
* specified AWS account credentials provider and executor service. Default client settings will be used.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
* @param executorService
* The executor service by which all asynchronous requests will be executed.
* @deprecated use {@link AWSDatabaseMigrationServiceAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AWSDatabaseMigrationServiceAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AWSDatabaseMigrationServiceAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ExecutorService executorService) {
this(awsCredentialsProvider, configFactory.getConfig(), executorService);
}
/**
* Constructs a new asynchronous client to invoke service methods on AWS Database Migration Service using the
* specified AWS account credentials provider, executor service, and client configuration options.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
* @param clientConfiguration
* Client configuration options (ex: max retry limit, proxy settings, etc).
* @param executorService
* The executor service by which all asynchronous requests will be executed.
* @deprecated use {@link AWSDatabaseMigrationServiceAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AWSDatabaseMigrationServiceAsyncClientBuilder#withClientConfiguration(ClientConfiguration)}
* and
* {@link AWSDatabaseMigrationServiceAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AWSDatabaseMigrationServiceAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration,
ExecutorService executorService) {
super(awsCredentialsProvider, clientConfiguration);
this.executorService = executorService;
}
public static AWSDatabaseMigrationServiceAsyncClientBuilder asyncBuilder() {
return AWSDatabaseMigrationServiceAsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on AWS Database Migration Service using the
* specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AWSDatabaseMigrationServiceAsyncClient(AwsAsyncClientParams asyncClientParams) {
super(asyncClientParams);
this.executorService = asyncClientParams.getExecutor();
}
/**
* Returns the executor service used by this client to execute async requests.
*
* @return The executor service used by this client to execute async requests.
*/
public ExecutorService getExecutorService() {
return executorService;
}
@Override
public java.util.concurrent.Future addTagsToResourceAsync(AddTagsToResourceRequest request) {
return addTagsToResourceAsync(request, null);
}
@Override
public java.util.concurrent.Future addTagsToResourceAsync(final AddTagsToResourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AddTagsToResourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AddTagsToResourceResult call() throws Exception {
AddTagsToResourceResult result = null;
try {
result = executeAddTagsToResource(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future createEndpointAsync(CreateEndpointRequest request) {
return createEndpointAsync(request, null);
}
@Override
public java.util.concurrent.Future createEndpointAsync(final CreateEndpointRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateEndpointRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateEndpointResult call() throws Exception {
CreateEndpointResult result = null;
try {
result = executeCreateEndpoint(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future createEventSubscriptionAsync(CreateEventSubscriptionRequest request) {
return createEventSubscriptionAsync(request, null);
}
@Override
public java.util.concurrent.Future createEventSubscriptionAsync(final CreateEventSubscriptionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateEventSubscriptionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateEventSubscriptionResult call() throws Exception {
CreateEventSubscriptionResult result = null;
try {
result = executeCreateEventSubscription(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future createReplicationInstanceAsync(CreateReplicationInstanceRequest request) {
return createReplicationInstanceAsync(request, null);
}
@Override
public java.util.concurrent.Future createReplicationInstanceAsync(final CreateReplicationInstanceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateReplicationInstanceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateReplicationInstanceResult call() throws Exception {
CreateReplicationInstanceResult result = null;
try {
result = executeCreateReplicationInstance(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future createReplicationSubnetGroupAsync(CreateReplicationSubnetGroupRequest request) {
return createReplicationSubnetGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future createReplicationSubnetGroupAsync(final CreateReplicationSubnetGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateReplicationSubnetGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateReplicationSubnetGroupResult call() throws Exception {
CreateReplicationSubnetGroupResult result = null;
try {
result = executeCreateReplicationSubnetGroup(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future createReplicationTaskAsync(CreateReplicationTaskRequest request) {
return createReplicationTaskAsync(request, null);
}
@Override
public java.util.concurrent.Future createReplicationTaskAsync(final CreateReplicationTaskRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateReplicationTaskRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateReplicationTaskResult call() throws Exception {
CreateReplicationTaskResult result = null;
try {
result = executeCreateReplicationTask(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future deleteCertificateAsync(DeleteCertificateRequest request) {
return deleteCertificateAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteCertificateAsync(final DeleteCertificateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteCertificateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteCertificateResult call() throws Exception {
DeleteCertificateResult result = null;
try {
result = executeDeleteCertificate(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future deleteEndpointAsync(DeleteEndpointRequest request) {
return deleteEndpointAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteEndpointAsync(final DeleteEndpointRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteEndpointRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteEndpointResult call() throws Exception {
DeleteEndpointResult result = null;
try {
result = executeDeleteEndpoint(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future deleteEventSubscriptionAsync(DeleteEventSubscriptionRequest request) {
return deleteEventSubscriptionAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteEventSubscriptionAsync(final DeleteEventSubscriptionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteEventSubscriptionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteEventSubscriptionResult call() throws Exception {
DeleteEventSubscriptionResult result = null;
try {
result = executeDeleteEventSubscription(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future deleteReplicationInstanceAsync(DeleteReplicationInstanceRequest request) {
return deleteReplicationInstanceAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteReplicationInstanceAsync(final DeleteReplicationInstanceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteReplicationInstanceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteReplicationInstanceResult call() throws Exception {
DeleteReplicationInstanceResult result = null;
try {
result = executeDeleteReplicationInstance(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future deleteReplicationSubnetGroupAsync(DeleteReplicationSubnetGroupRequest request) {
return deleteReplicationSubnetGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteReplicationSubnetGroupAsync(final DeleteReplicationSubnetGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteReplicationSubnetGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteReplicationSubnetGroupResult call() throws Exception {
DeleteReplicationSubnetGroupResult result = null;
try {
result = executeDeleteReplicationSubnetGroup(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future deleteReplicationTaskAsync(DeleteReplicationTaskRequest request) {
return deleteReplicationTaskAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteReplicationTaskAsync(final DeleteReplicationTaskRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteReplicationTaskRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteReplicationTaskResult call() throws Exception {
DeleteReplicationTaskResult result = null;
try {
result = executeDeleteReplicationTask(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeAccountAttributesAsync(DescribeAccountAttributesRequest request) {
return describeAccountAttributesAsync(request, null);
}
@Override
public java.util.concurrent.Future describeAccountAttributesAsync(final DescribeAccountAttributesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeAccountAttributesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeAccountAttributesResult call() throws Exception {
DescribeAccountAttributesResult result = null;
try {
result = executeDescribeAccountAttributes(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeCertificatesAsync(DescribeCertificatesRequest request) {
return describeCertificatesAsync(request, null);
}
@Override
public java.util.concurrent.Future describeCertificatesAsync(final DescribeCertificatesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeCertificatesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeCertificatesResult call() throws Exception {
DescribeCertificatesResult result = null;
try {
result = executeDescribeCertificates(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeConnectionsAsync(DescribeConnectionsRequest request) {
return describeConnectionsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeConnectionsAsync(final DescribeConnectionsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeConnectionsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeConnectionsResult call() throws Exception {
DescribeConnectionsResult result = null;
try {
result = executeDescribeConnections(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeEndpointTypesAsync(DescribeEndpointTypesRequest request) {
return describeEndpointTypesAsync(request, null);
}
@Override
public java.util.concurrent.Future describeEndpointTypesAsync(final DescribeEndpointTypesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeEndpointTypesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeEndpointTypesResult call() throws Exception {
DescribeEndpointTypesResult result = null;
try {
result = executeDescribeEndpointTypes(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeEndpointsAsync(DescribeEndpointsRequest request) {
return describeEndpointsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeEndpointsAsync(final DescribeEndpointsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeEndpointsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeEndpointsResult call() throws Exception {
DescribeEndpointsResult result = null;
try {
result = executeDescribeEndpoints(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeEventCategoriesAsync(DescribeEventCategoriesRequest request) {
return describeEventCategoriesAsync(request, null);
}
@Override
public java.util.concurrent.Future describeEventCategoriesAsync(final DescribeEventCategoriesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeEventCategoriesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeEventCategoriesResult call() throws Exception {
DescribeEventCategoriesResult result = null;
try {
result = executeDescribeEventCategories(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeEventSubscriptionsAsync(DescribeEventSubscriptionsRequest request) {
return describeEventSubscriptionsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeEventSubscriptionsAsync(final DescribeEventSubscriptionsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeEventSubscriptionsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeEventSubscriptionsResult call() throws Exception {
DescribeEventSubscriptionsResult result = null;
try {
result = executeDescribeEventSubscriptions(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeEventsAsync(DescribeEventsRequest request) {
return describeEventsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeEventsAsync(final DescribeEventsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeEventsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeEventsResult call() throws Exception {
DescribeEventsResult result = null;
try {
result = executeDescribeEvents(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeOrderableReplicationInstancesAsync(
DescribeOrderableReplicationInstancesRequest request) {
return describeOrderableReplicationInstancesAsync(request, null);
}
@Override
public java.util.concurrent.Future describeOrderableReplicationInstancesAsync(
final DescribeOrderableReplicationInstancesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeOrderableReplicationInstancesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeOrderableReplicationInstancesResult call() throws Exception {
DescribeOrderableReplicationInstancesResult result = null;
try {
result = executeDescribeOrderableReplicationInstances(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeRefreshSchemasStatusAsync(DescribeRefreshSchemasStatusRequest request) {
return describeRefreshSchemasStatusAsync(request, null);
}
@Override
public java.util.concurrent.Future describeRefreshSchemasStatusAsync(final DescribeRefreshSchemasStatusRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeRefreshSchemasStatusRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeRefreshSchemasStatusResult call() throws Exception {
DescribeRefreshSchemasStatusResult result = null;
try {
result = executeDescribeRefreshSchemasStatus(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeReplicationInstancesAsync(DescribeReplicationInstancesRequest request) {
return describeReplicationInstancesAsync(request, null);
}
@Override
public java.util.concurrent.Future describeReplicationInstancesAsync(final DescribeReplicationInstancesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeReplicationInstancesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeReplicationInstancesResult call() throws Exception {
DescribeReplicationInstancesResult result = null;
try {
result = executeDescribeReplicationInstances(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeReplicationSubnetGroupsAsync(
DescribeReplicationSubnetGroupsRequest request) {
return describeReplicationSubnetGroupsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeReplicationSubnetGroupsAsync(
final DescribeReplicationSubnetGroupsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeReplicationSubnetGroupsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeReplicationSubnetGroupsResult call() throws Exception {
DescribeReplicationSubnetGroupsResult result = null;
try {
result = executeDescribeReplicationSubnetGroups(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeReplicationTasksAsync(DescribeReplicationTasksRequest request) {
return describeReplicationTasksAsync(request, null);
}
@Override
public java.util.concurrent.Future describeReplicationTasksAsync(final DescribeReplicationTasksRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeReplicationTasksRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeReplicationTasksResult call() throws Exception {
DescribeReplicationTasksResult result = null;
try {
result = executeDescribeReplicationTasks(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeSchemasAsync(DescribeSchemasRequest request) {
return describeSchemasAsync(request, null);
}
@Override
public java.util.concurrent.Future describeSchemasAsync(final DescribeSchemasRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeSchemasRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeSchemasResult call() throws Exception {
DescribeSchemasResult result = null;
try {
result = executeDescribeSchemas(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future describeTableStatisticsAsync(DescribeTableStatisticsRequest request) {
return describeTableStatisticsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeTableStatisticsAsync(final DescribeTableStatisticsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeTableStatisticsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeTableStatisticsResult call() throws Exception {
DescribeTableStatisticsResult result = null;
try {
result = executeDescribeTableStatistics(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future importCertificateAsync(ImportCertificateRequest request) {
return importCertificateAsync(request, null);
}
@Override
public java.util.concurrent.Future importCertificateAsync(final ImportCertificateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ImportCertificateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ImportCertificateResult call() throws Exception {
ImportCertificateResult result = null;
try {
result = executeImportCertificate(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future listTagsForResourceAsync(ListTagsForResourceRequest request) {
return listTagsForResourceAsync(request, null);
}
@Override
public java.util.concurrent.Future listTagsForResourceAsync(final ListTagsForResourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListTagsForResourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListTagsForResourceResult call() throws Exception {
ListTagsForResourceResult result = null;
try {
result = executeListTagsForResource(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future modifyEndpointAsync(ModifyEndpointRequest request) {
return modifyEndpointAsync(request, null);
}
@Override
public java.util.concurrent.Future modifyEndpointAsync(final ModifyEndpointRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ModifyEndpointRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ModifyEndpointResult call() throws Exception {
ModifyEndpointResult result = null;
try {
result = executeModifyEndpoint(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future modifyEventSubscriptionAsync(ModifyEventSubscriptionRequest request) {
return modifyEventSubscriptionAsync(request, null);
}
@Override
public java.util.concurrent.Future modifyEventSubscriptionAsync(final ModifyEventSubscriptionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ModifyEventSubscriptionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ModifyEventSubscriptionResult call() throws Exception {
ModifyEventSubscriptionResult result = null;
try {
result = executeModifyEventSubscription(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future modifyReplicationInstanceAsync(ModifyReplicationInstanceRequest request) {
return modifyReplicationInstanceAsync(request, null);
}
@Override
public java.util.concurrent.Future modifyReplicationInstanceAsync(final ModifyReplicationInstanceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ModifyReplicationInstanceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ModifyReplicationInstanceResult call() throws Exception {
ModifyReplicationInstanceResult result = null;
try {
result = executeModifyReplicationInstance(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future modifyReplicationSubnetGroupAsync(ModifyReplicationSubnetGroupRequest request) {
return modifyReplicationSubnetGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future modifyReplicationSubnetGroupAsync(final ModifyReplicationSubnetGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ModifyReplicationSubnetGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ModifyReplicationSubnetGroupResult call() throws Exception {
ModifyReplicationSubnetGroupResult result = null;
try {
result = executeModifyReplicationSubnetGroup(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future modifyReplicationTaskAsync(ModifyReplicationTaskRequest request) {
return modifyReplicationTaskAsync(request, null);
}
@Override
public java.util.concurrent.Future modifyReplicationTaskAsync(final ModifyReplicationTaskRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ModifyReplicationTaskRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ModifyReplicationTaskResult call() throws Exception {
ModifyReplicationTaskResult result = null;
try {
result = executeModifyReplicationTask(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future refreshSchemasAsync(RefreshSchemasRequest request) {
return refreshSchemasAsync(request, null);
}
@Override
public java.util.concurrent.Future refreshSchemasAsync(final RefreshSchemasRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final RefreshSchemasRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public RefreshSchemasResult call() throws Exception {
RefreshSchemasResult result = null;
try {
result = executeRefreshSchemas(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future reloadTablesAsync(ReloadTablesRequest request) {
return reloadTablesAsync(request, null);
}
@Override
public java.util.concurrent.Future reloadTablesAsync(final ReloadTablesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ReloadTablesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ReloadTablesResult call() throws Exception {
ReloadTablesResult result = null;
try {
result = executeReloadTables(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future removeTagsFromResourceAsync(RemoveTagsFromResourceRequest request) {
return removeTagsFromResourceAsync(request, null);
}
@Override
public java.util.concurrent.Future removeTagsFromResourceAsync(final RemoveTagsFromResourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final RemoveTagsFromResourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public RemoveTagsFromResourceResult call() throws Exception {
RemoveTagsFromResourceResult result = null;
try {
result = executeRemoveTagsFromResource(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future startReplicationTaskAsync(StartReplicationTaskRequest request) {
return startReplicationTaskAsync(request, null);
}
@Override
public java.util.concurrent.Future startReplicationTaskAsync(final StartReplicationTaskRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartReplicationTaskRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartReplicationTaskResult call() throws Exception {
StartReplicationTaskResult result = null;
try {
result = executeStartReplicationTask(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future stopReplicationTaskAsync(StopReplicationTaskRequest request) {
return stopReplicationTaskAsync(request, null);
}
@Override
public java.util.concurrent.Future stopReplicationTaskAsync(final StopReplicationTaskRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StopReplicationTaskRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StopReplicationTaskResult call() throws Exception {
StopReplicationTaskResult result = null;
try {
result = executeStopReplicationTask(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future testConnectionAsync(TestConnectionRequest request) {
return testConnectionAsync(request, null);
}
@Override
public java.util.concurrent.Future testConnectionAsync(final TestConnectionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final TestConnectionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public TestConnectionResult call() throws Exception {
TestConnectionResult result = null;
try {
result = executeTestConnection(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Shuts down the client, releasing all managed resources. This includes forcibly terminating all pending
* asynchronous service calls. Clients who wish to give pending asynchronous service calls time to complete should
* call {@code getExecutorService().shutdown()} followed by {@code getExecutorService().awaitTermination()} prior to
* calling this method.
*/
@Override
public void shutdown() {
super.shutdown();
executorService.shutdownNow();
}
}