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

com.amazonaws.services.drs.AWSdrsAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Elastic Disaster Recovery module holds the client classes that are used for communicating with Elastic Disaster Recovery Service

There is a newer version: 1.12.772
Show newest version
/*
 * 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 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 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 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 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 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 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 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 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 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 retryDataReplicationAsync(RetryDataReplicationRequest request) { return retryDataReplicationAsync(request, null); } @Override 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 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 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 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(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy