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

com.amazonaws.services.computeoptimizer.AWSComputeOptimizerAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Compute Optimizer module holds the client classes that are used for communicating with AWS Compute Optimizer Service

The newest version!
/*
 * Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */
package com.amazonaws.services.computeoptimizer;

import javax.annotation.Generated;

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

import java.util.concurrent.ExecutorService;

/**
 * Client for accessing AWS Compute Optimizer 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.
 * 

*

* Compute Optimizer is a service that analyzes the configuration and utilization metrics of your Amazon Web Services * compute resources, such as Amazon EC2 instances, Amazon EC2 Auto Scaling groups, Lambda functions, Amazon EBS * volumes, and Amazon ECS services on Fargate. It reports whether your resources are optimal, and generates * optimization recommendations to reduce the cost and improve the performance of your workloads. Compute Optimizer also * provides recent utilization metric data, in addition to projected utilization metric data for the recommendations, * which you can use to evaluate which recommendation provides the best price-performance trade-off. The analysis of * your usage patterns can help you decide when to move or resize your running resources, and still meet your * performance and capacity requirements. For more information about Compute Optimizer, including the required * permissions to use the service, see the Compute * Optimizer User Guide. *

*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AWSComputeOptimizerAsyncClient extends AWSComputeOptimizerClient implements AWSComputeOptimizerAsync { private static final int DEFAULT_THREAD_POOL_SIZE = 50; private final java.util.concurrent.ExecutorService executorService; public static AWSComputeOptimizerAsyncClientBuilder asyncBuilder() { return AWSComputeOptimizerAsyncClientBuilder.standard(); } /** * Constructs a new asynchronous client to invoke service methods on AWS Compute Optimizer using the specified * parameters. * * @param asyncClientParams * Object providing client parameters. */ AWSComputeOptimizerAsyncClient(AwsAsyncClientParams asyncClientParams) { this(asyncClientParams, false); } /** * Constructs a new asynchronous client to invoke service methods on AWS Compute Optimizer using the specified * parameters. * * @param asyncClientParams * Object providing client parameters. * @param endpointDiscoveryEnabled * true will enable endpoint discovery if the service supports it. */ AWSComputeOptimizerAsyncClient(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 deleteRecommendationPreferencesAsync( DeleteRecommendationPreferencesRequest request) { return deleteRecommendationPreferencesAsync(request, null); } @Override public java.util.concurrent.Future deleteRecommendationPreferencesAsync( final DeleteRecommendationPreferencesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteRecommendationPreferencesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteRecommendationPreferencesResult call() throws Exception { DeleteRecommendationPreferencesResult result = null; try { result = executeDeleteRecommendationPreferences(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 describeRecommendationExportJobsAsync( DescribeRecommendationExportJobsRequest request) { return describeRecommendationExportJobsAsync(request, null); } @Override public java.util.concurrent.Future describeRecommendationExportJobsAsync( final DescribeRecommendationExportJobsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeRecommendationExportJobsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeRecommendationExportJobsResult call() throws Exception { DescribeRecommendationExportJobsResult result = null; try { result = executeDescribeRecommendationExportJobs(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 exportAutoScalingGroupRecommendationsAsync( ExportAutoScalingGroupRecommendationsRequest request) { return exportAutoScalingGroupRecommendationsAsync(request, null); } @Override public java.util.concurrent.Future exportAutoScalingGroupRecommendationsAsync( final ExportAutoScalingGroupRecommendationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ExportAutoScalingGroupRecommendationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ExportAutoScalingGroupRecommendationsResult call() throws Exception { ExportAutoScalingGroupRecommendationsResult result = null; try { result = executeExportAutoScalingGroupRecommendations(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 exportEBSVolumeRecommendationsAsync(ExportEBSVolumeRecommendationsRequest request) { return exportEBSVolumeRecommendationsAsync(request, null); } @Override public java.util.concurrent.Future exportEBSVolumeRecommendationsAsync( final ExportEBSVolumeRecommendationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ExportEBSVolumeRecommendationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ExportEBSVolumeRecommendationsResult call() throws Exception { ExportEBSVolumeRecommendationsResult result = null; try { result = executeExportEBSVolumeRecommendations(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 exportEC2InstanceRecommendationsAsync( ExportEC2InstanceRecommendationsRequest request) { return exportEC2InstanceRecommendationsAsync(request, null); } @Override public java.util.concurrent.Future exportEC2InstanceRecommendationsAsync( final ExportEC2InstanceRecommendationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ExportEC2InstanceRecommendationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ExportEC2InstanceRecommendationsResult call() throws Exception { ExportEC2InstanceRecommendationsResult result = null; try { result = executeExportEC2InstanceRecommendations(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 exportECSServiceRecommendationsAsync( ExportECSServiceRecommendationsRequest request) { return exportECSServiceRecommendationsAsync(request, null); } @Override public java.util.concurrent.Future exportECSServiceRecommendationsAsync( final ExportECSServiceRecommendationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ExportECSServiceRecommendationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ExportECSServiceRecommendationsResult call() throws Exception { ExportECSServiceRecommendationsResult result = null; try { result = executeExportECSServiceRecommendations(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 exportLambdaFunctionRecommendationsAsync( ExportLambdaFunctionRecommendationsRequest request) { return exportLambdaFunctionRecommendationsAsync(request, null); } @Override public java.util.concurrent.Future exportLambdaFunctionRecommendationsAsync( final ExportLambdaFunctionRecommendationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ExportLambdaFunctionRecommendationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ExportLambdaFunctionRecommendationsResult call() throws Exception { ExportLambdaFunctionRecommendationsResult result = null; try { result = executeExportLambdaFunctionRecommendations(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 exportLicenseRecommendationsAsync(ExportLicenseRecommendationsRequest request) { return exportLicenseRecommendationsAsync(request, null); } @Override public java.util.concurrent.Future exportLicenseRecommendationsAsync(final ExportLicenseRecommendationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ExportLicenseRecommendationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ExportLicenseRecommendationsResult call() throws Exception { ExportLicenseRecommendationsResult result = null; try { result = executeExportLicenseRecommendations(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 exportRDSDatabaseRecommendationsAsync( ExportRDSDatabaseRecommendationsRequest request) { return exportRDSDatabaseRecommendationsAsync(request, null); } @Override public java.util.concurrent.Future exportRDSDatabaseRecommendationsAsync( final ExportRDSDatabaseRecommendationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ExportRDSDatabaseRecommendationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ExportRDSDatabaseRecommendationsResult call() throws Exception { ExportRDSDatabaseRecommendationsResult result = null; try { result = executeExportRDSDatabaseRecommendations(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 getAutoScalingGroupRecommendationsAsync( GetAutoScalingGroupRecommendationsRequest request) { return getAutoScalingGroupRecommendationsAsync(request, null); } @Override public java.util.concurrent.Future getAutoScalingGroupRecommendationsAsync( final GetAutoScalingGroupRecommendationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetAutoScalingGroupRecommendationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetAutoScalingGroupRecommendationsResult call() throws Exception { GetAutoScalingGroupRecommendationsResult result = null; try { result = executeGetAutoScalingGroupRecommendations(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 getEBSVolumeRecommendationsAsync(GetEBSVolumeRecommendationsRequest request) { return getEBSVolumeRecommendationsAsync(request, null); } @Override public java.util.concurrent.Future getEBSVolumeRecommendationsAsync(final GetEBSVolumeRecommendationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetEBSVolumeRecommendationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetEBSVolumeRecommendationsResult call() throws Exception { GetEBSVolumeRecommendationsResult result = null; try { result = executeGetEBSVolumeRecommendations(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 getEC2InstanceRecommendationsAsync(GetEC2InstanceRecommendationsRequest request) { return getEC2InstanceRecommendationsAsync(request, null); } @Override public java.util.concurrent.Future getEC2InstanceRecommendationsAsync( final GetEC2InstanceRecommendationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetEC2InstanceRecommendationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetEC2InstanceRecommendationsResult call() throws Exception { GetEC2InstanceRecommendationsResult result = null; try { result = executeGetEC2InstanceRecommendations(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 getEC2RecommendationProjectedMetricsAsync( GetEC2RecommendationProjectedMetricsRequest request) { return getEC2RecommendationProjectedMetricsAsync(request, null); } @Override public java.util.concurrent.Future getEC2RecommendationProjectedMetricsAsync( final GetEC2RecommendationProjectedMetricsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetEC2RecommendationProjectedMetricsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetEC2RecommendationProjectedMetricsResult call() throws Exception { GetEC2RecommendationProjectedMetricsResult result = null; try { result = executeGetEC2RecommendationProjectedMetrics(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 getECSServiceRecommendationProjectedMetricsAsync( GetECSServiceRecommendationProjectedMetricsRequest request) { return getECSServiceRecommendationProjectedMetricsAsync(request, null); } @Override public java.util.concurrent.Future getECSServiceRecommendationProjectedMetricsAsync( final GetECSServiceRecommendationProjectedMetricsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetECSServiceRecommendationProjectedMetricsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetECSServiceRecommendationProjectedMetricsResult call() throws Exception { GetECSServiceRecommendationProjectedMetricsResult result = null; try { result = executeGetECSServiceRecommendationProjectedMetrics(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 getECSServiceRecommendationsAsync(GetECSServiceRecommendationsRequest request) { return getECSServiceRecommendationsAsync(request, null); } @Override public java.util.concurrent.Future getECSServiceRecommendationsAsync(final GetECSServiceRecommendationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetECSServiceRecommendationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetECSServiceRecommendationsResult call() throws Exception { GetECSServiceRecommendationsResult result = null; try { result = executeGetECSServiceRecommendations(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 getEffectiveRecommendationPreferencesAsync( GetEffectiveRecommendationPreferencesRequest request) { return getEffectiveRecommendationPreferencesAsync(request, null); } @Override public java.util.concurrent.Future getEffectiveRecommendationPreferencesAsync( final GetEffectiveRecommendationPreferencesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetEffectiveRecommendationPreferencesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetEffectiveRecommendationPreferencesResult call() throws Exception { GetEffectiveRecommendationPreferencesResult result = null; try { result = executeGetEffectiveRecommendationPreferences(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 getEnrollmentStatusAsync(GetEnrollmentStatusRequest request) { return getEnrollmentStatusAsync(request, null); } @Override public java.util.concurrent.Future getEnrollmentStatusAsync(final GetEnrollmentStatusRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetEnrollmentStatusRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetEnrollmentStatusResult call() throws Exception { GetEnrollmentStatusResult result = null; try { result = executeGetEnrollmentStatus(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 getEnrollmentStatusesForOrganizationAsync( GetEnrollmentStatusesForOrganizationRequest request) { return getEnrollmentStatusesForOrganizationAsync(request, null); } @Override public java.util.concurrent.Future getEnrollmentStatusesForOrganizationAsync( final GetEnrollmentStatusesForOrganizationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetEnrollmentStatusesForOrganizationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetEnrollmentStatusesForOrganizationResult call() throws Exception { GetEnrollmentStatusesForOrganizationResult result = null; try { result = executeGetEnrollmentStatusesForOrganization(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 getLambdaFunctionRecommendationsAsync( GetLambdaFunctionRecommendationsRequest request) { return getLambdaFunctionRecommendationsAsync(request, null); } @Override public java.util.concurrent.Future getLambdaFunctionRecommendationsAsync( final GetLambdaFunctionRecommendationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetLambdaFunctionRecommendationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetLambdaFunctionRecommendationsResult call() throws Exception { GetLambdaFunctionRecommendationsResult result = null; try { result = executeGetLambdaFunctionRecommendations(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 getLicenseRecommendationsAsync(GetLicenseRecommendationsRequest request) { return getLicenseRecommendationsAsync(request, null); } @Override public java.util.concurrent.Future getLicenseRecommendationsAsync(final GetLicenseRecommendationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetLicenseRecommendationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetLicenseRecommendationsResult call() throws Exception { GetLicenseRecommendationsResult result = null; try { result = executeGetLicenseRecommendations(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 getRDSDatabaseRecommendationProjectedMetricsAsync( GetRDSDatabaseRecommendationProjectedMetricsRequest request) { return getRDSDatabaseRecommendationProjectedMetricsAsync(request, null); } @Override public java.util.concurrent.Future getRDSDatabaseRecommendationProjectedMetricsAsync( final GetRDSDatabaseRecommendationProjectedMetricsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetRDSDatabaseRecommendationProjectedMetricsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetRDSDatabaseRecommendationProjectedMetricsResult call() throws Exception { GetRDSDatabaseRecommendationProjectedMetricsResult result = null; try { result = executeGetRDSDatabaseRecommendationProjectedMetrics(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 getRDSDatabaseRecommendationsAsync(GetRDSDatabaseRecommendationsRequest request) { return getRDSDatabaseRecommendationsAsync(request, null); } @Override public java.util.concurrent.Future getRDSDatabaseRecommendationsAsync( final GetRDSDatabaseRecommendationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetRDSDatabaseRecommendationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetRDSDatabaseRecommendationsResult call() throws Exception { GetRDSDatabaseRecommendationsResult result = null; try { result = executeGetRDSDatabaseRecommendations(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 getRecommendationPreferencesAsync(GetRecommendationPreferencesRequest request) { return getRecommendationPreferencesAsync(request, null); } @Override public java.util.concurrent.Future getRecommendationPreferencesAsync(final GetRecommendationPreferencesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetRecommendationPreferencesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetRecommendationPreferencesResult call() throws Exception { GetRecommendationPreferencesResult result = null; try { result = executeGetRecommendationPreferences(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 getRecommendationSummariesAsync(GetRecommendationSummariesRequest request) { return getRecommendationSummariesAsync(request, null); } @Override public java.util.concurrent.Future getRecommendationSummariesAsync(final GetRecommendationSummariesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetRecommendationSummariesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetRecommendationSummariesResult call() throws Exception { GetRecommendationSummariesResult result = null; try { result = executeGetRecommendationSummaries(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 putRecommendationPreferencesAsync(PutRecommendationPreferencesRequest request) { return putRecommendationPreferencesAsync(request, null); } @Override public java.util.concurrent.Future putRecommendationPreferencesAsync(final PutRecommendationPreferencesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final PutRecommendationPreferencesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public PutRecommendationPreferencesResult call() throws Exception { PutRecommendationPreferencesResult result = null; try { result = executePutRecommendationPreferences(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 updateEnrollmentStatusAsync(UpdateEnrollmentStatusRequest request) { return updateEnrollmentStatusAsync(request, null); } @Override public java.util.concurrent.Future updateEnrollmentStatusAsync(final UpdateEnrollmentStatusRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateEnrollmentStatusRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateEnrollmentStatusResult call() throws Exception { UpdateEnrollmentStatusResult result = null; try { result = executeUpdateEnrollmentStatus(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 - 2025 Weber Informatics LLC | Privacy Policy