com.amazonaws.services.drs.AWSdrsAsyncClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk-drs Show documentation
Show all versions of aws-java-sdk-drs Show documentation
The AWS Java SDK for Elastic Disaster Recovery module holds the client classes that are used for communicating with Elastic Disaster Recovery Service
/*
* Copyright 2018-2023 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.drs;
import javax.annotation.Generated;
import com.amazonaws.services.drs.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import java.util.concurrent.ExecutorService;
/**
* Client for accessing drs 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 Elastic Disaster Recovery Service.
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSdrsAsyncClient extends AWSdrsClient implements AWSdrsAsync {
private static final int DEFAULT_THREAD_POOL_SIZE = 50;
private final java.util.concurrent.ExecutorService executorService;
public static AWSdrsAsyncClientBuilder asyncBuilder() {
return AWSdrsAsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on drs using the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AWSdrsAsyncClient(AwsAsyncClientParams asyncClientParams) {
this(asyncClientParams, false);
}
/**
* Constructs a new asynchronous client to invoke service methods on drs using the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
* @param endpointDiscoveryEnabled
* true will enable endpoint discovery if the service supports it.
*/
AWSdrsAsyncClient(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 associateSourceNetworkStackAsync(AssociateSourceNetworkStackRequest request) {
return associateSourceNetworkStackAsync(request, null);
}
@Override
public java.util.concurrent.Future associateSourceNetworkStackAsync(final AssociateSourceNetworkStackRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AssociateSourceNetworkStackRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AssociateSourceNetworkStackResult call() throws Exception {
AssociateSourceNetworkStackResult result = null;
try {
result = executeAssociateSourceNetworkStack(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 createExtendedSourceServerAsync(CreateExtendedSourceServerRequest request) {
return createExtendedSourceServerAsync(request, null);
}
@Override
public java.util.concurrent.Future createExtendedSourceServerAsync(final CreateExtendedSourceServerRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateExtendedSourceServerRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateExtendedSourceServerResult call() throws Exception {
CreateExtendedSourceServerResult result = null;
try {
result = executeCreateExtendedSourceServer(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 createLaunchConfigurationTemplateAsync(
CreateLaunchConfigurationTemplateRequest request) {
return createLaunchConfigurationTemplateAsync(request, null);
}
@Override
public java.util.concurrent.Future createLaunchConfigurationTemplateAsync(
final CreateLaunchConfigurationTemplateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateLaunchConfigurationTemplateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateLaunchConfigurationTemplateResult call() throws Exception {
CreateLaunchConfigurationTemplateResult result = null;
try {
result = executeCreateLaunchConfigurationTemplate(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 createReplicationConfigurationTemplateAsync(
CreateReplicationConfigurationTemplateRequest request) {
return createReplicationConfigurationTemplateAsync(request, null);
}
@Override
public java.util.concurrent.Future createReplicationConfigurationTemplateAsync(
final CreateReplicationConfigurationTemplateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateReplicationConfigurationTemplateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateReplicationConfigurationTemplateResult call() throws Exception {
CreateReplicationConfigurationTemplateResult result = null;
try {
result = executeCreateReplicationConfigurationTemplate(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 createSourceNetworkAsync(CreateSourceNetworkRequest request) {
return createSourceNetworkAsync(request, null);
}
@Override
public java.util.concurrent.Future createSourceNetworkAsync(final CreateSourceNetworkRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateSourceNetworkRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateSourceNetworkResult call() throws Exception {
CreateSourceNetworkResult result = null;
try {
result = executeCreateSourceNetwork(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 deleteJobAsync(DeleteJobRequest request) {
return deleteJobAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteJobAsync(final DeleteJobRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteJobRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteJobResult call() throws Exception {
DeleteJobResult result = null;
try {
result = executeDeleteJob(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 deleteLaunchActionAsync(DeleteLaunchActionRequest request) {
return deleteLaunchActionAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteLaunchActionAsync(final DeleteLaunchActionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteLaunchActionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteLaunchActionResult call() throws Exception {
DeleteLaunchActionResult result = null;
try {
result = executeDeleteLaunchAction(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 deleteLaunchConfigurationTemplateAsync(
DeleteLaunchConfigurationTemplateRequest request) {
return deleteLaunchConfigurationTemplateAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteLaunchConfigurationTemplateAsync(
final DeleteLaunchConfigurationTemplateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteLaunchConfigurationTemplateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteLaunchConfigurationTemplateResult call() throws Exception {
DeleteLaunchConfigurationTemplateResult result = null;
try {
result = executeDeleteLaunchConfigurationTemplate(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 deleteRecoveryInstanceAsync(DeleteRecoveryInstanceRequest request) {
return deleteRecoveryInstanceAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteRecoveryInstanceAsync(final DeleteRecoveryInstanceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteRecoveryInstanceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteRecoveryInstanceResult call() throws Exception {
DeleteRecoveryInstanceResult result = null;
try {
result = executeDeleteRecoveryInstance(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 deleteReplicationConfigurationTemplateAsync(
DeleteReplicationConfigurationTemplateRequest request) {
return deleteReplicationConfigurationTemplateAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteReplicationConfigurationTemplateAsync(
final DeleteReplicationConfigurationTemplateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteReplicationConfigurationTemplateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteReplicationConfigurationTemplateResult call() throws Exception {
DeleteReplicationConfigurationTemplateResult result = null;
try {
result = executeDeleteReplicationConfigurationTemplate(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 deleteSourceNetworkAsync(DeleteSourceNetworkRequest request) {
return deleteSourceNetworkAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteSourceNetworkAsync(final DeleteSourceNetworkRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteSourceNetworkRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteSourceNetworkResult call() throws Exception {
DeleteSourceNetworkResult result = null;
try {
result = executeDeleteSourceNetwork(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 deleteSourceServerAsync(DeleteSourceServerRequest request) {
return deleteSourceServerAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteSourceServerAsync(final DeleteSourceServerRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteSourceServerRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteSourceServerResult call() throws Exception {
DeleteSourceServerResult result = null;
try {
result = executeDeleteSourceServer(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 describeJobLogItemsAsync(DescribeJobLogItemsRequest request) {
return describeJobLogItemsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeJobLogItemsAsync(final DescribeJobLogItemsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeJobLogItemsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeJobLogItemsResult call() throws Exception {
DescribeJobLogItemsResult result = null;
try {
result = executeDescribeJobLogItems(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 describeJobsAsync(DescribeJobsRequest request) {
return describeJobsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeJobsAsync(final DescribeJobsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeJobsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeJobsResult call() throws Exception {
DescribeJobsResult result = null;
try {
result = executeDescribeJobs(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 describeLaunchConfigurationTemplatesAsync(
DescribeLaunchConfigurationTemplatesRequest request) {
return describeLaunchConfigurationTemplatesAsync(request, null);
}
@Override
public java.util.concurrent.Future describeLaunchConfigurationTemplatesAsync(
final DescribeLaunchConfigurationTemplatesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeLaunchConfigurationTemplatesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeLaunchConfigurationTemplatesResult call() throws Exception {
DescribeLaunchConfigurationTemplatesResult result = null;
try {
result = executeDescribeLaunchConfigurationTemplates(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 describeRecoveryInstancesAsync(DescribeRecoveryInstancesRequest request) {
return describeRecoveryInstancesAsync(request, null);
}
@Override
public java.util.concurrent.Future describeRecoveryInstancesAsync(final DescribeRecoveryInstancesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeRecoveryInstancesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeRecoveryInstancesResult call() throws Exception {
DescribeRecoveryInstancesResult result = null;
try {
result = executeDescribeRecoveryInstances(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 describeRecoverySnapshotsAsync(DescribeRecoverySnapshotsRequest request) {
return describeRecoverySnapshotsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeRecoverySnapshotsAsync(final DescribeRecoverySnapshotsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeRecoverySnapshotsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeRecoverySnapshotsResult call() throws Exception {
DescribeRecoverySnapshotsResult result = null;
try {
result = executeDescribeRecoverySnapshots(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 describeReplicationConfigurationTemplatesAsync(
DescribeReplicationConfigurationTemplatesRequest request) {
return describeReplicationConfigurationTemplatesAsync(request, null);
}
@Override
public java.util.concurrent.Future describeReplicationConfigurationTemplatesAsync(
final DescribeReplicationConfigurationTemplatesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeReplicationConfigurationTemplatesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeReplicationConfigurationTemplatesResult call() throws Exception {
DescribeReplicationConfigurationTemplatesResult result = null;
try {
result = executeDescribeReplicationConfigurationTemplates(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 describeSourceNetworksAsync(DescribeSourceNetworksRequest request) {
return describeSourceNetworksAsync(request, null);
}
@Override
public java.util.concurrent.Future describeSourceNetworksAsync(final DescribeSourceNetworksRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeSourceNetworksRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeSourceNetworksResult call() throws Exception {
DescribeSourceNetworksResult result = null;
try {
result = executeDescribeSourceNetworks(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 describeSourceServersAsync(DescribeSourceServersRequest request) {
return describeSourceServersAsync(request, null);
}
@Override
public java.util.concurrent.Future describeSourceServersAsync(final DescribeSourceServersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeSourceServersRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeSourceServersResult call() throws Exception {
DescribeSourceServersResult result = null;
try {
result = executeDescribeSourceServers(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 disconnectRecoveryInstanceAsync(DisconnectRecoveryInstanceRequest request) {
return disconnectRecoveryInstanceAsync(request, null);
}
@Override
public java.util.concurrent.Future disconnectRecoveryInstanceAsync(final DisconnectRecoveryInstanceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DisconnectRecoveryInstanceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DisconnectRecoveryInstanceResult call() throws Exception {
DisconnectRecoveryInstanceResult result = null;
try {
result = executeDisconnectRecoveryInstance(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 disconnectSourceServerAsync(DisconnectSourceServerRequest request) {
return disconnectSourceServerAsync(request, null);
}
@Override
public java.util.concurrent.Future disconnectSourceServerAsync(final DisconnectSourceServerRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DisconnectSourceServerRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DisconnectSourceServerResult call() throws Exception {
DisconnectSourceServerResult result = null;
try {
result = executeDisconnectSourceServer(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 exportSourceNetworkCfnTemplateAsync(ExportSourceNetworkCfnTemplateRequest request) {
return exportSourceNetworkCfnTemplateAsync(request, null);
}
@Override
public java.util.concurrent.Future exportSourceNetworkCfnTemplateAsync(
final ExportSourceNetworkCfnTemplateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ExportSourceNetworkCfnTemplateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ExportSourceNetworkCfnTemplateResult call() throws Exception {
ExportSourceNetworkCfnTemplateResult result = null;
try {
result = executeExportSourceNetworkCfnTemplate(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 getFailbackReplicationConfigurationAsync(
GetFailbackReplicationConfigurationRequest request) {
return getFailbackReplicationConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future getFailbackReplicationConfigurationAsync(
final GetFailbackReplicationConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetFailbackReplicationConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetFailbackReplicationConfigurationResult call() throws Exception {
GetFailbackReplicationConfigurationResult result = null;
try {
result = executeGetFailbackReplicationConfiguration(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 getLaunchConfigurationAsync(GetLaunchConfigurationRequest request) {
return getLaunchConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future getLaunchConfigurationAsync(final GetLaunchConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetLaunchConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetLaunchConfigurationResult call() throws Exception {
GetLaunchConfigurationResult result = null;
try {
result = executeGetLaunchConfiguration(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 getReplicationConfigurationAsync(GetReplicationConfigurationRequest request) {
return getReplicationConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future getReplicationConfigurationAsync(final GetReplicationConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetReplicationConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetReplicationConfigurationResult call() throws Exception {
GetReplicationConfigurationResult result = null;
try {
result = executeGetReplicationConfiguration(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 initializeServiceAsync(InitializeServiceRequest request) {
return initializeServiceAsync(request, null);
}
@Override
public java.util.concurrent.Future initializeServiceAsync(final InitializeServiceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final InitializeServiceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public InitializeServiceResult call() throws Exception {
InitializeServiceResult result = null;
try {
result = executeInitializeService(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 listExtensibleSourceServersAsync(ListExtensibleSourceServersRequest request) {
return listExtensibleSourceServersAsync(request, null);
}
@Override
public java.util.concurrent.Future listExtensibleSourceServersAsync(final ListExtensibleSourceServersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListExtensibleSourceServersRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListExtensibleSourceServersResult call() throws Exception {
ListExtensibleSourceServersResult result = null;
try {
result = executeListExtensibleSourceServers(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 listLaunchActionsAsync(ListLaunchActionsRequest request) {
return listLaunchActionsAsync(request, null);
}
@Override
public java.util.concurrent.Future listLaunchActionsAsync(final ListLaunchActionsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListLaunchActionsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListLaunchActionsResult call() throws Exception {
ListLaunchActionsResult result = null;
try {
result = executeListLaunchActions(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 listStagingAccountsAsync(ListStagingAccountsRequest request) {
return listStagingAccountsAsync(request, null);
}
@Override
public java.util.concurrent.Future listStagingAccountsAsync(final ListStagingAccountsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListStagingAccountsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListStagingAccountsResult call() throws Exception {
ListStagingAccountsResult result = null;
try {
result = executeListStagingAccounts(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 putLaunchActionAsync(PutLaunchActionRequest request) {
return putLaunchActionAsync(request, null);
}
@Override
public java.util.concurrent.Future putLaunchActionAsync(final PutLaunchActionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final PutLaunchActionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public PutLaunchActionResult call() throws Exception {
PutLaunchActionResult result = null;
try {
result = executePutLaunchAction(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
@Deprecated
public java.util.concurrent.Future retryDataReplicationAsync(RetryDataReplicationRequest request) {
return retryDataReplicationAsync(request, null);
}
@Override
@Deprecated
public java.util.concurrent.Future retryDataReplicationAsync(final RetryDataReplicationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final RetryDataReplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public RetryDataReplicationResult call() throws Exception {
RetryDataReplicationResult result = null;
try {
result = executeRetryDataReplication(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 reverseReplicationAsync(ReverseReplicationRequest request) {
return reverseReplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future reverseReplicationAsync(final ReverseReplicationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ReverseReplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ReverseReplicationResult call() throws Exception {
ReverseReplicationResult result = null;
try {
result = executeReverseReplication(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 startFailbackLaunchAsync(StartFailbackLaunchRequest request) {
return startFailbackLaunchAsync(request, null);
}
@Override
public java.util.concurrent.Future startFailbackLaunchAsync(final StartFailbackLaunchRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartFailbackLaunchRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartFailbackLaunchResult call() throws Exception {
StartFailbackLaunchResult result = null;
try {
result = executeStartFailbackLaunch(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 startRecoveryAsync(StartRecoveryRequest request) {
return startRecoveryAsync(request, null);
}
@Override
public java.util.concurrent.Future startRecoveryAsync(final StartRecoveryRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartRecoveryRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartRecoveryResult call() throws Exception {
StartRecoveryResult result = null;
try {
result = executeStartRecovery(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 startReplicationAsync(StartReplicationRequest request) {
return startReplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future startReplicationAsync(final StartReplicationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartReplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartReplicationResult call() throws Exception {
StartReplicationResult result = null;
try {
result = executeStartReplication(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 startSourceNetworkRecoveryAsync(StartSourceNetworkRecoveryRequest request) {
return startSourceNetworkRecoveryAsync(request, null);
}
@Override
public java.util.concurrent.Future startSourceNetworkRecoveryAsync(final StartSourceNetworkRecoveryRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartSourceNetworkRecoveryRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartSourceNetworkRecoveryResult call() throws Exception {
StartSourceNetworkRecoveryResult result = null;
try {
result = executeStartSourceNetworkRecovery(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 startSourceNetworkReplicationAsync(StartSourceNetworkReplicationRequest request) {
return startSourceNetworkReplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future startSourceNetworkReplicationAsync(
final StartSourceNetworkReplicationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartSourceNetworkReplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartSourceNetworkReplicationResult call() throws Exception {
StartSourceNetworkReplicationResult result = null;
try {
result = executeStartSourceNetworkReplication(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 stopFailbackAsync(StopFailbackRequest request) {
return stopFailbackAsync(request, null);
}
@Override
public java.util.concurrent.Future stopFailbackAsync(final StopFailbackRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StopFailbackRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StopFailbackResult call() throws Exception {
StopFailbackResult result = null;
try {
result = executeStopFailback(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 stopReplicationAsync(StopReplicationRequest request) {
return stopReplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future stopReplicationAsync(final StopReplicationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StopReplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StopReplicationResult call() throws Exception {
StopReplicationResult result = null;
try {
result = executeStopReplication(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 stopSourceNetworkReplicationAsync(StopSourceNetworkReplicationRequest request) {
return stopSourceNetworkReplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future stopSourceNetworkReplicationAsync(final StopSourceNetworkReplicationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StopSourceNetworkReplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StopSourceNetworkReplicationResult call() throws Exception {
StopSourceNetworkReplicationResult result = null;
try {
result = executeStopSourceNetworkReplication(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 tagResourceAsync(TagResourceRequest request) {
return tagResourceAsync(request, null);
}
@Override
public java.util.concurrent.Future tagResourceAsync(final TagResourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final TagResourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public TagResourceResult call() throws Exception {
TagResourceResult result = null;
try {
result = executeTagResource(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 terminateRecoveryInstancesAsync(TerminateRecoveryInstancesRequest request) {
return terminateRecoveryInstancesAsync(request, null);
}
@Override
public java.util.concurrent.Future terminateRecoveryInstancesAsync(final TerminateRecoveryInstancesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final TerminateRecoveryInstancesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public TerminateRecoveryInstancesResult call() throws Exception {
TerminateRecoveryInstancesResult result = null;
try {
result = executeTerminateRecoveryInstances(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 untagResourceAsync(UntagResourceRequest request) {
return untagResourceAsync(request, null);
}
@Override
public java.util.concurrent.Future untagResourceAsync(final UntagResourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UntagResourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UntagResourceResult call() throws Exception {
UntagResourceResult result = null;
try {
result = executeUntagResource(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 updateFailbackReplicationConfigurationAsync(
UpdateFailbackReplicationConfigurationRequest request) {
return updateFailbackReplicationConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future updateFailbackReplicationConfigurationAsync(
final UpdateFailbackReplicationConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateFailbackReplicationConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateFailbackReplicationConfigurationResult call() throws Exception {
UpdateFailbackReplicationConfigurationResult result = null;
try {
result = executeUpdateFailbackReplicationConfiguration(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 updateLaunchConfigurationAsync(UpdateLaunchConfigurationRequest request) {
return updateLaunchConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future updateLaunchConfigurationAsync(final UpdateLaunchConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateLaunchConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateLaunchConfigurationResult call() throws Exception {
UpdateLaunchConfigurationResult result = null;
try {
result = executeUpdateLaunchConfiguration(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 updateLaunchConfigurationTemplateAsync(
UpdateLaunchConfigurationTemplateRequest request) {
return updateLaunchConfigurationTemplateAsync(request, null);
}
@Override
public java.util.concurrent.Future updateLaunchConfigurationTemplateAsync(
final UpdateLaunchConfigurationTemplateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateLaunchConfigurationTemplateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateLaunchConfigurationTemplateResult call() throws Exception {
UpdateLaunchConfigurationTemplateResult result = null;
try {
result = executeUpdateLaunchConfigurationTemplate(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 updateReplicationConfigurationAsync(UpdateReplicationConfigurationRequest request) {
return updateReplicationConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future updateReplicationConfigurationAsync(
final UpdateReplicationConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateReplicationConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateReplicationConfigurationResult call() throws Exception {
UpdateReplicationConfigurationResult result = null;
try {
result = executeUpdateReplicationConfiguration(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 updateReplicationConfigurationTemplateAsync(
UpdateReplicationConfigurationTemplateRequest request) {
return updateReplicationConfigurationTemplateAsync(request, null);
}
@Override
public java.util.concurrent.Future updateReplicationConfigurationTemplateAsync(
final UpdateReplicationConfigurationTemplateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateReplicationConfigurationTemplateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateReplicationConfigurationTemplateResult call() throws Exception {
UpdateReplicationConfigurationTemplateResult result = null;
try {
result = executeUpdateReplicationConfigurationTemplate(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();
}
}