com.amazonaws.services.appfabric.AWSAppFabricAsyncClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-appfabric 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.appfabric;
import javax.annotation.Generated;
import com.amazonaws.services.appfabric.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import java.util.concurrent.ExecutorService;
/**
* Client for accessing AppFabric 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 Web Services AppFabric quickly connects software as a service (SaaS) applications across your organization.
* This allows IT and security teams to easily manage and secure applications using a standard schema, and employees can
* complete everyday tasks faster using generative artificial intelligence (AI). You can use these APIs to complete
* AppFabric tasks, such as setting up audit log ingestions or viewing user access. For more information about
* AppFabric, including the required permissions to use the service, see the Amazon Web Services AppFabric Administration
* Guide. For more information about using the Command Line Interface (CLI) to manage your AppFabric resources, see
* the AppFabric section of the CLI
* Reference.
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSAppFabricAsyncClient extends AWSAppFabricClient implements AWSAppFabricAsync {
private static final int DEFAULT_THREAD_POOL_SIZE = 50;
private final java.util.concurrent.ExecutorService executorService;
public static AWSAppFabricAsyncClientBuilder asyncBuilder() {
return AWSAppFabricAsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on AppFabric using the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AWSAppFabricAsyncClient(AwsAsyncClientParams asyncClientParams) {
this(asyncClientParams, false);
}
/**
* Constructs a new asynchronous client to invoke service methods on AppFabric using the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
* @param endpointDiscoveryEnabled
* true will enable endpoint discovery if the service supports it.
*/
AWSAppFabricAsyncClient(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 batchGetUserAccessTasksAsync(BatchGetUserAccessTasksRequest request) {
return batchGetUserAccessTasksAsync(request, null);
}
@Override
public java.util.concurrent.Future batchGetUserAccessTasksAsync(final BatchGetUserAccessTasksRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final BatchGetUserAccessTasksRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public BatchGetUserAccessTasksResult call() throws Exception {
BatchGetUserAccessTasksResult result = null;
try {
result = executeBatchGetUserAccessTasks(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 connectAppAuthorizationAsync(ConnectAppAuthorizationRequest request) {
return connectAppAuthorizationAsync(request, null);
}
@Override
public java.util.concurrent.Future connectAppAuthorizationAsync(final ConnectAppAuthorizationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ConnectAppAuthorizationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ConnectAppAuthorizationResult call() throws Exception {
ConnectAppAuthorizationResult result = null;
try {
result = executeConnectAppAuthorization(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 createAppAuthorizationAsync(CreateAppAuthorizationRequest request) {
return createAppAuthorizationAsync(request, null);
}
@Override
public java.util.concurrent.Future createAppAuthorizationAsync(final CreateAppAuthorizationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateAppAuthorizationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateAppAuthorizationResult call() throws Exception {
CreateAppAuthorizationResult result = null;
try {
result = executeCreateAppAuthorization(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 createAppBundleAsync(CreateAppBundleRequest request) {
return createAppBundleAsync(request, null);
}
@Override
public java.util.concurrent.Future createAppBundleAsync(final CreateAppBundleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateAppBundleRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateAppBundleResult call() throws Exception {
CreateAppBundleResult result = null;
try {
result = executeCreateAppBundle(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 createIngestionAsync(CreateIngestionRequest request) {
return createIngestionAsync(request, null);
}
@Override
public java.util.concurrent.Future createIngestionAsync(final CreateIngestionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateIngestionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateIngestionResult call() throws Exception {
CreateIngestionResult result = null;
try {
result = executeCreateIngestion(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 createIngestionDestinationAsync(CreateIngestionDestinationRequest request) {
return createIngestionDestinationAsync(request, null);
}
@Override
public java.util.concurrent.Future createIngestionDestinationAsync(final CreateIngestionDestinationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateIngestionDestinationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateIngestionDestinationResult call() throws Exception {
CreateIngestionDestinationResult result = null;
try {
result = executeCreateIngestionDestination(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 deleteAppAuthorizationAsync(DeleteAppAuthorizationRequest request) {
return deleteAppAuthorizationAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteAppAuthorizationAsync(final DeleteAppAuthorizationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteAppAuthorizationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteAppAuthorizationResult call() throws Exception {
DeleteAppAuthorizationResult result = null;
try {
result = executeDeleteAppAuthorization(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 deleteAppBundleAsync(DeleteAppBundleRequest request) {
return deleteAppBundleAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteAppBundleAsync(final DeleteAppBundleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteAppBundleRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteAppBundleResult call() throws Exception {
DeleteAppBundleResult result = null;
try {
result = executeDeleteAppBundle(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 deleteIngestionAsync(DeleteIngestionRequest request) {
return deleteIngestionAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteIngestionAsync(final DeleteIngestionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteIngestionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteIngestionResult call() throws Exception {
DeleteIngestionResult result = null;
try {
result = executeDeleteIngestion(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 deleteIngestionDestinationAsync(DeleteIngestionDestinationRequest request) {
return deleteIngestionDestinationAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteIngestionDestinationAsync(final DeleteIngestionDestinationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteIngestionDestinationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteIngestionDestinationResult call() throws Exception {
DeleteIngestionDestinationResult result = null;
try {
result = executeDeleteIngestionDestination(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 getAppAuthorizationAsync(GetAppAuthorizationRequest request) {
return getAppAuthorizationAsync(request, null);
}
@Override
public java.util.concurrent.Future getAppAuthorizationAsync(final GetAppAuthorizationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetAppAuthorizationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetAppAuthorizationResult call() throws Exception {
GetAppAuthorizationResult result = null;
try {
result = executeGetAppAuthorization(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 getAppBundleAsync(GetAppBundleRequest request) {
return getAppBundleAsync(request, null);
}
@Override
public java.util.concurrent.Future getAppBundleAsync(final GetAppBundleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetAppBundleRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetAppBundleResult call() throws Exception {
GetAppBundleResult result = null;
try {
result = executeGetAppBundle(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 getIngestionAsync(GetIngestionRequest request) {
return getIngestionAsync(request, null);
}
@Override
public java.util.concurrent.Future getIngestionAsync(final GetIngestionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetIngestionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetIngestionResult call() throws Exception {
GetIngestionResult result = null;
try {
result = executeGetIngestion(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 getIngestionDestinationAsync(GetIngestionDestinationRequest request) {
return getIngestionDestinationAsync(request, null);
}
@Override
public java.util.concurrent.Future getIngestionDestinationAsync(final GetIngestionDestinationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetIngestionDestinationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetIngestionDestinationResult call() throws Exception {
GetIngestionDestinationResult result = null;
try {
result = executeGetIngestionDestination(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 listAppAuthorizationsAsync(ListAppAuthorizationsRequest request) {
return listAppAuthorizationsAsync(request, null);
}
@Override
public java.util.concurrent.Future listAppAuthorizationsAsync(final ListAppAuthorizationsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListAppAuthorizationsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListAppAuthorizationsResult call() throws Exception {
ListAppAuthorizationsResult result = null;
try {
result = executeListAppAuthorizations(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 listAppBundlesAsync(ListAppBundlesRequest request) {
return listAppBundlesAsync(request, null);
}
@Override
public java.util.concurrent.Future listAppBundlesAsync(final ListAppBundlesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListAppBundlesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListAppBundlesResult call() throws Exception {
ListAppBundlesResult result = null;
try {
result = executeListAppBundles(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 listIngestionDestinationsAsync(ListIngestionDestinationsRequest request) {
return listIngestionDestinationsAsync(request, null);
}
@Override
public java.util.concurrent.Future listIngestionDestinationsAsync(final ListIngestionDestinationsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListIngestionDestinationsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListIngestionDestinationsResult call() throws Exception {
ListIngestionDestinationsResult result = null;
try {
result = executeListIngestionDestinations(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 listIngestionsAsync(ListIngestionsRequest request) {
return listIngestionsAsync(request, null);
}
@Override
public java.util.concurrent.Future listIngestionsAsync(final ListIngestionsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListIngestionsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListIngestionsResult call() throws Exception {
ListIngestionsResult result = null;
try {
result = executeListIngestions(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 startIngestionAsync(StartIngestionRequest request) {
return startIngestionAsync(request, null);
}
@Override
public java.util.concurrent.Future startIngestionAsync(final StartIngestionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartIngestionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartIngestionResult call() throws Exception {
StartIngestionResult result = null;
try {
result = executeStartIngestion(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 startUserAccessTasksAsync(StartUserAccessTasksRequest request) {
return startUserAccessTasksAsync(request, null);
}
@Override
public java.util.concurrent.Future startUserAccessTasksAsync(final StartUserAccessTasksRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartUserAccessTasksRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartUserAccessTasksResult call() throws Exception {
StartUserAccessTasksResult result = null;
try {
result = executeStartUserAccessTasks(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 stopIngestionAsync(StopIngestionRequest request) {
return stopIngestionAsync(request, null);
}
@Override
public java.util.concurrent.Future stopIngestionAsync(final StopIngestionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StopIngestionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StopIngestionResult call() throws Exception {
StopIngestionResult result = null;
try {
result = executeStopIngestion(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 updateAppAuthorizationAsync(UpdateAppAuthorizationRequest request) {
return updateAppAuthorizationAsync(request, null);
}
@Override
public java.util.concurrent.Future updateAppAuthorizationAsync(final UpdateAppAuthorizationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateAppAuthorizationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateAppAuthorizationResult call() throws Exception {
UpdateAppAuthorizationResult result = null;
try {
result = executeUpdateAppAuthorization(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 updateIngestionDestinationAsync(UpdateIngestionDestinationRequest request) {
return updateIngestionDestinationAsync(request, null);
}
@Override
public java.util.concurrent.Future updateIngestionDestinationAsync(final UpdateIngestionDestinationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateIngestionDestinationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateIngestionDestinationResult call() throws Exception {
UpdateIngestionDestinationResult result = null;
try {
result = executeUpdateIngestionDestination(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();
}
}