com.amazonaws.services.applicationinsights.AmazonApplicationInsightsAsyncClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-applicationinsights 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.applicationinsights;
import javax.annotation.Generated;
import com.amazonaws.services.applicationinsights.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import java.util.concurrent.ExecutorService;
/**
* Client for accessing Application Insights 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.
*
* Amazon CloudWatch Application Insights
*
* Amazon CloudWatch Application Insights is a service that helps you detect common problems with your applications. It
* enables you to pinpoint the source of issues in your applications (built with technologies such as Microsoft IIS,
* .NET, and Microsoft SQL Server), by providing key insights into detected problems.
*
*
* After you onboard your application, CloudWatch Application Insights identifies, recommends, and sets up metrics and
* logs. It continuously analyzes and correlates your metrics and logs for unusual behavior to surface actionable
* problems with your application. For example, if your application is slow and unresponsive and leading to HTTP 500
* errors in your Application Load Balancer (ALB), Application Insights informs you that a memory pressure problem with
* your SQL Server database is occurring. It bases this analysis on impactful metrics and log errors.
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AmazonApplicationInsightsAsyncClient extends AmazonApplicationInsightsClient implements AmazonApplicationInsightsAsync {
private static final int DEFAULT_THREAD_POOL_SIZE = 50;
private final java.util.concurrent.ExecutorService executorService;
public static AmazonApplicationInsightsAsyncClientBuilder asyncBuilder() {
return AmazonApplicationInsightsAsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on Application Insights using the specified
* parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AmazonApplicationInsightsAsyncClient(AwsAsyncClientParams asyncClientParams) {
this(asyncClientParams, false);
}
/**
* Constructs a new asynchronous client to invoke service methods on Application Insights using the specified
* parameters.
*
* @param asyncClientParams
* Object providing client parameters.
* @param endpointDiscoveryEnabled
* true will enable endpoint discovery if the service supports it.
*/
AmazonApplicationInsightsAsyncClient(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 addWorkloadAsync(AddWorkloadRequest request) {
return addWorkloadAsync(request, null);
}
@Override
public java.util.concurrent.Future addWorkloadAsync(final AddWorkloadRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AddWorkloadRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AddWorkloadResult call() throws Exception {
AddWorkloadResult result = null;
try {
result = executeAddWorkload(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 createApplicationAsync(CreateApplicationRequest request) {
return createApplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future createApplicationAsync(final CreateApplicationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateApplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateApplicationResult call() throws Exception {
CreateApplicationResult result = null;
try {
result = executeCreateApplication(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 createComponentAsync(CreateComponentRequest request) {
return createComponentAsync(request, null);
}
@Override
public java.util.concurrent.Future createComponentAsync(final CreateComponentRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateComponentRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateComponentResult call() throws Exception {
CreateComponentResult result = null;
try {
result = executeCreateComponent(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 createLogPatternAsync(CreateLogPatternRequest request) {
return createLogPatternAsync(request, null);
}
@Override
public java.util.concurrent.Future createLogPatternAsync(final CreateLogPatternRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateLogPatternRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateLogPatternResult call() throws Exception {
CreateLogPatternResult result = null;
try {
result = executeCreateLogPattern(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 deleteApplicationAsync(DeleteApplicationRequest request) {
return deleteApplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteApplicationAsync(final DeleteApplicationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteApplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteApplicationResult call() throws Exception {
DeleteApplicationResult result = null;
try {
result = executeDeleteApplication(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 deleteComponentAsync(DeleteComponentRequest request) {
return deleteComponentAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteComponentAsync(final DeleteComponentRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteComponentRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteComponentResult call() throws Exception {
DeleteComponentResult result = null;
try {
result = executeDeleteComponent(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 deleteLogPatternAsync(DeleteLogPatternRequest request) {
return deleteLogPatternAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteLogPatternAsync(final DeleteLogPatternRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteLogPatternRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteLogPatternResult call() throws Exception {
DeleteLogPatternResult result = null;
try {
result = executeDeleteLogPattern(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 describeApplicationAsync(DescribeApplicationRequest request) {
return describeApplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future describeApplicationAsync(final DescribeApplicationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeApplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeApplicationResult call() throws Exception {
DescribeApplicationResult result = null;
try {
result = executeDescribeApplication(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 describeComponentAsync(DescribeComponentRequest request) {
return describeComponentAsync(request, null);
}
@Override
public java.util.concurrent.Future describeComponentAsync(final DescribeComponentRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeComponentRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeComponentResult call() throws Exception {
DescribeComponentResult result = null;
try {
result = executeDescribeComponent(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 describeComponentConfigurationAsync(DescribeComponentConfigurationRequest request) {
return describeComponentConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future describeComponentConfigurationAsync(
final DescribeComponentConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeComponentConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeComponentConfigurationResult call() throws Exception {
DescribeComponentConfigurationResult result = null;
try {
result = executeDescribeComponentConfiguration(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 describeComponentConfigurationRecommendationAsync(
DescribeComponentConfigurationRecommendationRequest request) {
return describeComponentConfigurationRecommendationAsync(request, null);
}
@Override
public java.util.concurrent.Future describeComponentConfigurationRecommendationAsync(
final DescribeComponentConfigurationRecommendationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeComponentConfigurationRecommendationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeComponentConfigurationRecommendationResult call() throws Exception {
DescribeComponentConfigurationRecommendationResult result = null;
try {
result = executeDescribeComponentConfigurationRecommendation(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 describeLogPatternAsync(DescribeLogPatternRequest request) {
return describeLogPatternAsync(request, null);
}
@Override
public java.util.concurrent.Future describeLogPatternAsync(final DescribeLogPatternRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeLogPatternRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeLogPatternResult call() throws Exception {
DescribeLogPatternResult result = null;
try {
result = executeDescribeLogPattern(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 describeObservationAsync(DescribeObservationRequest request) {
return describeObservationAsync(request, null);
}
@Override
public java.util.concurrent.Future describeObservationAsync(final DescribeObservationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeObservationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeObservationResult call() throws Exception {
DescribeObservationResult result = null;
try {
result = executeDescribeObservation(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 describeProblemAsync(DescribeProblemRequest request) {
return describeProblemAsync(request, null);
}
@Override
public java.util.concurrent.Future describeProblemAsync(final DescribeProblemRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeProblemRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeProblemResult call() throws Exception {
DescribeProblemResult result = null;
try {
result = executeDescribeProblem(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 describeProblemObservationsAsync(DescribeProblemObservationsRequest request) {
return describeProblemObservationsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeProblemObservationsAsync(final DescribeProblemObservationsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeProblemObservationsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeProblemObservationsResult call() throws Exception {
DescribeProblemObservationsResult result = null;
try {
result = executeDescribeProblemObservations(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 describeWorkloadAsync(DescribeWorkloadRequest request) {
return describeWorkloadAsync(request, null);
}
@Override
public java.util.concurrent.Future describeWorkloadAsync(final DescribeWorkloadRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeWorkloadRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeWorkloadResult call() throws Exception {
DescribeWorkloadResult result = null;
try {
result = executeDescribeWorkload(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 listApplicationsAsync(ListApplicationsRequest request) {
return listApplicationsAsync(request, null);
}
@Override
public java.util.concurrent.Future listApplicationsAsync(final ListApplicationsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListApplicationsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListApplicationsResult call() throws Exception {
ListApplicationsResult result = null;
try {
result = executeListApplications(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 listComponentsAsync(ListComponentsRequest request) {
return listComponentsAsync(request, null);
}
@Override
public java.util.concurrent.Future listComponentsAsync(final ListComponentsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListComponentsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListComponentsResult call() throws Exception {
ListComponentsResult result = null;
try {
result = executeListComponents(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 listConfigurationHistoryAsync(ListConfigurationHistoryRequest request) {
return listConfigurationHistoryAsync(request, null);
}
@Override
public java.util.concurrent.Future listConfigurationHistoryAsync(final ListConfigurationHistoryRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListConfigurationHistoryRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListConfigurationHistoryResult call() throws Exception {
ListConfigurationHistoryResult result = null;
try {
result = executeListConfigurationHistory(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 listLogPatternSetsAsync(ListLogPatternSetsRequest request) {
return listLogPatternSetsAsync(request, null);
}
@Override
public java.util.concurrent.Future listLogPatternSetsAsync(final ListLogPatternSetsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListLogPatternSetsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListLogPatternSetsResult call() throws Exception {
ListLogPatternSetsResult result = null;
try {
result = executeListLogPatternSets(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 listLogPatternsAsync(ListLogPatternsRequest request) {
return listLogPatternsAsync(request, null);
}
@Override
public java.util.concurrent.Future listLogPatternsAsync(final ListLogPatternsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListLogPatternsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListLogPatternsResult call() throws Exception {
ListLogPatternsResult result = null;
try {
result = executeListLogPatterns(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 listProblemsAsync(ListProblemsRequest request) {
return listProblemsAsync(request, null);
}
@Override
public java.util.concurrent.Future listProblemsAsync(final ListProblemsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListProblemsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListProblemsResult call() throws Exception {
ListProblemsResult result = null;
try {
result = executeListProblems(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 listWorkloadsAsync(ListWorkloadsRequest request) {
return listWorkloadsAsync(request, null);
}
@Override
public java.util.concurrent.Future listWorkloadsAsync(final ListWorkloadsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListWorkloadsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListWorkloadsResult call() throws Exception {
ListWorkloadsResult result = null;
try {
result = executeListWorkloads(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 removeWorkloadAsync(RemoveWorkloadRequest request) {
return removeWorkloadAsync(request, null);
}
@Override
public java.util.concurrent.Future removeWorkloadAsync(final RemoveWorkloadRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final RemoveWorkloadRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public RemoveWorkloadResult call() throws Exception {
RemoveWorkloadResult result = null;
try {
result = executeRemoveWorkload(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 updateApplicationAsync(UpdateApplicationRequest request) {
return updateApplicationAsync(request, null);
}
@Override
public java.util.concurrent.Future updateApplicationAsync(final UpdateApplicationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateApplicationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateApplicationResult call() throws Exception {
UpdateApplicationResult result = null;
try {
result = executeUpdateApplication(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 updateComponentAsync(UpdateComponentRequest request) {
return updateComponentAsync(request, null);
}
@Override
public java.util.concurrent.Future updateComponentAsync(final UpdateComponentRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateComponentRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateComponentResult call() throws Exception {
UpdateComponentResult result = null;
try {
result = executeUpdateComponent(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 updateComponentConfigurationAsync(UpdateComponentConfigurationRequest request) {
return updateComponentConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future updateComponentConfigurationAsync(final UpdateComponentConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateComponentConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateComponentConfigurationResult call() throws Exception {
UpdateComponentConfigurationResult result = null;
try {
result = executeUpdateComponentConfiguration(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 updateLogPatternAsync(UpdateLogPatternRequest request) {
return updateLogPatternAsync(request, null);
}
@Override
public java.util.concurrent.Future updateLogPatternAsync(final UpdateLogPatternRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateLogPatternRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateLogPatternResult call() throws Exception {
UpdateLogPatternResult result = null;
try {
result = executeUpdateLogPattern(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 updateProblemAsync(UpdateProblemRequest request) {
return updateProblemAsync(request, null);
}
@Override
public java.util.concurrent.Future updateProblemAsync(final UpdateProblemRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateProblemRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateProblemResult call() throws Exception {
UpdateProblemResult result = null;
try {
result = executeUpdateProblem(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 updateWorkloadAsync(UpdateWorkloadRequest request) {
return updateWorkloadAsync(request, null);
}
@Override
public java.util.concurrent.Future updateWorkloadAsync(final UpdateWorkloadRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateWorkloadRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateWorkloadResult call() throws Exception {
UpdateWorkloadResult result = null;
try {
result = executeUpdateWorkload(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();
}
}