com.amazonaws.services.migrationhubstrategyrecommendations.AWSMigrationHubStrategyRecommendationsAsyncClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk-migrationhubstrategyrecommendations Show documentation
Show all versions of aws-java-sdk-migrationhubstrategyrecommendations Show documentation
The AWS Java SDK for Migration Hub Strategy Recommendations module holds the client classes that are used for communicating with Migration Hub Strategy Recommendations Service
/*
* 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.migrationhubstrategyrecommendations;
import javax.annotation.Generated;
import com.amazonaws.services.migrationhubstrategyrecommendations.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import java.util.concurrent.ExecutorService;
/**
* Client for accessing Migration Hub Strategy Recommendations 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.
*
*
* Migration Hub Strategy Recommendations
*
* This API reference provides descriptions, syntax, and other details about each of the actions and data types for
* Migration Hub Strategy Recommendations (Strategy Recommendations). The topic for each action shows the API request
* parameters and the response. Alternatively, you can use one of the AWS SDKs to access an API that is tailored to the
* programming language or platform that you're using. For more information, see AWS SDKs.
*
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSMigrationHubStrategyRecommendationsAsyncClient extends AWSMigrationHubStrategyRecommendationsClient implements
AWSMigrationHubStrategyRecommendationsAsync {
private static final int DEFAULT_THREAD_POOL_SIZE = 50;
private final java.util.concurrent.ExecutorService executorService;
public static AWSMigrationHubStrategyRecommendationsAsyncClientBuilder asyncBuilder() {
return AWSMigrationHubStrategyRecommendationsAsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on Migration Hub Strategy Recommendations using
* the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AWSMigrationHubStrategyRecommendationsAsyncClient(AwsAsyncClientParams asyncClientParams) {
this(asyncClientParams, false);
}
/**
* Constructs a new asynchronous client to invoke service methods on Migration Hub Strategy Recommendations using
* the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
* @param endpointDiscoveryEnabled
* true will enable endpoint discovery if the service supports it.
*/
AWSMigrationHubStrategyRecommendationsAsyncClient(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 getApplicationComponentDetailsAsync(GetApplicationComponentDetailsRequest request) {
return getApplicationComponentDetailsAsync(request, null);
}
@Override
public java.util.concurrent.Future getApplicationComponentDetailsAsync(
final GetApplicationComponentDetailsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetApplicationComponentDetailsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetApplicationComponentDetailsResult call() throws Exception {
GetApplicationComponentDetailsResult result = null;
try {
result = executeGetApplicationComponentDetails(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 getApplicationComponentStrategiesAsync(
GetApplicationComponentStrategiesRequest request) {
return getApplicationComponentStrategiesAsync(request, null);
}
@Override
public java.util.concurrent.Future getApplicationComponentStrategiesAsync(
final GetApplicationComponentStrategiesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetApplicationComponentStrategiesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetApplicationComponentStrategiesResult call() throws Exception {
GetApplicationComponentStrategiesResult result = null;
try {
result = executeGetApplicationComponentStrategies(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 getAssessmentAsync(GetAssessmentRequest request) {
return getAssessmentAsync(request, null);
}
@Override
public java.util.concurrent.Future getAssessmentAsync(final GetAssessmentRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetAssessmentRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetAssessmentResult call() throws Exception {
GetAssessmentResult result = null;
try {
result = executeGetAssessment(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 getImportFileTaskAsync(GetImportFileTaskRequest request) {
return getImportFileTaskAsync(request, null);
}
@Override
public java.util.concurrent.Future getImportFileTaskAsync(final GetImportFileTaskRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetImportFileTaskRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetImportFileTaskResult call() throws Exception {
GetImportFileTaskResult result = null;
try {
result = executeGetImportFileTask(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 getLatestAssessmentIdAsync(GetLatestAssessmentIdRequest request) {
return getLatestAssessmentIdAsync(request, null);
}
@Override
public java.util.concurrent.Future getLatestAssessmentIdAsync(final GetLatestAssessmentIdRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetLatestAssessmentIdRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetLatestAssessmentIdResult call() throws Exception {
GetLatestAssessmentIdResult result = null;
try {
result = executeGetLatestAssessmentId(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 getPortfolioPreferencesAsync(GetPortfolioPreferencesRequest request) {
return getPortfolioPreferencesAsync(request, null);
}
@Override
public java.util.concurrent.Future getPortfolioPreferencesAsync(final GetPortfolioPreferencesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetPortfolioPreferencesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetPortfolioPreferencesResult call() throws Exception {
GetPortfolioPreferencesResult result = null;
try {
result = executeGetPortfolioPreferences(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 getPortfolioSummaryAsync(GetPortfolioSummaryRequest request) {
return getPortfolioSummaryAsync(request, null);
}
@Override
public java.util.concurrent.Future getPortfolioSummaryAsync(final GetPortfolioSummaryRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetPortfolioSummaryRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetPortfolioSummaryResult call() throws Exception {
GetPortfolioSummaryResult result = null;
try {
result = executeGetPortfolioSummary(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 getRecommendationReportDetailsAsync(GetRecommendationReportDetailsRequest request) {
return getRecommendationReportDetailsAsync(request, null);
}
@Override
public java.util.concurrent.Future getRecommendationReportDetailsAsync(
final GetRecommendationReportDetailsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetRecommendationReportDetailsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetRecommendationReportDetailsResult call() throws Exception {
GetRecommendationReportDetailsResult result = null;
try {
result = executeGetRecommendationReportDetails(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 getServerDetailsAsync(GetServerDetailsRequest request) {
return getServerDetailsAsync(request, null);
}
@Override
public java.util.concurrent.Future getServerDetailsAsync(final GetServerDetailsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetServerDetailsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetServerDetailsResult call() throws Exception {
GetServerDetailsResult result = null;
try {
result = executeGetServerDetails(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 getServerStrategiesAsync(GetServerStrategiesRequest request) {
return getServerStrategiesAsync(request, null);
}
@Override
public java.util.concurrent.Future getServerStrategiesAsync(final GetServerStrategiesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetServerStrategiesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetServerStrategiesResult call() throws Exception {
GetServerStrategiesResult result = null;
try {
result = executeGetServerStrategies(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 listAnalyzableServersAsync(ListAnalyzableServersRequest request) {
return listAnalyzableServersAsync(request, null);
}
@Override
public java.util.concurrent.Future listAnalyzableServersAsync(final ListAnalyzableServersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListAnalyzableServersRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListAnalyzableServersResult call() throws Exception {
ListAnalyzableServersResult result = null;
try {
result = executeListAnalyzableServers(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 listApplicationComponentsAsync(ListApplicationComponentsRequest request) {
return listApplicationComponentsAsync(request, null);
}
@Override
public java.util.concurrent.Future listApplicationComponentsAsync(final ListApplicationComponentsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListApplicationComponentsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListApplicationComponentsResult call() throws Exception {
ListApplicationComponentsResult result = null;
try {
result = executeListApplicationComponents(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 listCollectorsAsync(ListCollectorsRequest request) {
return listCollectorsAsync(request, null);
}
@Override
public java.util.concurrent.Future listCollectorsAsync(final ListCollectorsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListCollectorsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListCollectorsResult call() throws Exception {
ListCollectorsResult result = null;
try {
result = executeListCollectors(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 listImportFileTaskAsync(ListImportFileTaskRequest request) {
return listImportFileTaskAsync(request, null);
}
@Override
public java.util.concurrent.Future listImportFileTaskAsync(final ListImportFileTaskRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListImportFileTaskRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListImportFileTaskResult call() throws Exception {
ListImportFileTaskResult result = null;
try {
result = executeListImportFileTask(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 listServersAsync(ListServersRequest request) {
return listServersAsync(request, null);
}
@Override
public java.util.concurrent.Future listServersAsync(final ListServersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListServersRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListServersResult call() throws Exception {
ListServersResult result = null;
try {
result = executeListServers(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 putPortfolioPreferencesAsync(PutPortfolioPreferencesRequest request) {
return putPortfolioPreferencesAsync(request, null);
}
@Override
public java.util.concurrent.Future putPortfolioPreferencesAsync(final PutPortfolioPreferencesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final PutPortfolioPreferencesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public PutPortfolioPreferencesResult call() throws Exception {
PutPortfolioPreferencesResult result = null;
try {
result = executePutPortfolioPreferences(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 startAssessmentAsync(StartAssessmentRequest request) {
return startAssessmentAsync(request, null);
}
@Override
public java.util.concurrent.Future startAssessmentAsync(final StartAssessmentRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartAssessmentRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartAssessmentResult call() throws Exception {
StartAssessmentResult result = null;
try {
result = executeStartAssessment(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 startImportFileTaskAsync(StartImportFileTaskRequest request) {
return startImportFileTaskAsync(request, null);
}
@Override
public java.util.concurrent.Future startImportFileTaskAsync(final StartImportFileTaskRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartImportFileTaskRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartImportFileTaskResult call() throws Exception {
StartImportFileTaskResult result = null;
try {
result = executeStartImportFileTask(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 startRecommendationReportGenerationAsync(
StartRecommendationReportGenerationRequest request) {
return startRecommendationReportGenerationAsync(request, null);
}
@Override
public java.util.concurrent.Future startRecommendationReportGenerationAsync(
final StartRecommendationReportGenerationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartRecommendationReportGenerationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartRecommendationReportGenerationResult call() throws Exception {
StartRecommendationReportGenerationResult result = null;
try {
result = executeStartRecommendationReportGeneration(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 stopAssessmentAsync(StopAssessmentRequest request) {
return stopAssessmentAsync(request, null);
}
@Override
public java.util.concurrent.Future stopAssessmentAsync(final StopAssessmentRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StopAssessmentRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StopAssessmentResult call() throws Exception {
StopAssessmentResult result = null;
try {
result = executeStopAssessment(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 updateApplicationComponentConfigAsync(
UpdateApplicationComponentConfigRequest request) {
return updateApplicationComponentConfigAsync(request, null);
}
@Override
public java.util.concurrent.Future updateApplicationComponentConfigAsync(
final UpdateApplicationComponentConfigRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateApplicationComponentConfigRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateApplicationComponentConfigResult call() throws Exception {
UpdateApplicationComponentConfigResult result = null;
try {
result = executeUpdateApplicationComponentConfig(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 updateServerConfigAsync(UpdateServerConfigRequest request) {
return updateServerConfigAsync(request, null);
}
@Override
public java.util.concurrent.Future updateServerConfigAsync(final UpdateServerConfigRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateServerConfigRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateServerConfigResult call() throws Exception {
UpdateServerConfigResult result = null;
try {
result = executeUpdateServerConfig(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();
}
}