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

com.amazonaws.services.lexmodelbuilding.AmazonLexModelBuildingAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Lex Model Building module holds the client classes that are used for communicating with Amazon Lex Model Building Service

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

import javax.annotation.Generated;

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

import java.util.concurrent.ExecutorService;

/**
 * Client for accessing Amazon Lex Model Building Service 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 Lex Build-Time Actions *

* Amazon Lex is an AWS service for building conversational voice and text interfaces. Use these actions to create, * update, and delete conversational bots for new and existing client applications. *

*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AmazonLexModelBuildingAsyncClient extends AmazonLexModelBuildingClient implements AmazonLexModelBuildingAsync { private static final int DEFAULT_THREAD_POOL_SIZE = 50; private final java.util.concurrent.ExecutorService executorService; public static AmazonLexModelBuildingAsyncClientBuilder asyncBuilder() { return AmazonLexModelBuildingAsyncClientBuilder.standard(); } /** * Constructs a new asynchronous client to invoke service methods on Amazon Lex Model Building Service using the * specified parameters. * * @param asyncClientParams * Object providing client parameters. */ AmazonLexModelBuildingAsyncClient(AwsAsyncClientParams asyncClientParams) { this(asyncClientParams, false); } /** * Constructs a new asynchronous client to invoke service methods on Amazon Lex Model Building Service using the * specified parameters. * * @param asyncClientParams * Object providing client parameters. * @param endpointDiscoveryEnabled * true will enable endpoint discovery if the service supports it. */ AmazonLexModelBuildingAsyncClient(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 createBotVersionAsync(CreateBotVersionRequest request) { return createBotVersionAsync(request, null); } @Override public java.util.concurrent.Future createBotVersionAsync(final CreateBotVersionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateBotVersionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateBotVersionResult call() throws Exception { CreateBotVersionResult result = null; try { result = executeCreateBotVersion(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 createIntentVersionAsync(CreateIntentVersionRequest request) { return createIntentVersionAsync(request, null); } @Override public java.util.concurrent.Future createIntentVersionAsync(final CreateIntentVersionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateIntentVersionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateIntentVersionResult call() throws Exception { CreateIntentVersionResult result = null; try { result = executeCreateIntentVersion(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 createSlotTypeVersionAsync(CreateSlotTypeVersionRequest request) { return createSlotTypeVersionAsync(request, null); } @Override public java.util.concurrent.Future createSlotTypeVersionAsync(final CreateSlotTypeVersionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateSlotTypeVersionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateSlotTypeVersionResult call() throws Exception { CreateSlotTypeVersionResult result = null; try { result = executeCreateSlotTypeVersion(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 deleteBotAsync(DeleteBotRequest request) { return deleteBotAsync(request, null); } @Override public java.util.concurrent.Future deleteBotAsync(final DeleteBotRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteBotRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteBotResult call() throws Exception { DeleteBotResult result = null; try { result = executeDeleteBot(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 deleteBotAliasAsync(DeleteBotAliasRequest request) { return deleteBotAliasAsync(request, null); } @Override public java.util.concurrent.Future deleteBotAliasAsync(final DeleteBotAliasRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteBotAliasRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteBotAliasResult call() throws Exception { DeleteBotAliasResult result = null; try { result = executeDeleteBotAlias(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 deleteBotChannelAssociationAsync(DeleteBotChannelAssociationRequest request) { return deleteBotChannelAssociationAsync(request, null); } @Override public java.util.concurrent.Future deleteBotChannelAssociationAsync(final DeleteBotChannelAssociationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteBotChannelAssociationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteBotChannelAssociationResult call() throws Exception { DeleteBotChannelAssociationResult result = null; try { result = executeDeleteBotChannelAssociation(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 deleteBotVersionAsync(DeleteBotVersionRequest request) { return deleteBotVersionAsync(request, null); } @Override public java.util.concurrent.Future deleteBotVersionAsync(final DeleteBotVersionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteBotVersionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteBotVersionResult call() throws Exception { DeleteBotVersionResult result = null; try { result = executeDeleteBotVersion(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 deleteIntentAsync(DeleteIntentRequest request) { return deleteIntentAsync(request, null); } @Override public java.util.concurrent.Future deleteIntentAsync(final DeleteIntentRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteIntentRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteIntentResult call() throws Exception { DeleteIntentResult result = null; try { result = executeDeleteIntent(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 deleteIntentVersionAsync(DeleteIntentVersionRequest request) { return deleteIntentVersionAsync(request, null); } @Override public java.util.concurrent.Future deleteIntentVersionAsync(final DeleteIntentVersionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteIntentVersionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteIntentVersionResult call() throws Exception { DeleteIntentVersionResult result = null; try { result = executeDeleteIntentVersion(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 deleteSlotTypeAsync(DeleteSlotTypeRequest request) { return deleteSlotTypeAsync(request, null); } @Override public java.util.concurrent.Future deleteSlotTypeAsync(final DeleteSlotTypeRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteSlotTypeRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteSlotTypeResult call() throws Exception { DeleteSlotTypeResult result = null; try { result = executeDeleteSlotType(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 deleteSlotTypeVersionAsync(DeleteSlotTypeVersionRequest request) { return deleteSlotTypeVersionAsync(request, null); } @Override public java.util.concurrent.Future deleteSlotTypeVersionAsync(final DeleteSlotTypeVersionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteSlotTypeVersionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteSlotTypeVersionResult call() throws Exception { DeleteSlotTypeVersionResult result = null; try { result = executeDeleteSlotTypeVersion(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 deleteUtterancesAsync(DeleteUtterancesRequest request) { return deleteUtterancesAsync(request, null); } @Override public java.util.concurrent.Future deleteUtterancesAsync(final DeleteUtterancesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteUtterancesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteUtterancesResult call() throws Exception { DeleteUtterancesResult result = null; try { result = executeDeleteUtterances(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 getBotAsync(GetBotRequest request) { return getBotAsync(request, null); } @Override public java.util.concurrent.Future getBotAsync(final GetBotRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetBotRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetBotResult call() throws Exception { GetBotResult result = null; try { result = executeGetBot(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 getBotAliasAsync(GetBotAliasRequest request) { return getBotAliasAsync(request, null); } @Override public java.util.concurrent.Future getBotAliasAsync(final GetBotAliasRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetBotAliasRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetBotAliasResult call() throws Exception { GetBotAliasResult result = null; try { result = executeGetBotAlias(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 getBotAliasesAsync(GetBotAliasesRequest request) { return getBotAliasesAsync(request, null); } @Override public java.util.concurrent.Future getBotAliasesAsync(final GetBotAliasesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetBotAliasesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetBotAliasesResult call() throws Exception { GetBotAliasesResult result = null; try { result = executeGetBotAliases(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 getBotChannelAssociationAsync(GetBotChannelAssociationRequest request) { return getBotChannelAssociationAsync(request, null); } @Override public java.util.concurrent.Future getBotChannelAssociationAsync(final GetBotChannelAssociationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetBotChannelAssociationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetBotChannelAssociationResult call() throws Exception { GetBotChannelAssociationResult result = null; try { result = executeGetBotChannelAssociation(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 getBotChannelAssociationsAsync(GetBotChannelAssociationsRequest request) { return getBotChannelAssociationsAsync(request, null); } @Override public java.util.concurrent.Future getBotChannelAssociationsAsync(final GetBotChannelAssociationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetBotChannelAssociationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetBotChannelAssociationsResult call() throws Exception { GetBotChannelAssociationsResult result = null; try { result = executeGetBotChannelAssociations(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 getBotVersionsAsync(GetBotVersionsRequest request) { return getBotVersionsAsync(request, null); } @Override public java.util.concurrent.Future getBotVersionsAsync(final GetBotVersionsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetBotVersionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetBotVersionsResult call() throws Exception { GetBotVersionsResult result = null; try { result = executeGetBotVersions(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 getBotsAsync(GetBotsRequest request) { return getBotsAsync(request, null); } @Override public java.util.concurrent.Future getBotsAsync(final GetBotsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetBotsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetBotsResult call() throws Exception { GetBotsResult result = null; try { result = executeGetBots(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 getBuiltinIntentAsync(GetBuiltinIntentRequest request) { return getBuiltinIntentAsync(request, null); } @Override public java.util.concurrent.Future getBuiltinIntentAsync(final GetBuiltinIntentRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetBuiltinIntentRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetBuiltinIntentResult call() throws Exception { GetBuiltinIntentResult result = null; try { result = executeGetBuiltinIntent(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 getBuiltinIntentsAsync(GetBuiltinIntentsRequest request) { return getBuiltinIntentsAsync(request, null); } @Override public java.util.concurrent.Future getBuiltinIntentsAsync(final GetBuiltinIntentsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetBuiltinIntentsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetBuiltinIntentsResult call() throws Exception { GetBuiltinIntentsResult result = null; try { result = executeGetBuiltinIntents(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 getBuiltinSlotTypesAsync(GetBuiltinSlotTypesRequest request) { return getBuiltinSlotTypesAsync(request, null); } @Override public java.util.concurrent.Future getBuiltinSlotTypesAsync(final GetBuiltinSlotTypesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetBuiltinSlotTypesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetBuiltinSlotTypesResult call() throws Exception { GetBuiltinSlotTypesResult result = null; try { result = executeGetBuiltinSlotTypes(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 getExportAsync(GetExportRequest request) { return getExportAsync(request, null); } @Override public java.util.concurrent.Future getExportAsync(final GetExportRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetExportRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetExportResult call() throws Exception { GetExportResult result = null; try { result = executeGetExport(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 getImportAsync(GetImportRequest request) { return getImportAsync(request, null); } @Override public java.util.concurrent.Future getImportAsync(final GetImportRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetImportRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetImportResult call() throws Exception { GetImportResult result = null; try { result = executeGetImport(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 getIntentAsync(GetIntentRequest request) { return getIntentAsync(request, null); } @Override public java.util.concurrent.Future getIntentAsync(final GetIntentRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetIntentRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetIntentResult call() throws Exception { GetIntentResult result = null; try { result = executeGetIntent(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 getIntentVersionsAsync(GetIntentVersionsRequest request) { return getIntentVersionsAsync(request, null); } @Override public java.util.concurrent.Future getIntentVersionsAsync(final GetIntentVersionsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetIntentVersionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetIntentVersionsResult call() throws Exception { GetIntentVersionsResult result = null; try { result = executeGetIntentVersions(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 getIntentsAsync(GetIntentsRequest request) { return getIntentsAsync(request, null); } @Override public java.util.concurrent.Future getIntentsAsync(final GetIntentsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetIntentsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetIntentsResult call() throws Exception { GetIntentsResult result = null; try { result = executeGetIntents(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 getMigrationAsync(GetMigrationRequest request) { return getMigrationAsync(request, null); } @Override public java.util.concurrent.Future getMigrationAsync(final GetMigrationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetMigrationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetMigrationResult call() throws Exception { GetMigrationResult result = null; try { result = executeGetMigration(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 getMigrationsAsync(GetMigrationsRequest request) { return getMigrationsAsync(request, null); } @Override public java.util.concurrent.Future getMigrationsAsync(final GetMigrationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetMigrationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetMigrationsResult call() throws Exception { GetMigrationsResult result = null; try { result = executeGetMigrations(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 getSlotTypeAsync(GetSlotTypeRequest request) { return getSlotTypeAsync(request, null); } @Override public java.util.concurrent.Future getSlotTypeAsync(final GetSlotTypeRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetSlotTypeRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetSlotTypeResult call() throws Exception { GetSlotTypeResult result = null; try { result = executeGetSlotType(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 getSlotTypeVersionsAsync(GetSlotTypeVersionsRequest request) { return getSlotTypeVersionsAsync(request, null); } @Override public java.util.concurrent.Future getSlotTypeVersionsAsync(final GetSlotTypeVersionsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetSlotTypeVersionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetSlotTypeVersionsResult call() throws Exception { GetSlotTypeVersionsResult result = null; try { result = executeGetSlotTypeVersions(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 getSlotTypesAsync(GetSlotTypesRequest request) { return getSlotTypesAsync(request, null); } @Override public java.util.concurrent.Future getSlotTypesAsync(final GetSlotTypesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetSlotTypesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetSlotTypesResult call() throws Exception { GetSlotTypesResult result = null; try { result = executeGetSlotTypes(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 getUtterancesViewAsync(GetUtterancesViewRequest request) { return getUtterancesViewAsync(request, null); } @Override public java.util.concurrent.Future getUtterancesViewAsync(final GetUtterancesViewRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetUtterancesViewRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetUtterancesViewResult call() throws Exception { GetUtterancesViewResult result = null; try { result = executeGetUtterancesView(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 putBotAsync(PutBotRequest request) { return putBotAsync(request, null); } @Override public java.util.concurrent.Future putBotAsync(final PutBotRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final PutBotRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public PutBotResult call() throws Exception { PutBotResult result = null; try { result = executePutBot(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 putBotAliasAsync(PutBotAliasRequest request) { return putBotAliasAsync(request, null); } @Override public java.util.concurrent.Future putBotAliasAsync(final PutBotAliasRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final PutBotAliasRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public PutBotAliasResult call() throws Exception { PutBotAliasResult result = null; try { result = executePutBotAlias(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 putIntentAsync(PutIntentRequest request) { return putIntentAsync(request, null); } @Override public java.util.concurrent.Future putIntentAsync(final PutIntentRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final PutIntentRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public PutIntentResult call() throws Exception { PutIntentResult result = null; try { result = executePutIntent(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 putSlotTypeAsync(PutSlotTypeRequest request) { return putSlotTypeAsync(request, null); } @Override public java.util.concurrent.Future putSlotTypeAsync(final PutSlotTypeRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final PutSlotTypeRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public PutSlotTypeResult call() throws Exception { PutSlotTypeResult result = null; try { result = executePutSlotType(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 startImportAsync(StartImportRequest request) { return startImportAsync(request, null); } @Override public java.util.concurrent.Future startImportAsync(final StartImportRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final StartImportRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public StartImportResult call() throws Exception { StartImportResult result = null; try { result = executeStartImport(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 startMigrationAsync(StartMigrationRequest request) { return startMigrationAsync(request, null); } @Override public java.util.concurrent.Future startMigrationAsync(final StartMigrationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final StartMigrationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public StartMigrationResult call() throws Exception { StartMigrationResult result = null; try { result = executeStartMigration(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; } }); } /** * Shuts down the client, releasing all managed resources. This includes forcibly terminating all pending * asynchronous service calls. Clients who wish to give pending asynchronous service calls time to complete should * call {@code getExecutorService().shutdown()} followed by {@code getExecutorService().awaitTermination()} prior to * calling this method. */ @Override public void shutdown() { super.shutdown(); executorService.shutdownNow(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy