All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.docdb.AmazonDocDBAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon DocumentDB with MongoDB compatibility module holds the client classes that are used for communicating with Amazon DocumentDB with MongoDB compatibility Service

There is a newer version: 1.12.778
Show newest version
/*
 * Copyright 2019-2024 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.docdb;

import javax.annotation.Generated;

import com.amazonaws.services.docdb.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;

import java.util.concurrent.ExecutorService;

/**
 * Client for accessing Amazon DocDB 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.
 * 

*

* Amazon DocumentDB is a fast, reliable, and fully managed database service. Amazon DocumentDB makes it easy to set up, * operate, and scale MongoDB-compatible databases in the cloud. With Amazon DocumentDB, you can run the same * application code and use the same drivers and tools that you use with MongoDB. *

*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AmazonDocDBAsyncClient extends AmazonDocDBClient implements AmazonDocDBAsync { private static final int DEFAULT_THREAD_POOL_SIZE = 50; private final java.util.concurrent.ExecutorService executorService; public static AmazonDocDBAsyncClientBuilder asyncBuilder() { return AmazonDocDBAsyncClientBuilder.standard(); } /** * Constructs a new asynchronous client to invoke service methods on Amazon DocDB using the specified parameters. * * @param asyncClientParams * Object providing client parameters. */ AmazonDocDBAsyncClient(AwsAsyncClientParams asyncClientParams) { this(asyncClientParams, false); } /** * Constructs a new asynchronous client to invoke service methods on Amazon DocDB using the specified parameters. * * @param asyncClientParams * Object providing client parameters. * @param endpointDiscoveryEnabled * true will enable endpoint discovery if the service supports it. */ AmazonDocDBAsyncClient(AwsAsyncClientParams asyncClientParams, boolean endpointDiscoveryEnabled) { super(asyncClientParams, endpointDiscoveryEnabled); 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 addSourceIdentifierToSubscriptionAsync(AddSourceIdentifierToSubscriptionRequest request) { return addSourceIdentifierToSubscriptionAsync(request, null); } @Override public java.util.concurrent.Future addSourceIdentifierToSubscriptionAsync(final AddSourceIdentifierToSubscriptionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final AddSourceIdentifierToSubscriptionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public EventSubscription call() throws Exception { EventSubscription result = null; try { result = executeAddSourceIdentifierToSubscription(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 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 applyPendingMaintenanceActionAsync(ApplyPendingMaintenanceActionRequest request) { return applyPendingMaintenanceActionAsync(request, null); } @Override public java.util.concurrent.Future applyPendingMaintenanceActionAsync( final ApplyPendingMaintenanceActionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ApplyPendingMaintenanceActionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ResourcePendingMaintenanceActions call() throws Exception { ResourcePendingMaintenanceActions result = null; try { result = executeApplyPendingMaintenanceAction(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 copyDBClusterParameterGroupAsync(CopyDBClusterParameterGroupRequest request) { return copyDBClusterParameterGroupAsync(request, null); } @Override public java.util.concurrent.Future copyDBClusterParameterGroupAsync(final CopyDBClusterParameterGroupRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CopyDBClusterParameterGroupRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBClusterParameterGroup call() throws Exception { DBClusterParameterGroup result = null; try { result = executeCopyDBClusterParameterGroup(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 copyDBClusterSnapshotAsync(CopyDBClusterSnapshotRequest request) { return copyDBClusterSnapshotAsync(request, null); } @Override public java.util.concurrent.Future copyDBClusterSnapshotAsync(final CopyDBClusterSnapshotRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CopyDBClusterSnapshotRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBClusterSnapshot call() throws Exception { DBClusterSnapshot result = null; try { result = executeCopyDBClusterSnapshot(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 createDBClusterAsync(CreateDBClusterRequest request) { return createDBClusterAsync(request, null); } @Override public java.util.concurrent.Future createDBClusterAsync(final CreateDBClusterRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateDBClusterRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBCluster call() throws Exception { DBCluster result = null; try { result = executeCreateDBCluster(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 createDBClusterParameterGroupAsync(CreateDBClusterParameterGroupRequest request) { return createDBClusterParameterGroupAsync(request, null); } @Override public java.util.concurrent.Future createDBClusterParameterGroupAsync(final CreateDBClusterParameterGroupRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateDBClusterParameterGroupRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBClusterParameterGroup call() throws Exception { DBClusterParameterGroup result = null; try { result = executeCreateDBClusterParameterGroup(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 createDBClusterSnapshotAsync(CreateDBClusterSnapshotRequest request) { return createDBClusterSnapshotAsync(request, null); } @Override public java.util.concurrent.Future createDBClusterSnapshotAsync(final CreateDBClusterSnapshotRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateDBClusterSnapshotRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBClusterSnapshot call() throws Exception { DBClusterSnapshot result = null; try { result = executeCreateDBClusterSnapshot(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 createDBInstanceAsync(CreateDBInstanceRequest request) { return createDBInstanceAsync(request, null); } @Override public java.util.concurrent.Future createDBInstanceAsync(final CreateDBInstanceRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateDBInstanceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBInstance call() throws Exception { DBInstance result = null; try { result = executeCreateDBInstance(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 createDBSubnetGroupAsync(CreateDBSubnetGroupRequest request) { return createDBSubnetGroupAsync(request, null); } @Override public java.util.concurrent.Future createDBSubnetGroupAsync(final CreateDBSubnetGroupRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateDBSubnetGroupRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBSubnetGroup call() throws Exception { DBSubnetGroup result = null; try { result = executeCreateDBSubnetGroup(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 EventSubscription call() throws Exception { EventSubscription 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 createGlobalClusterAsync(CreateGlobalClusterRequest request) { return createGlobalClusterAsync(request, null); } @Override public java.util.concurrent.Future createGlobalClusterAsync(final CreateGlobalClusterRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateGlobalClusterRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GlobalCluster call() throws Exception { GlobalCluster result = null; try { result = executeCreateGlobalCluster(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 deleteDBClusterAsync(DeleteDBClusterRequest request) { return deleteDBClusterAsync(request, null); } @Override public java.util.concurrent.Future deleteDBClusterAsync(final DeleteDBClusterRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteDBClusterRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBCluster call() throws Exception { DBCluster result = null; try { result = executeDeleteDBCluster(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 deleteDBClusterParameterGroupAsync(DeleteDBClusterParameterGroupRequest request) { return deleteDBClusterParameterGroupAsync(request, null); } @Override public java.util.concurrent.Future deleteDBClusterParameterGroupAsync( final DeleteDBClusterParameterGroupRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteDBClusterParameterGroupRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteDBClusterParameterGroupResult call() throws Exception { DeleteDBClusterParameterGroupResult result = null; try { result = executeDeleteDBClusterParameterGroup(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 deleteDBClusterSnapshotAsync(DeleteDBClusterSnapshotRequest request) { return deleteDBClusterSnapshotAsync(request, null); } @Override public java.util.concurrent.Future deleteDBClusterSnapshotAsync(final DeleteDBClusterSnapshotRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteDBClusterSnapshotRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBClusterSnapshot call() throws Exception { DBClusterSnapshot result = null; try { result = executeDeleteDBClusterSnapshot(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 deleteDBInstanceAsync(DeleteDBInstanceRequest request) { return deleteDBInstanceAsync(request, null); } @Override public java.util.concurrent.Future deleteDBInstanceAsync(final DeleteDBInstanceRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteDBInstanceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBInstance call() throws Exception { DBInstance result = null; try { result = executeDeleteDBInstance(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 deleteDBSubnetGroupAsync(DeleteDBSubnetGroupRequest request) { return deleteDBSubnetGroupAsync(request, null); } @Override public java.util.concurrent.Future deleteDBSubnetGroupAsync(final DeleteDBSubnetGroupRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteDBSubnetGroupRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteDBSubnetGroupResult call() throws Exception { DeleteDBSubnetGroupResult result = null; try { result = executeDeleteDBSubnetGroup(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 EventSubscription call() throws Exception { EventSubscription 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 deleteGlobalClusterAsync(DeleteGlobalClusterRequest request) { return deleteGlobalClusterAsync(request, null); } @Override public java.util.concurrent.Future deleteGlobalClusterAsync(final DeleteGlobalClusterRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteGlobalClusterRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GlobalCluster call() throws Exception { GlobalCluster result = null; try { result = executeDeleteGlobalCluster(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 describeDBClusterParameterGroupsAsync( DescribeDBClusterParameterGroupsRequest request) { return describeDBClusterParameterGroupsAsync(request, null); } @Override public java.util.concurrent.Future describeDBClusterParameterGroupsAsync( final DescribeDBClusterParameterGroupsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeDBClusterParameterGroupsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeDBClusterParameterGroupsResult call() throws Exception { DescribeDBClusterParameterGroupsResult result = null; try { result = executeDescribeDBClusterParameterGroups(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 describeDBClusterParametersAsync(DescribeDBClusterParametersRequest request) { return describeDBClusterParametersAsync(request, null); } @Override public java.util.concurrent.Future describeDBClusterParametersAsync(final DescribeDBClusterParametersRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeDBClusterParametersRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeDBClusterParametersResult call() throws Exception { DescribeDBClusterParametersResult result = null; try { result = executeDescribeDBClusterParameters(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 describeDBClusterSnapshotAttributesAsync( DescribeDBClusterSnapshotAttributesRequest request) { return describeDBClusterSnapshotAttributesAsync(request, null); } @Override public java.util.concurrent.Future describeDBClusterSnapshotAttributesAsync( final DescribeDBClusterSnapshotAttributesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeDBClusterSnapshotAttributesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBClusterSnapshotAttributesResult call() throws Exception { DBClusterSnapshotAttributesResult result = null; try { result = executeDescribeDBClusterSnapshotAttributes(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 describeDBClusterSnapshotsAsync(DescribeDBClusterSnapshotsRequest request) { return describeDBClusterSnapshotsAsync(request, null); } @Override public java.util.concurrent.Future describeDBClusterSnapshotsAsync(final DescribeDBClusterSnapshotsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeDBClusterSnapshotsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeDBClusterSnapshotsResult call() throws Exception { DescribeDBClusterSnapshotsResult result = null; try { result = executeDescribeDBClusterSnapshots(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 describeDBClustersAsync(DescribeDBClustersRequest request) { return describeDBClustersAsync(request, null); } @Override public java.util.concurrent.Future describeDBClustersAsync(final DescribeDBClustersRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeDBClustersRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeDBClustersResult call() throws Exception { DescribeDBClustersResult result = null; try { result = executeDescribeDBClusters(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 describeDBEngineVersionsAsync(DescribeDBEngineVersionsRequest request) { return describeDBEngineVersionsAsync(request, null); } @Override public java.util.concurrent.Future describeDBEngineVersionsAsync(final DescribeDBEngineVersionsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeDBEngineVersionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeDBEngineVersionsResult call() throws Exception { DescribeDBEngineVersionsResult result = null; try { result = executeDescribeDBEngineVersions(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 describeDBInstancesAsync(DescribeDBInstancesRequest request) { return describeDBInstancesAsync(request, null); } @Override public java.util.concurrent.Future describeDBInstancesAsync(final DescribeDBInstancesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeDBInstancesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeDBInstancesResult call() throws Exception { DescribeDBInstancesResult result = null; try { result = executeDescribeDBInstances(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 describeDBSubnetGroupsAsync(DescribeDBSubnetGroupsRequest request) { return describeDBSubnetGroupsAsync(request, null); } @Override public java.util.concurrent.Future describeDBSubnetGroupsAsync(final DescribeDBSubnetGroupsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeDBSubnetGroupsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeDBSubnetGroupsResult call() throws Exception { DescribeDBSubnetGroupsResult result = null; try { result = executeDescribeDBSubnetGroups(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 describeEngineDefaultClusterParametersAsync(DescribeEngineDefaultClusterParametersRequest request) { return describeEngineDefaultClusterParametersAsync(request, null); } @Override public java.util.concurrent.Future describeEngineDefaultClusterParametersAsync(final DescribeEngineDefaultClusterParametersRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeEngineDefaultClusterParametersRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public EngineDefaults call() throws Exception { EngineDefaults result = null; try { result = executeDescribeEngineDefaultClusterParameters(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 describeGlobalClustersAsync(DescribeGlobalClustersRequest request) { return describeGlobalClustersAsync(request, null); } @Override public java.util.concurrent.Future describeGlobalClustersAsync(final DescribeGlobalClustersRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeGlobalClustersRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeGlobalClustersResult call() throws Exception { DescribeGlobalClustersResult result = null; try { result = executeDescribeGlobalClusters(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 describeOrderableDBInstanceOptionsAsync( DescribeOrderableDBInstanceOptionsRequest request) { return describeOrderableDBInstanceOptionsAsync(request, null); } @Override public java.util.concurrent.Future describeOrderableDBInstanceOptionsAsync( final DescribeOrderableDBInstanceOptionsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeOrderableDBInstanceOptionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeOrderableDBInstanceOptionsResult call() throws Exception { DescribeOrderableDBInstanceOptionsResult result = null; try { result = executeDescribeOrderableDBInstanceOptions(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 describePendingMaintenanceActionsAsync( DescribePendingMaintenanceActionsRequest request) { return describePendingMaintenanceActionsAsync(request, null); } @Override public java.util.concurrent.Future describePendingMaintenanceActionsAsync( final DescribePendingMaintenanceActionsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribePendingMaintenanceActionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribePendingMaintenanceActionsResult call() throws Exception { DescribePendingMaintenanceActionsResult result = null; try { result = executeDescribePendingMaintenanceActions(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 failoverDBClusterAsync(FailoverDBClusterRequest request) { return failoverDBClusterAsync(request, null); } @Override public java.util.concurrent.Future failoverDBClusterAsync(final FailoverDBClusterRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final FailoverDBClusterRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBCluster call() throws Exception { DBCluster result = null; try { result = executeFailoverDBCluster(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 modifyDBClusterAsync(ModifyDBClusterRequest request) { return modifyDBClusterAsync(request, null); } @Override public java.util.concurrent.Future modifyDBClusterAsync(final ModifyDBClusterRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ModifyDBClusterRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBCluster call() throws Exception { DBCluster result = null; try { result = executeModifyDBCluster(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 modifyDBClusterParameterGroupAsync(ModifyDBClusterParameterGroupRequest request) { return modifyDBClusterParameterGroupAsync(request, null); } @Override public java.util.concurrent.Future modifyDBClusterParameterGroupAsync( final ModifyDBClusterParameterGroupRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ModifyDBClusterParameterGroupRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ModifyDBClusterParameterGroupResult call() throws Exception { ModifyDBClusterParameterGroupResult result = null; try { result = executeModifyDBClusterParameterGroup(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 modifyDBClusterSnapshotAttributeAsync(ModifyDBClusterSnapshotAttributeRequest request) { return modifyDBClusterSnapshotAttributeAsync(request, null); } @Override public java.util.concurrent.Future modifyDBClusterSnapshotAttributeAsync( final ModifyDBClusterSnapshotAttributeRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ModifyDBClusterSnapshotAttributeRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBClusterSnapshotAttributesResult call() throws Exception { DBClusterSnapshotAttributesResult result = null; try { result = executeModifyDBClusterSnapshotAttribute(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 modifyDBInstanceAsync(ModifyDBInstanceRequest request) { return modifyDBInstanceAsync(request, null); } @Override public java.util.concurrent.Future modifyDBInstanceAsync(final ModifyDBInstanceRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ModifyDBInstanceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBInstance call() throws Exception { DBInstance result = null; try { result = executeModifyDBInstance(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 modifyDBSubnetGroupAsync(ModifyDBSubnetGroupRequest request) { return modifyDBSubnetGroupAsync(request, null); } @Override public java.util.concurrent.Future modifyDBSubnetGroupAsync(final ModifyDBSubnetGroupRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ModifyDBSubnetGroupRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBSubnetGroup call() throws Exception { DBSubnetGroup result = null; try { result = executeModifyDBSubnetGroup(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 EventSubscription call() throws Exception { EventSubscription 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 modifyGlobalClusterAsync(ModifyGlobalClusterRequest request) { return modifyGlobalClusterAsync(request, null); } @Override public java.util.concurrent.Future modifyGlobalClusterAsync(final ModifyGlobalClusterRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ModifyGlobalClusterRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GlobalCluster call() throws Exception { GlobalCluster result = null; try { result = executeModifyGlobalCluster(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 rebootDBInstanceAsync(RebootDBInstanceRequest request) { return rebootDBInstanceAsync(request, null); } @Override public java.util.concurrent.Future rebootDBInstanceAsync(final RebootDBInstanceRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final RebootDBInstanceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBInstance call() throws Exception { DBInstance result = null; try { result = executeRebootDBInstance(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 removeFromGlobalClusterAsync(RemoveFromGlobalClusterRequest request) { return removeFromGlobalClusterAsync(request, null); } @Override public java.util.concurrent.Future removeFromGlobalClusterAsync(final RemoveFromGlobalClusterRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final RemoveFromGlobalClusterRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GlobalCluster call() throws Exception { GlobalCluster result = null; try { result = executeRemoveFromGlobalCluster(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 removeSourceIdentifierFromSubscriptionAsync(RemoveSourceIdentifierFromSubscriptionRequest request) { return removeSourceIdentifierFromSubscriptionAsync(request, null); } @Override public java.util.concurrent.Future removeSourceIdentifierFromSubscriptionAsync( final RemoveSourceIdentifierFromSubscriptionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final RemoveSourceIdentifierFromSubscriptionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public EventSubscription call() throws Exception { EventSubscription result = null; try { result = executeRemoveSourceIdentifierFromSubscription(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 resetDBClusterParameterGroupAsync(ResetDBClusterParameterGroupRequest request) { return resetDBClusterParameterGroupAsync(request, null); } @Override public java.util.concurrent.Future resetDBClusterParameterGroupAsync(final ResetDBClusterParameterGroupRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ResetDBClusterParameterGroupRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ResetDBClusterParameterGroupResult call() throws Exception { ResetDBClusterParameterGroupResult result = null; try { result = executeResetDBClusterParameterGroup(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 restoreDBClusterFromSnapshotAsync(RestoreDBClusterFromSnapshotRequest request) { return restoreDBClusterFromSnapshotAsync(request, null); } @Override public java.util.concurrent.Future restoreDBClusterFromSnapshotAsync(final RestoreDBClusterFromSnapshotRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final RestoreDBClusterFromSnapshotRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBCluster call() throws Exception { DBCluster result = null; try { result = executeRestoreDBClusterFromSnapshot(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 restoreDBClusterToPointInTimeAsync(RestoreDBClusterToPointInTimeRequest request) { return restoreDBClusterToPointInTimeAsync(request, null); } @Override public java.util.concurrent.Future restoreDBClusterToPointInTimeAsync(final RestoreDBClusterToPointInTimeRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final RestoreDBClusterToPointInTimeRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBCluster call() throws Exception { DBCluster result = null; try { result = executeRestoreDBClusterToPointInTime(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 startDBClusterAsync(StartDBClusterRequest request) { return startDBClusterAsync(request, null); } @Override public java.util.concurrent.Future startDBClusterAsync(final StartDBClusterRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final StartDBClusterRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBCluster call() throws Exception { DBCluster result = null; try { result = executeStartDBCluster(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 stopDBClusterAsync(StopDBClusterRequest request) { return stopDBClusterAsync(request, null); } @Override public java.util.concurrent.Future stopDBClusterAsync(final StopDBClusterRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final StopDBClusterRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DBCluster call() throws Exception { DBCluster result = null; try { result = executeStopDBCluster(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 switchoverGlobalClusterAsync(SwitchoverGlobalClusterRequest request) { return switchoverGlobalClusterAsync(request, null); } @Override public java.util.concurrent.Future switchoverGlobalClusterAsync(final SwitchoverGlobalClusterRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final SwitchoverGlobalClusterRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GlobalCluster call() throws Exception { GlobalCluster result = null; try { result = executeSwitchoverGlobalCluster(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(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy