com.amazonaws.services.servermigration.AWSServerMigrationAsyncClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-servermigration Show documentation
/*
* 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.servermigration;
import static java.util.concurrent.Executors.newFixedThreadPool;
import javax.annotation.Generated;
import com.amazonaws.services.servermigration.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSCredentialsProvider;
import java.util.concurrent.ExecutorService;
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
/**
* Client for accessing SMS 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.
*
*
*
* Product update
*
*
* We recommend Amazon Web Services Application Migration
* Service (Amazon Web Services MGN) as the primary migration service for lift-and-shift migrations. If Amazon Web
* Services MGN is unavailable in a specific Amazon Web Services Region, you can use the Server Migration Service APIs
* through March 2023.
*
*
*
* Server Migration Service (Server Migration Service) makes it easier and faster for you to migrate your on-premises
* workloads to Amazon Web Services. To learn more about Server Migration Service, see the following resources:
*
*
* -
*
*
* -
*
*
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSServerMigrationAsyncClient extends AWSServerMigrationClient implements AWSServerMigrationAsync {
private static final int DEFAULT_THREAD_POOL_SIZE = 50;
private final java.util.concurrent.ExecutorService executorService;
/**
* Constructs a new asynchronous client to invoke service methods on SMS. A credentials provider chain will be used
* that searches for credentials in this order:
*
* - Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
* - Java System Properties - aws.accessKeyId and aws.secretKey
* - Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
* - Instance profile credentials delivered through the Amazon EC2 metadata service
*
*
* Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default
* maximum number of concurrent connections to the service).
*
* @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
* @deprecated use {@link AWSServerMigrationAsyncClientBuilder#defaultClient()}
*/
@Deprecated
public AWSServerMigrationAsyncClient() {
this(DefaultAWSCredentialsProviderChain.getInstance());
}
/**
* Constructs a new asynchronous client to invoke service methods on SMS. A credentials provider chain will be used
* that searches for credentials in this order:
*
* - Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
* - Java System Properties - aws.accessKeyId and aws.secretKey
* - Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
* - Instance profile credentials delivered through the Amazon EC2 metadata service
*
*
* Asynchronous methods are delegated to a fixed-size thread pool containing a number of threads equal to the
* maximum number of concurrent connections configured via {@code ClientConfiguration.getMaxConnections()}.
*
* @param clientConfiguration
* The client configuration options controlling how this client connects to SMS (ex: proxy settings, retry
* counts, etc).
*
* @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
* @deprecated use {@link AWSServerMigrationAsyncClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AWSServerMigrationAsyncClient(ClientConfiguration clientConfiguration) {
this(DefaultAWSCredentialsProviderChain.getInstance(), clientConfiguration, newFixedThreadPool(clientConfiguration.getMaxConnections()));
}
/**
* Constructs a new asynchronous client to invoke service methods on SMS using the specified AWS account
* credentials.
*
* Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default
* maximum number of concurrent connections to the service).
*
* @param awsCredentials
* The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
* @deprecated use {@link AWSServerMigrationAsyncClientBuilder#withCredentials(AWSCredentialsProvider)}
*/
@Deprecated
public AWSServerMigrationAsyncClient(AWSCredentials awsCredentials) {
this(awsCredentials, newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE));
}
/**
* Constructs a new asynchronous client to invoke service methods on SMS using the specified AWS account credentials
* and executor service. Default client settings will be used.
*
* @param awsCredentials
* The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
* @param executorService
* The executor service by which all asynchronous requests will be executed.
* @deprecated use {@link AWSServerMigrationAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AWSServerMigrationAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AWSServerMigrationAsyncClient(AWSCredentials awsCredentials, ExecutorService executorService) {
this(awsCredentials, configFactory.getConfig(), executorService);
}
/**
* Constructs a new asynchronous client to invoke service methods on SMS using the specified AWS account
* credentials, executor service, and client configuration options.
*
* @param awsCredentials
* The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
* @param clientConfiguration
* Client configuration options (ex: max retry limit, proxy settings, etc).
* @param executorService
* The executor service by which all asynchronous requests will be executed.
* @deprecated use {@link AWSServerMigrationAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AWSServerMigrationAsyncClientBuilder#withClientConfiguration(ClientConfiguration)} and
* {@link AWSServerMigrationAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AWSServerMigrationAsyncClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration, ExecutorService executorService) {
super(awsCredentials, clientConfiguration);
this.executorService = executorService;
}
/**
* Constructs a new asynchronous client to invoke service methods on SMS using the specified AWS account credentials
* provider. Default client settings will be used.
*
* Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default
* maximum number of concurrent connections to the service).
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
* @deprecated use {@link AWSServerMigrationAsyncClientBuilder#withCredentials(AWSCredentialsProvider)}
*/
@Deprecated
public AWSServerMigrationAsyncClient(AWSCredentialsProvider awsCredentialsProvider) {
this(awsCredentialsProvider, newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE));
}
/**
* Constructs a new asynchronous client to invoke service methods on SMS using the provided AWS account credentials
* provider and client configuration options.
*
* Asynchronous methods are delegated to a fixed-size thread pool containing a number of threads equal to the
* maximum number of concurrent connections configured via {@code ClientConfiguration.getMaxConnections()}.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
* @param clientConfiguration
* Client configuration options (ex: max retry limit, proxy settings, etc).
*
* @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
* @deprecated use {@link AWSServerMigrationAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AWSServerMigrationAsyncClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AWSServerMigrationAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) {
this(awsCredentialsProvider, clientConfiguration, newFixedThreadPool(clientConfiguration.getMaxConnections()));
}
/**
* Constructs a new asynchronous client to invoke service methods on SMS using the specified AWS account credentials
* provider and executor service. Default client settings will be used.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
* @param executorService
* The executor service by which all asynchronous requests will be executed.
* @deprecated use {@link AWSServerMigrationAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AWSServerMigrationAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AWSServerMigrationAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ExecutorService executorService) {
this(awsCredentialsProvider, configFactory.getConfig(), executorService);
}
/**
* Constructs a new asynchronous client to invoke service methods on SMS using the specified AWS account credentials
* provider, executor service, and client configuration options.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
* @param clientConfiguration
* Client configuration options (ex: max retry limit, proxy settings, etc).
* @param executorService
* The executor service by which all asynchronous requests will be executed.
* @deprecated use {@link AWSServerMigrationAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AWSServerMigrationAsyncClientBuilder#withClientConfiguration(ClientConfiguration)} and
* {@link AWSServerMigrationAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AWSServerMigrationAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, ExecutorService executorService) {
super(awsCredentialsProvider, clientConfiguration);
this.executorService = executorService;
}
public static AWSServerMigrationAsyncClientBuilder asyncBuilder() {
return AWSServerMigrationAsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on SMS using the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AWSServerMigrationAsyncClient(AwsAsyncClientParams asyncClientParams) {
this(asyncClientParams, false);
}
/**
* Constructs a new asynchronous client to invoke service methods on SMS using the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
* @param endpointDiscoveryEnabled
* true will enable endpoint discovery if the service supports it.
*/
AWSServerMigrationAsyncClient(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 createAppAsync(CreateAppRequest request) {
return createAppAsync(request, null);
}
@Override
public java.util.concurrent.Future createAppAsync(final CreateAppRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateAppRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateAppResult call() throws Exception {
CreateAppResult result = null;
try {
result = executeCreateApp(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 createReplicationJobAsync(CreateReplicationJobRequest request) {
return createReplicationJobAsync(request, null);
}
@Override
public java.util.concurrent.Future createReplicationJobAsync(final CreateReplicationJobRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateReplicationJobRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateReplicationJobResult call() throws Exception {
CreateReplicationJobResult result = null;
try {
result = executeCreateReplicationJob(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 deleteAppAsync(DeleteAppRequest request) {
return deleteAppAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteAppAsync(final DeleteAppRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteAppRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteAppResult call() throws Exception {
DeleteAppResult result = null;
try {
result = executeDeleteApp(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 deleteAppLaunchConfigurationAsync(DeleteAppLaunchConfigurationRequest request) {
return deleteAppLaunchConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteAppLaunchConfigurationAsync(final DeleteAppLaunchConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteAppLaunchConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteAppLaunchConfigurationResult call() throws Exception {
DeleteAppLaunchConfigurationResult result = null;
try {
result = executeDeleteAppLaunchConfiguration(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 deleteAppReplicationConfigurationAsync(
DeleteAppReplicationConfigurationRequest request) {
return deleteAppReplicationConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteAppReplicationConfigurationAsync(
final DeleteAppReplicationConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteAppReplicationConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteAppReplicationConfigurationResult call() throws Exception {
DeleteAppReplicationConfigurationResult result = null;
try {
result = executeDeleteAppReplicationConfiguration(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 deleteAppValidationConfigurationAsync(
DeleteAppValidationConfigurationRequest request) {
return deleteAppValidationConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteAppValidationConfigurationAsync(
final DeleteAppValidationConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteAppValidationConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteAppValidationConfigurationResult call() throws Exception {
DeleteAppValidationConfigurationResult result = null;
try {
result = executeDeleteAppValidationConfiguration(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 deleteReplicationJobAsync(DeleteReplicationJobRequest request) {
return deleteReplicationJobAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteReplicationJobAsync(final DeleteReplicationJobRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteReplicationJobRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteReplicationJobResult call() throws Exception {
DeleteReplicationJobResult result = null;
try {
result = executeDeleteReplicationJob(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 deleteServerCatalogAsync(DeleteServerCatalogRequest request) {
return deleteServerCatalogAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteServerCatalogAsync(final DeleteServerCatalogRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteServerCatalogRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteServerCatalogResult call() throws Exception {
DeleteServerCatalogResult result = null;
try {
result = executeDeleteServerCatalog(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 disassociateConnectorAsync(DisassociateConnectorRequest request) {
return disassociateConnectorAsync(request, null);
}
@Override
public java.util.concurrent.Future disassociateConnectorAsync(final DisassociateConnectorRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DisassociateConnectorRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DisassociateConnectorResult call() throws Exception {
DisassociateConnectorResult result = null;
try {
result = executeDisassociateConnector(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 generateChangeSetAsync(GenerateChangeSetRequest request) {
return generateChangeSetAsync(request, null);
}
@Override
public java.util.concurrent.Future generateChangeSetAsync(final GenerateChangeSetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GenerateChangeSetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GenerateChangeSetResult call() throws Exception {
GenerateChangeSetResult result = null;
try {
result = executeGenerateChangeSet(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 generateTemplateAsync(GenerateTemplateRequest request) {
return generateTemplateAsync(request, null);
}
@Override
public java.util.concurrent.Future generateTemplateAsync(final GenerateTemplateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GenerateTemplateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GenerateTemplateResult call() throws Exception {
GenerateTemplateResult result = null;
try {
result = executeGenerateTemplate(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 getAppAsync(GetAppRequest request) {
return getAppAsync(request, null);
}
@Override
public java.util.concurrent.Future getAppAsync(final GetAppRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetAppRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetAppResult call() throws Exception {
GetAppResult result = null;
try {
result = executeGetApp(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 getAppLaunchConfigurationAsync(GetAppLaunchConfigurationRequest request) {
return getAppLaunchConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future getAppLaunchConfigurationAsync(final GetAppLaunchConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetAppLaunchConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetAppLaunchConfigurationResult call() throws Exception {
GetAppLaunchConfigurationResult result = null;
try {
result = executeGetAppLaunchConfiguration(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 getAppReplicationConfigurationAsync(GetAppReplicationConfigurationRequest request) {
return getAppReplicationConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future getAppReplicationConfigurationAsync(
final GetAppReplicationConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetAppReplicationConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetAppReplicationConfigurationResult call() throws Exception {
GetAppReplicationConfigurationResult result = null;
try {
result = executeGetAppReplicationConfiguration(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 getAppValidationConfigurationAsync(GetAppValidationConfigurationRequest request) {
return getAppValidationConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future getAppValidationConfigurationAsync(
final GetAppValidationConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetAppValidationConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetAppValidationConfigurationResult call() throws Exception {
GetAppValidationConfigurationResult result = null;
try {
result = executeGetAppValidationConfiguration(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 getAppValidationOutputAsync(GetAppValidationOutputRequest request) {
return getAppValidationOutputAsync(request, null);
}
@Override
public java.util.concurrent.Future getAppValidationOutputAsync(final GetAppValidationOutputRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetAppValidationOutputRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetAppValidationOutputResult call() throws Exception {
GetAppValidationOutputResult result = null;
try {
result = executeGetAppValidationOutput(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 getConnectorsAsync(GetConnectorsRequest request) {
return getConnectorsAsync(request, null);
}
@Override
public java.util.concurrent.Future getConnectorsAsync(final GetConnectorsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetConnectorsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetConnectorsResult call() throws Exception {
GetConnectorsResult result = null;
try {
result = executeGetConnectors(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 getReplicationJobsAsync(GetReplicationJobsRequest request) {
return getReplicationJobsAsync(request, null);
}
@Override
public java.util.concurrent.Future getReplicationJobsAsync(final GetReplicationJobsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetReplicationJobsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetReplicationJobsResult call() throws Exception {
GetReplicationJobsResult result = null;
try {
result = executeGetReplicationJobs(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 getReplicationRunsAsync(GetReplicationRunsRequest request) {
return getReplicationRunsAsync(request, null);
}
@Override
public java.util.concurrent.Future getReplicationRunsAsync(final GetReplicationRunsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetReplicationRunsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetReplicationRunsResult call() throws Exception {
GetReplicationRunsResult result = null;
try {
result = executeGetReplicationRuns(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 getServersAsync(GetServersRequest request) {
return getServersAsync(request, null);
}
@Override
public java.util.concurrent.Future getServersAsync(final GetServersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetServersRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetServersResult call() throws Exception {
GetServersResult result = null;
try {
result = executeGetServers(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 importAppCatalogAsync(ImportAppCatalogRequest request) {
return importAppCatalogAsync(request, null);
}
@Override
public java.util.concurrent.Future importAppCatalogAsync(final ImportAppCatalogRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ImportAppCatalogRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ImportAppCatalogResult call() throws Exception {
ImportAppCatalogResult result = null;
try {
result = executeImportAppCatalog(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 importServerCatalogAsync(ImportServerCatalogRequest request) {
return importServerCatalogAsync(request, null);
}
@Override
public java.util.concurrent.Future importServerCatalogAsync(final ImportServerCatalogRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ImportServerCatalogRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ImportServerCatalogResult call() throws Exception {
ImportServerCatalogResult result = null;
try {
result = executeImportServerCatalog(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 launchAppAsync(LaunchAppRequest request) {
return launchAppAsync(request, null);
}
@Override
public java.util.concurrent.Future launchAppAsync(final LaunchAppRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final LaunchAppRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public LaunchAppResult call() throws Exception {
LaunchAppResult result = null;
try {
result = executeLaunchApp(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 listAppsAsync(ListAppsRequest request) {
return listAppsAsync(request, null);
}
@Override
public java.util.concurrent.Future listAppsAsync(final ListAppsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListAppsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListAppsResult call() throws Exception {
ListAppsResult result = null;
try {
result = executeListApps(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 notifyAppValidationOutputAsync(NotifyAppValidationOutputRequest request) {
return notifyAppValidationOutputAsync(request, null);
}
@Override
public java.util.concurrent.Future notifyAppValidationOutputAsync(final NotifyAppValidationOutputRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final NotifyAppValidationOutputRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public NotifyAppValidationOutputResult call() throws Exception {
NotifyAppValidationOutputResult result = null;
try {
result = executeNotifyAppValidationOutput(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 putAppLaunchConfigurationAsync(PutAppLaunchConfigurationRequest request) {
return putAppLaunchConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future putAppLaunchConfigurationAsync(final PutAppLaunchConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final PutAppLaunchConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public PutAppLaunchConfigurationResult call() throws Exception {
PutAppLaunchConfigurationResult result = null;
try {
result = executePutAppLaunchConfiguration(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 putAppReplicationConfigurationAsync(PutAppReplicationConfigurationRequest request) {
return putAppReplicationConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future putAppReplicationConfigurationAsync(
final PutAppReplicationConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final PutAppReplicationConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public PutAppReplicationConfigurationResult call() throws Exception {
PutAppReplicationConfigurationResult result = null;
try {
result = executePutAppReplicationConfiguration(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 putAppValidationConfigurationAsync(PutAppValidationConfigurationRequest request) {
return putAppValidationConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future putAppValidationConfigurationAsync(
final PutAppValidationConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final PutAppValidationConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public PutAppValidationConfigurationResult call() throws Exception {
PutAppValidationConfigurationResult result = null;
try {
result = executePutAppValidationConfiguration(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 startAppReplicationAsync(StartAppReplicationRequest request) {
return startAppReplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future startAppReplicationAsync(final StartAppReplicationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartAppReplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartAppReplicationResult call() throws Exception {
StartAppReplicationResult result = null;
try {
result = executeStartAppReplication(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 startOnDemandAppReplicationAsync(StartOnDemandAppReplicationRequest request) {
return startOnDemandAppReplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future startOnDemandAppReplicationAsync(final StartOnDemandAppReplicationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartOnDemandAppReplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartOnDemandAppReplicationResult call() throws Exception {
StartOnDemandAppReplicationResult result = null;
try {
result = executeStartOnDemandAppReplication(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 startOnDemandReplicationRunAsync(StartOnDemandReplicationRunRequest request) {
return startOnDemandReplicationRunAsync(request, null);
}
@Override
public java.util.concurrent.Future startOnDemandReplicationRunAsync(final StartOnDemandReplicationRunRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartOnDemandReplicationRunRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartOnDemandReplicationRunResult call() throws Exception {
StartOnDemandReplicationRunResult result = null;
try {
result = executeStartOnDemandReplicationRun(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 stopAppReplicationAsync(StopAppReplicationRequest request) {
return stopAppReplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future stopAppReplicationAsync(final StopAppReplicationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StopAppReplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StopAppReplicationResult call() throws Exception {
StopAppReplicationResult result = null;
try {
result = executeStopAppReplication(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 terminateAppAsync(TerminateAppRequest request) {
return terminateAppAsync(request, null);
}
@Override
public java.util.concurrent.Future terminateAppAsync(final TerminateAppRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final TerminateAppRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public TerminateAppResult call() throws Exception {
TerminateAppResult result = null;
try {
result = executeTerminateApp(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 updateAppAsync(UpdateAppRequest request) {
return updateAppAsync(request, null);
}
@Override
public java.util.concurrent.Future updateAppAsync(final UpdateAppRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateAppRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateAppResult call() throws Exception {
UpdateAppResult result = null;
try {
result = executeUpdateApp(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 updateReplicationJobAsync(UpdateReplicationJobRequest request) {
return updateReplicationJobAsync(request, null);
}
@Override
public java.util.concurrent.Future updateReplicationJobAsync(final UpdateReplicationJobRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateReplicationJobRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateReplicationJobResult call() throws Exception {
UpdateReplicationJobResult result = null;
try {
result = executeUpdateReplicationJob(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();
}
}