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

com.amazonaws.services.lambda.AWSLambdaAsyncClient Maven / Gradle / Ivy

Go to download

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

There is a newer version: 1.12.772
Show newest version
/*
 * Copyright 2012-2017 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.lambda;

import static java.util.concurrent.Executors.newFixedThreadPool;

import javax.annotation.Generated;

import com.amazonaws.services.lambda.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSCredentialsProvider;
import java.util.concurrent.ExecutorService;
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;

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

* AWS Lambda *

* Overview *

*

* This is the AWS Lambda API Reference. The AWS Lambda Developer Guide provides additional information. For the * service overview, see What is AWS Lambda, and * for information about how the service works, see AWS Lambda: How it Works in the * AWS Lambda Developer Guide. *

*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AWSLambdaAsyncClient extends AWSLambdaClient implements AWSLambdaAsync { private static final int DEFAULT_THREAD_POOL_SIZE = 50; private final java.util.concurrent.ExecutorService executorService; /** * Constructs a new asynchronous client to invoke service methods on AWS Lambda. A credentials provider chain will * be used that searches for credentials in this order: *
    *
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • *
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • *
  • Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
  • *
  • Instance profile credentials delivered through the Amazon EC2 metadata service
  • *
*

* Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default * maximum number of concurrent connections to the service). * * @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain * @see java.util.concurrent.Executors#newFixedThreadPool(int) * @deprecated use {@link AWSLambdaAsyncClientBuilder#defaultClient()} */ @Deprecated public AWSLambdaAsyncClient() { this(DefaultAWSCredentialsProviderChain.getInstance()); } /** * Constructs a new asynchronous client to invoke service methods on AWS Lambda. A credentials provider chain will * be used that searches for credentials in this order: *

    *
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • *
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • *
  • Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
  • *
  • Instance profile credentials delivered through the Amazon EC2 metadata service
  • *
*

* Asynchronous methods are delegated to a fixed-size thread pool containing a number of threads equal to the * maximum number of concurrent connections configured via {@code ClientConfiguration.getMaxConnections()}. * * @param clientConfiguration * The client configuration options controlling how this client connects to AWS Lambda (ex: proxy settings, * retry counts, etc). * * @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain * @see java.util.concurrent.Executors#newFixedThreadPool(int) * @deprecated use {@link AWSLambdaAsyncClientBuilder#withClientConfiguration(ClientConfiguration)} */ @Deprecated public AWSLambdaAsyncClient(ClientConfiguration clientConfiguration) { this(DefaultAWSCredentialsProviderChain.getInstance(), clientConfiguration, newFixedThreadPool(clientConfiguration.getMaxConnections())); } /** * Constructs a new asynchronous client to invoke service methods on AWS Lambda using the specified AWS account * credentials. *

* Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default * maximum number of concurrent connections to the service). * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when authenticating with AWS services. * @see java.util.concurrent.Executors#newFixedThreadPool(int) * @deprecated use {@link AWSLambdaAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} */ @Deprecated public AWSLambdaAsyncClient(AWSCredentials awsCredentials) { this(awsCredentials, newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE)); } /** * Constructs a new asynchronous client to invoke service methods on AWS Lambda using the specified AWS account * credentials and executor service. Default client settings will be used. * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when authenticating with AWS services. * @param executorService * The executor service by which all asynchronous requests will be executed. * @deprecated use {@link AWSLambdaAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSLambdaAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)} */ @Deprecated public AWSLambdaAsyncClient(AWSCredentials awsCredentials, ExecutorService executorService) { this(awsCredentials, configFactory.getConfig(), executorService); } /** * Constructs a new asynchronous client to invoke service methods on AWS Lambda using the specified AWS account * credentials, executor service, and client configuration options. * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when authenticating with AWS services. * @param clientConfiguration * Client configuration options (ex: max retry limit, proxy settings, etc). * @param executorService * The executor service by which all asynchronous requests will be executed. * @deprecated use {@link AWSLambdaAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSLambdaAsyncClientBuilder#withClientConfiguration(ClientConfiguration)} and * {@link AWSLambdaAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)} */ @Deprecated public AWSLambdaAsyncClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration, ExecutorService executorService) { super(awsCredentials, clientConfiguration); this.executorService = executorService; } /** * Constructs a new asynchronous client to invoke service methods on AWS Lambda using the specified AWS account * credentials provider. Default client settings will be used. *

* Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default * maximum number of concurrent connections to the service). * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @see java.util.concurrent.Executors#newFixedThreadPool(int) * @deprecated use {@link AWSLambdaAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} */ @Deprecated public AWSLambdaAsyncClient(AWSCredentialsProvider awsCredentialsProvider) { this(awsCredentialsProvider, newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE)); } /** * Constructs a new asynchronous client to invoke service methods on AWS Lambda using the provided AWS account * credentials provider and client configuration options. *

* Asynchronous methods are delegated to a fixed-size thread pool containing a number of threads equal to the * maximum number of concurrent connections configured via {@code ClientConfiguration.getMaxConnections()}. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @param clientConfiguration * Client configuration options (ex: max retry limit, proxy settings, etc). * * @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain * @see java.util.concurrent.Executors#newFixedThreadPool(int) * @deprecated use {@link AWSLambdaAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSLambdaAsyncClientBuilder#withClientConfiguration(ClientConfiguration)} */ @Deprecated public AWSLambdaAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) { this(awsCredentialsProvider, clientConfiguration, newFixedThreadPool(clientConfiguration.getMaxConnections())); } /** * Constructs a new asynchronous client to invoke service methods on AWS Lambda using the specified AWS account * credentials provider and executor service. Default client settings will be used. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @param executorService * The executor service by which all asynchronous requests will be executed. * @deprecated use {@link AWSLambdaAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSLambdaAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)} */ @Deprecated public AWSLambdaAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ExecutorService executorService) { this(awsCredentialsProvider, configFactory.getConfig(), executorService); } /** * Constructs a new asynchronous client to invoke service methods on AWS Lambda using the specified AWS account * credentials provider, executor service, and client configuration options. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @param clientConfiguration * Client configuration options (ex: max retry limit, proxy settings, etc). * @param executorService * The executor service by which all asynchronous requests will be executed. * @deprecated use {@link AWSLambdaAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSLambdaAsyncClientBuilder#withClientConfiguration(ClientConfiguration)} and * {@link AWSLambdaAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)} */ @Deprecated public AWSLambdaAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, ExecutorService executorService) { super(awsCredentialsProvider, clientConfiguration); this.executorService = executorService; } public static AWSLambdaAsyncClientBuilder asyncBuilder() { return AWSLambdaAsyncClientBuilder.standard(); } /** * Constructs a new asynchronous client to invoke service methods on AWS Lambda using the specified parameters. * * @param asyncClientParams * Object providing client parameters. */ AWSLambdaAsyncClient(AwsAsyncClientParams asyncClientParams) { super(asyncClientParams); 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 addPermissionAsync(AddPermissionRequest request) { return addPermissionAsync(request, null); } @Override public java.util.concurrent.Future addPermissionAsync(final AddPermissionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final AddPermissionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public AddPermissionResult call() throws Exception { AddPermissionResult result = null; try { result = executeAddPermission(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 createAliasAsync(CreateAliasRequest request) { return createAliasAsync(request, null); } @Override public java.util.concurrent.Future createAliasAsync(final CreateAliasRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateAliasRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateAliasResult call() throws Exception { CreateAliasResult result = null; try { result = executeCreateAlias(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 createEventSourceMappingAsync(CreateEventSourceMappingRequest request) { return createEventSourceMappingAsync(request, null); } @Override public java.util.concurrent.Future createEventSourceMappingAsync(final CreateEventSourceMappingRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateEventSourceMappingRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateEventSourceMappingResult call() throws Exception { CreateEventSourceMappingResult result = null; try { result = executeCreateEventSourceMapping(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 createFunctionAsync(CreateFunctionRequest request) { return createFunctionAsync(request, null); } @Override public java.util.concurrent.Future createFunctionAsync(final CreateFunctionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateFunctionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateFunctionResult call() throws Exception { CreateFunctionResult result = null; try { result = executeCreateFunction(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 deleteAliasAsync(DeleteAliasRequest request) { return deleteAliasAsync(request, null); } @Override public java.util.concurrent.Future deleteAliasAsync(final DeleteAliasRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteAliasRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteAliasResult call() throws Exception { DeleteAliasResult result = null; try { result = executeDeleteAlias(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 deleteEventSourceMappingAsync(DeleteEventSourceMappingRequest request) { return deleteEventSourceMappingAsync(request, null); } @Override public java.util.concurrent.Future deleteEventSourceMappingAsync(final DeleteEventSourceMappingRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteEventSourceMappingRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteEventSourceMappingResult call() throws Exception { DeleteEventSourceMappingResult result = null; try { result = executeDeleteEventSourceMapping(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 deleteFunctionAsync(DeleteFunctionRequest request) { return deleteFunctionAsync(request, null); } @Override public java.util.concurrent.Future deleteFunctionAsync(final DeleteFunctionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteFunctionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteFunctionResult call() throws Exception { DeleteFunctionResult result = null; try { result = executeDeleteFunction(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 deleteFunctionConcurrencyAsync(DeleteFunctionConcurrencyRequest request) { return deleteFunctionConcurrencyAsync(request, null); } @Override public java.util.concurrent.Future deleteFunctionConcurrencyAsync(final DeleteFunctionConcurrencyRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteFunctionConcurrencyRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteFunctionConcurrencyResult call() throws Exception { DeleteFunctionConcurrencyResult result = null; try { result = executeDeleteFunctionConcurrency(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 getAccountSettingsAsync(GetAccountSettingsRequest request) { return getAccountSettingsAsync(request, null); } @Override public java.util.concurrent.Future getAccountSettingsAsync(final GetAccountSettingsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetAccountSettingsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetAccountSettingsResult call() throws Exception { GetAccountSettingsResult result = null; try { result = executeGetAccountSettings(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 getAliasAsync(GetAliasRequest request) { return getAliasAsync(request, null); } @Override public java.util.concurrent.Future getAliasAsync(final GetAliasRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetAliasRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetAliasResult call() throws Exception { GetAliasResult result = null; try { result = executeGetAlias(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 getEventSourceMappingAsync(GetEventSourceMappingRequest request) { return getEventSourceMappingAsync(request, null); } @Override public java.util.concurrent.Future getEventSourceMappingAsync(final GetEventSourceMappingRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetEventSourceMappingRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetEventSourceMappingResult call() throws Exception { GetEventSourceMappingResult result = null; try { result = executeGetEventSourceMapping(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 getFunctionAsync(GetFunctionRequest request) { return getFunctionAsync(request, null); } @Override public java.util.concurrent.Future getFunctionAsync(final GetFunctionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetFunctionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetFunctionResult call() throws Exception { GetFunctionResult result = null; try { result = executeGetFunction(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 getFunctionConfigurationAsync(GetFunctionConfigurationRequest request) { return getFunctionConfigurationAsync(request, null); } @Override public java.util.concurrent.Future getFunctionConfigurationAsync(final GetFunctionConfigurationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetFunctionConfigurationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetFunctionConfigurationResult call() throws Exception { GetFunctionConfigurationResult result = null; try { result = executeGetFunctionConfiguration(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 getPolicyAsync(GetPolicyRequest request) { return getPolicyAsync(request, null); } @Override public java.util.concurrent.Future getPolicyAsync(final GetPolicyRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetPolicyRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetPolicyResult call() throws Exception { GetPolicyResult result = null; try { result = executeGetPolicy(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 invokeAsync(InvokeRequest request) { return invokeAsync(request, null); } @Override public java.util.concurrent.Future invokeAsync(final InvokeRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final InvokeRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public InvokeResult call() throws Exception { InvokeResult result = null; try { result = executeInvoke(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future invokeAsyncAsync(InvokeAsyncRequest request) { return invokeAsyncAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future invokeAsyncAsync(final InvokeAsyncRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final InvokeAsyncRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public InvokeAsyncResult call() throws Exception { InvokeAsyncResult result = null; try { result = executeInvokeAsync(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 listAliasesAsync(ListAliasesRequest request) { return listAliasesAsync(request, null); } @Override public java.util.concurrent.Future listAliasesAsync(final ListAliasesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListAliasesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListAliasesResult call() throws Exception { ListAliasesResult result = null; try { result = executeListAliases(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 listEventSourceMappingsAsync(ListEventSourceMappingsRequest request) { return listEventSourceMappingsAsync(request, null); } @Override public java.util.concurrent.Future listEventSourceMappingsAsync(final ListEventSourceMappingsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListEventSourceMappingsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListEventSourceMappingsResult call() throws Exception { ListEventSourceMappingsResult result = null; try { result = executeListEventSourceMappings(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } /** * Simplified method form for invoking the ListEventSourceMappings operation. * * @see #listEventSourceMappingsAsync(ListEventSourceMappingsRequest) */ @Override public java.util.concurrent.Future listEventSourceMappingsAsync() { return listEventSourceMappingsAsync(new ListEventSourceMappingsRequest()); } /** * Simplified method form for invoking the ListEventSourceMappings operation with an AsyncHandler. * * @see #listEventSourceMappingsAsync(ListEventSourceMappingsRequest, com.amazonaws.handlers.AsyncHandler) */ @Override public java.util.concurrent.Future listEventSourceMappingsAsync( com.amazonaws.handlers.AsyncHandler asyncHandler) { return listEventSourceMappingsAsync(new ListEventSourceMappingsRequest(), asyncHandler); } @Override public java.util.concurrent.Future listFunctionsAsync(ListFunctionsRequest request) { return listFunctionsAsync(request, null); } @Override public java.util.concurrent.Future listFunctionsAsync(final ListFunctionsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListFunctionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListFunctionsResult call() throws Exception { ListFunctionsResult result = null; try { result = executeListFunctions(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } /** * Simplified method form for invoking the ListFunctions operation. * * @see #listFunctionsAsync(ListFunctionsRequest) */ @Override public java.util.concurrent.Future listFunctionsAsync() { return listFunctionsAsync(new ListFunctionsRequest()); } /** * Simplified method form for invoking the ListFunctions operation with an AsyncHandler. * * @see #listFunctionsAsync(ListFunctionsRequest, com.amazonaws.handlers.AsyncHandler) */ @Override public java.util.concurrent.Future listFunctionsAsync( com.amazonaws.handlers.AsyncHandler asyncHandler) { return listFunctionsAsync(new ListFunctionsRequest(), asyncHandler); } @Override public java.util.concurrent.Future listTagsAsync(ListTagsRequest request) { return listTagsAsync(request, null); } @Override public java.util.concurrent.Future listTagsAsync(final ListTagsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListTagsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListTagsResult call() throws Exception { ListTagsResult result = null; try { result = executeListTags(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 listVersionsByFunctionAsync(ListVersionsByFunctionRequest request) { return listVersionsByFunctionAsync(request, null); } @Override public java.util.concurrent.Future listVersionsByFunctionAsync(final ListVersionsByFunctionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListVersionsByFunctionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListVersionsByFunctionResult call() throws Exception { ListVersionsByFunctionResult result = null; try { result = executeListVersionsByFunction(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 publishVersionAsync(PublishVersionRequest request) { return publishVersionAsync(request, null); } @Override public java.util.concurrent.Future publishVersionAsync(final PublishVersionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final PublishVersionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public PublishVersionResult call() throws Exception { PublishVersionResult result = null; try { result = executePublishVersion(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 putFunctionConcurrencyAsync(PutFunctionConcurrencyRequest request) { return putFunctionConcurrencyAsync(request, null); } @Override public java.util.concurrent.Future putFunctionConcurrencyAsync(final PutFunctionConcurrencyRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final PutFunctionConcurrencyRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public PutFunctionConcurrencyResult call() throws Exception { PutFunctionConcurrencyResult result = null; try { result = executePutFunctionConcurrency(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 removePermissionAsync(RemovePermissionRequest request) { return removePermissionAsync(request, null); } @Override public java.util.concurrent.Future removePermissionAsync(final RemovePermissionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final RemovePermissionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public RemovePermissionResult call() throws Exception { RemovePermissionResult result = null; try { result = executeRemovePermission(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 updateAliasAsync(UpdateAliasRequest request) { return updateAliasAsync(request, null); } @Override public java.util.concurrent.Future updateAliasAsync(final UpdateAliasRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateAliasRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateAliasResult call() throws Exception { UpdateAliasResult result = null; try { result = executeUpdateAlias(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 updateEventSourceMappingAsync(UpdateEventSourceMappingRequest request) { return updateEventSourceMappingAsync(request, null); } @Override public java.util.concurrent.Future updateEventSourceMappingAsync(final UpdateEventSourceMappingRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateEventSourceMappingRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateEventSourceMappingResult call() throws Exception { UpdateEventSourceMappingResult result = null; try { result = executeUpdateEventSourceMapping(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 updateFunctionCodeAsync(UpdateFunctionCodeRequest request) { return updateFunctionCodeAsync(request, null); } @Override public java.util.concurrent.Future updateFunctionCodeAsync(final UpdateFunctionCodeRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateFunctionCodeRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateFunctionCodeResult call() throws Exception { UpdateFunctionCodeResult result = null; try { result = executeUpdateFunctionCode(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 updateFunctionConfigurationAsync(UpdateFunctionConfigurationRequest request) { return updateFunctionConfigurationAsync(request, null); } @Override public java.util.concurrent.Future updateFunctionConfigurationAsync(final UpdateFunctionConfigurationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateFunctionConfigurationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateFunctionConfigurationResult call() throws Exception { UpdateFunctionConfigurationResult result = null; try { result = executeUpdateFunctionConfiguration(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 - 2024 Weber Informatics LLC | Privacy Policy