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

com.amazonaws.services.lookoutmetrics.AmazonLookoutMetricsAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Lookout for Metrics module holds the client classes that are used for communicating with Amazon Lookout for Metrics Service

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

import javax.annotation.Generated;

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

import java.util.concurrent.ExecutorService;

/**
 * Client for accessing LookoutMetrics 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.
 * 

*

* This is the Amazon Lookout for Metrics API Reference. For an introduction to the service with tutorials for * getting started, visit Amazon Lookout for Metrics * Developer Guide. *

*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AmazonLookoutMetricsAsyncClient extends AmazonLookoutMetricsClient implements AmazonLookoutMetricsAsync { private static final int DEFAULT_THREAD_POOL_SIZE = 50; private final java.util.concurrent.ExecutorService executorService; public static AmazonLookoutMetricsAsyncClientBuilder asyncBuilder() { return AmazonLookoutMetricsAsyncClientBuilder.standard(); } /** * Constructs a new asynchronous client to invoke service methods on LookoutMetrics using the specified parameters. * * @param asyncClientParams * Object providing client parameters. */ AmazonLookoutMetricsAsyncClient(AwsAsyncClientParams asyncClientParams) { this(asyncClientParams, false); } /** * Constructs a new asynchronous client to invoke service methods on LookoutMetrics using the specified parameters. * * @param asyncClientParams * Object providing client parameters. * @param endpointDiscoveryEnabled * true will enable endpoint discovery if the service supports it. */ AmazonLookoutMetricsAsyncClient(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 activateAnomalyDetectorAsync(ActivateAnomalyDetectorRequest request) { return activateAnomalyDetectorAsync(request, null); } @Override public java.util.concurrent.Future activateAnomalyDetectorAsync(final ActivateAnomalyDetectorRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ActivateAnomalyDetectorRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ActivateAnomalyDetectorResult call() throws Exception { ActivateAnomalyDetectorResult result = null; try { result = executeActivateAnomalyDetector(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 backTestAnomalyDetectorAsync(BackTestAnomalyDetectorRequest request) { return backTestAnomalyDetectorAsync(request, null); } @Override public java.util.concurrent.Future backTestAnomalyDetectorAsync(final BackTestAnomalyDetectorRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final BackTestAnomalyDetectorRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public BackTestAnomalyDetectorResult call() throws Exception { BackTestAnomalyDetectorResult result = null; try { result = executeBackTestAnomalyDetector(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 createAlertAsync(CreateAlertRequest request) { return createAlertAsync(request, null); } @Override public java.util.concurrent.Future createAlertAsync(final CreateAlertRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateAlertRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateAlertResult call() throws Exception { CreateAlertResult result = null; try { result = executeCreateAlert(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 createAnomalyDetectorAsync(CreateAnomalyDetectorRequest request) { return createAnomalyDetectorAsync(request, null); } @Override public java.util.concurrent.Future createAnomalyDetectorAsync(final CreateAnomalyDetectorRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateAnomalyDetectorRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateAnomalyDetectorResult call() throws Exception { CreateAnomalyDetectorResult result = null; try { result = executeCreateAnomalyDetector(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 createMetricSetAsync(CreateMetricSetRequest request) { return createMetricSetAsync(request, null); } @Override public java.util.concurrent.Future createMetricSetAsync(final CreateMetricSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateMetricSetRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateMetricSetResult call() throws Exception { CreateMetricSetResult result = null; try { result = executeCreateMetricSet(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 deactivateAnomalyDetectorAsync(DeactivateAnomalyDetectorRequest request) { return deactivateAnomalyDetectorAsync(request, null); } @Override public java.util.concurrent.Future deactivateAnomalyDetectorAsync(final DeactivateAnomalyDetectorRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeactivateAnomalyDetectorRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeactivateAnomalyDetectorResult call() throws Exception { DeactivateAnomalyDetectorResult result = null; try { result = executeDeactivateAnomalyDetector(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 deleteAlertAsync(DeleteAlertRequest request) { return deleteAlertAsync(request, null); } @Override public java.util.concurrent.Future deleteAlertAsync(final DeleteAlertRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteAlertRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteAlertResult call() throws Exception { DeleteAlertResult result = null; try { result = executeDeleteAlert(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 deleteAnomalyDetectorAsync(DeleteAnomalyDetectorRequest request) { return deleteAnomalyDetectorAsync(request, null); } @Override public java.util.concurrent.Future deleteAnomalyDetectorAsync(final DeleteAnomalyDetectorRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteAnomalyDetectorRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteAnomalyDetectorResult call() throws Exception { DeleteAnomalyDetectorResult result = null; try { result = executeDeleteAnomalyDetector(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 describeAlertAsync(DescribeAlertRequest request) { return describeAlertAsync(request, null); } @Override public java.util.concurrent.Future describeAlertAsync(final DescribeAlertRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeAlertRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeAlertResult call() throws Exception { DescribeAlertResult result = null; try { result = executeDescribeAlert(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 describeAnomalyDetectionExecutionsAsync( DescribeAnomalyDetectionExecutionsRequest request) { return describeAnomalyDetectionExecutionsAsync(request, null); } @Override public java.util.concurrent.Future describeAnomalyDetectionExecutionsAsync( final DescribeAnomalyDetectionExecutionsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeAnomalyDetectionExecutionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeAnomalyDetectionExecutionsResult call() throws Exception { DescribeAnomalyDetectionExecutionsResult result = null; try { result = executeDescribeAnomalyDetectionExecutions(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 describeAnomalyDetectorAsync(DescribeAnomalyDetectorRequest request) { return describeAnomalyDetectorAsync(request, null); } @Override public java.util.concurrent.Future describeAnomalyDetectorAsync(final DescribeAnomalyDetectorRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeAnomalyDetectorRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeAnomalyDetectorResult call() throws Exception { DescribeAnomalyDetectorResult result = null; try { result = executeDescribeAnomalyDetector(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 describeMetricSetAsync(DescribeMetricSetRequest request) { return describeMetricSetAsync(request, null); } @Override public java.util.concurrent.Future describeMetricSetAsync(final DescribeMetricSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeMetricSetRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeMetricSetResult call() throws Exception { DescribeMetricSetResult result = null; try { result = executeDescribeMetricSet(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 detectMetricSetConfigAsync(DetectMetricSetConfigRequest request) { return detectMetricSetConfigAsync(request, null); } @Override public java.util.concurrent.Future detectMetricSetConfigAsync(final DetectMetricSetConfigRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DetectMetricSetConfigRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DetectMetricSetConfigResult call() throws Exception { DetectMetricSetConfigResult result = null; try { result = executeDetectMetricSetConfig(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 getAnomalyGroupAsync(GetAnomalyGroupRequest request) { return getAnomalyGroupAsync(request, null); } @Override public java.util.concurrent.Future getAnomalyGroupAsync(final GetAnomalyGroupRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetAnomalyGroupRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetAnomalyGroupResult call() throws Exception { GetAnomalyGroupResult result = null; try { result = executeGetAnomalyGroup(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 getDataQualityMetricsAsync(GetDataQualityMetricsRequest request) { return getDataQualityMetricsAsync(request, null); } @Override public java.util.concurrent.Future getDataQualityMetricsAsync(final GetDataQualityMetricsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetDataQualityMetricsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetDataQualityMetricsResult call() throws Exception { GetDataQualityMetricsResult result = null; try { result = executeGetDataQualityMetrics(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 getFeedbackAsync(GetFeedbackRequest request) { return getFeedbackAsync(request, null); } @Override public java.util.concurrent.Future getFeedbackAsync(final GetFeedbackRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetFeedbackRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetFeedbackResult call() throws Exception { GetFeedbackResult result = null; try { result = executeGetFeedback(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 getSampleDataAsync(GetSampleDataRequest request) { return getSampleDataAsync(request, null); } @Override public java.util.concurrent.Future getSampleDataAsync(final GetSampleDataRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetSampleDataRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetSampleDataResult call() throws Exception { GetSampleDataResult result = null; try { result = executeGetSampleData(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 listAlertsAsync(ListAlertsRequest request) { return listAlertsAsync(request, null); } @Override public java.util.concurrent.Future listAlertsAsync(final ListAlertsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListAlertsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListAlertsResult call() throws Exception { ListAlertsResult result = null; try { result = executeListAlerts(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 listAnomalyDetectorsAsync(ListAnomalyDetectorsRequest request) { return listAnomalyDetectorsAsync(request, null); } @Override public java.util.concurrent.Future listAnomalyDetectorsAsync(final ListAnomalyDetectorsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListAnomalyDetectorsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListAnomalyDetectorsResult call() throws Exception { ListAnomalyDetectorsResult result = null; try { result = executeListAnomalyDetectors(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 listAnomalyGroupRelatedMetricsAsync(ListAnomalyGroupRelatedMetricsRequest request) { return listAnomalyGroupRelatedMetricsAsync(request, null); } @Override public java.util.concurrent.Future listAnomalyGroupRelatedMetricsAsync( final ListAnomalyGroupRelatedMetricsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListAnomalyGroupRelatedMetricsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListAnomalyGroupRelatedMetricsResult call() throws Exception { ListAnomalyGroupRelatedMetricsResult result = null; try { result = executeListAnomalyGroupRelatedMetrics(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 listAnomalyGroupSummariesAsync(ListAnomalyGroupSummariesRequest request) { return listAnomalyGroupSummariesAsync(request, null); } @Override public java.util.concurrent.Future listAnomalyGroupSummariesAsync(final ListAnomalyGroupSummariesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListAnomalyGroupSummariesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListAnomalyGroupSummariesResult call() throws Exception { ListAnomalyGroupSummariesResult result = null; try { result = executeListAnomalyGroupSummaries(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 listAnomalyGroupTimeSeriesAsync(ListAnomalyGroupTimeSeriesRequest request) { return listAnomalyGroupTimeSeriesAsync(request, null); } @Override public java.util.concurrent.Future listAnomalyGroupTimeSeriesAsync(final ListAnomalyGroupTimeSeriesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListAnomalyGroupTimeSeriesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListAnomalyGroupTimeSeriesResult call() throws Exception { ListAnomalyGroupTimeSeriesResult result = null; try { result = executeListAnomalyGroupTimeSeries(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 listMetricSetsAsync(ListMetricSetsRequest request) { return listMetricSetsAsync(request, null); } @Override public java.util.concurrent.Future listMetricSetsAsync(final ListMetricSetsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListMetricSetsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListMetricSetsResult call() throws Exception { ListMetricSetsResult result = null; try { result = executeListMetricSets(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listTagsForResourceAsync(ListTagsForResourceRequest request) { return listTagsForResourceAsync(request, null); } @Override public java.util.concurrent.Future listTagsForResourceAsync(final ListTagsForResourceRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListTagsForResourceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListTagsForResourceResult call() throws Exception { ListTagsForResourceResult result = null; try { result = executeListTagsForResource(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future putFeedbackAsync(PutFeedbackRequest request) { return putFeedbackAsync(request, null); } @Override public java.util.concurrent.Future putFeedbackAsync(final PutFeedbackRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final PutFeedbackRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public PutFeedbackResult call() throws Exception { PutFeedbackResult result = null; try { result = executePutFeedback(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future tagResourceAsync(TagResourceRequest request) { return tagResourceAsync(request, null); } @Override public java.util.concurrent.Future tagResourceAsync(final TagResourceRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final TagResourceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public TagResourceResult call() throws Exception { TagResourceResult result = null; try { result = executeTagResource(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future untagResourceAsync(UntagResourceRequest request) { return untagResourceAsync(request, null); } @Override public java.util.concurrent.Future untagResourceAsync(final UntagResourceRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UntagResourceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UntagResourceResult call() throws Exception { UntagResourceResult result = null; try { result = executeUntagResource(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future updateAlertAsync(UpdateAlertRequest request) { return updateAlertAsync(request, null); } @Override public java.util.concurrent.Future updateAlertAsync(final UpdateAlertRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateAlertRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateAlertResult call() throws Exception { UpdateAlertResult result = null; try { result = executeUpdateAlert(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 updateAnomalyDetectorAsync(UpdateAnomalyDetectorRequest request) { return updateAnomalyDetectorAsync(request, null); } @Override public java.util.concurrent.Future updateAnomalyDetectorAsync(final UpdateAnomalyDetectorRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateAnomalyDetectorRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateAnomalyDetectorResult call() throws Exception { UpdateAnomalyDetectorResult result = null; try { result = executeUpdateAnomalyDetector(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 updateMetricSetAsync(UpdateMetricSetRequest request) { return updateMetricSetAsync(request, null); } @Override public java.util.concurrent.Future updateMetricSetAsync(final UpdateMetricSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateMetricSetRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateMetricSetResult call() throws Exception { UpdateMetricSetResult result = null; try { result = executeUpdateMetricSet(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