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

com.amazonaws.services.qconnect.AmazonQConnectAsyncClient Maven / Gradle / Ivy

Go to download

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

The newest version!
/*
 * 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.qconnect;

import javax.annotation.Generated;

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

import java.util.concurrent.ExecutorService;

/**
 * Client for accessing Amazon Q Connect 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.
 * 

* *

* Powered by Amazon Bedrock: Amazon Web Services implements automated abuse detection. * Because Amazon Q in Connect is built on Amazon Bedrock, users can take full advantage of the controls implemented in * Amazon Bedrock to enforce safety, security, and the responsible use of artificial intelligence (AI). *

* *

* Amazon Q in Connect is a generative AI customer service assistant. It is an LLM-enhanced evolution of Amazon Connect * Wisdom that delivers real-time recommendations to help contact center agents resolve customer issues quickly and * accurately. *

*

* Amazon Q in Connect automatically detects customer intent during calls and chats using conversational analytics and * natural language understanding (NLU). It then provides agents with immediate, real-time generative responses and * suggested actions, and links to relevant documents and articles. Agents can also query Amazon Q in Connect directly * using natural language or keywords to answer customer requests. *

*

* Use the Amazon Q in Connect APIs to create an assistant and a knowledge base, for example, or manage content by * uploading custom files. *

*

* For more information, see Use * Amazon Q in Connect for generative AI powered agent assistance in real-time in the Amazon Connect * Administrator Guide. *

*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AmazonQConnectAsyncClient extends AmazonQConnectClient implements AmazonQConnectAsync { private static final int DEFAULT_THREAD_POOL_SIZE = 50; private final java.util.concurrent.ExecutorService executorService; public static AmazonQConnectAsyncClientBuilder asyncBuilder() { return AmazonQConnectAsyncClientBuilder.standard(); } /** * Constructs a new asynchronous client to invoke service methods on Amazon Q Connect using the specified * parameters. * * @param asyncClientParams * Object providing client parameters. */ AmazonQConnectAsyncClient(AwsAsyncClientParams asyncClientParams) { this(asyncClientParams, false); } /** * Constructs a new asynchronous client to invoke service methods on Amazon Q Connect using the specified * parameters. * * @param asyncClientParams * Object providing client parameters. * @param endpointDiscoveryEnabled * true will enable endpoint discovery if the service supports it. */ AmazonQConnectAsyncClient(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 createAssistantAsync(CreateAssistantRequest request) { return createAssistantAsync(request, null); } @Override public java.util.concurrent.Future createAssistantAsync(final CreateAssistantRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateAssistantRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateAssistantResult call() throws Exception { CreateAssistantResult result = null; try { result = executeCreateAssistant(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 createAssistantAssociationAsync(CreateAssistantAssociationRequest request) { return createAssistantAssociationAsync(request, null); } @Override public java.util.concurrent.Future createAssistantAssociationAsync(final CreateAssistantAssociationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateAssistantAssociationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateAssistantAssociationResult call() throws Exception { CreateAssistantAssociationResult result = null; try { result = executeCreateAssistantAssociation(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 createContentAsync(CreateContentRequest request) { return createContentAsync(request, null); } @Override public java.util.concurrent.Future createContentAsync(final CreateContentRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateContentRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateContentResult call() throws Exception { CreateContentResult result = null; try { result = executeCreateContent(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 createContentAssociationAsync(CreateContentAssociationRequest request) { return createContentAssociationAsync(request, null); } @Override public java.util.concurrent.Future createContentAssociationAsync(final CreateContentAssociationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateContentAssociationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateContentAssociationResult call() throws Exception { CreateContentAssociationResult result = null; try { result = executeCreateContentAssociation(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 createKnowledgeBaseAsync(CreateKnowledgeBaseRequest request) { return createKnowledgeBaseAsync(request, null); } @Override public java.util.concurrent.Future createKnowledgeBaseAsync(final CreateKnowledgeBaseRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateKnowledgeBaseRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateKnowledgeBaseResult call() throws Exception { CreateKnowledgeBaseResult result = null; try { result = executeCreateKnowledgeBase(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 createQuickResponseAsync(CreateQuickResponseRequest request) { return createQuickResponseAsync(request, null); } @Override public java.util.concurrent.Future createQuickResponseAsync(final CreateQuickResponseRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateQuickResponseRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateQuickResponseResult call() throws Exception { CreateQuickResponseResult result = null; try { result = executeCreateQuickResponse(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 createSessionAsync(CreateSessionRequest request) { return createSessionAsync(request, null); } @Override public java.util.concurrent.Future createSessionAsync(final CreateSessionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateSessionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateSessionResult call() throws Exception { CreateSessionResult result = null; try { result = executeCreateSession(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 deleteAssistantAsync(DeleteAssistantRequest request) { return deleteAssistantAsync(request, null); } @Override public java.util.concurrent.Future deleteAssistantAsync(final DeleteAssistantRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteAssistantRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteAssistantResult call() throws Exception { DeleteAssistantResult result = null; try { result = executeDeleteAssistant(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 deleteAssistantAssociationAsync(DeleteAssistantAssociationRequest request) { return deleteAssistantAssociationAsync(request, null); } @Override public java.util.concurrent.Future deleteAssistantAssociationAsync(final DeleteAssistantAssociationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteAssistantAssociationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteAssistantAssociationResult call() throws Exception { DeleteAssistantAssociationResult result = null; try { result = executeDeleteAssistantAssociation(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 deleteContentAsync(DeleteContentRequest request) { return deleteContentAsync(request, null); } @Override public java.util.concurrent.Future deleteContentAsync(final DeleteContentRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteContentRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteContentResult call() throws Exception { DeleteContentResult result = null; try { result = executeDeleteContent(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 deleteContentAssociationAsync(DeleteContentAssociationRequest request) { return deleteContentAssociationAsync(request, null); } @Override public java.util.concurrent.Future deleteContentAssociationAsync(final DeleteContentAssociationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteContentAssociationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteContentAssociationResult call() throws Exception { DeleteContentAssociationResult result = null; try { result = executeDeleteContentAssociation(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 deleteImportJobAsync(DeleteImportJobRequest request) { return deleteImportJobAsync(request, null); } @Override public java.util.concurrent.Future deleteImportJobAsync(final DeleteImportJobRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteImportJobRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteImportJobResult call() throws Exception { DeleteImportJobResult result = null; try { result = executeDeleteImportJob(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 deleteKnowledgeBaseAsync(DeleteKnowledgeBaseRequest request) { return deleteKnowledgeBaseAsync(request, null); } @Override public java.util.concurrent.Future deleteKnowledgeBaseAsync(final DeleteKnowledgeBaseRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteKnowledgeBaseRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteKnowledgeBaseResult call() throws Exception { DeleteKnowledgeBaseResult result = null; try { result = executeDeleteKnowledgeBase(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 deleteQuickResponseAsync(DeleteQuickResponseRequest request) { return deleteQuickResponseAsync(request, null); } @Override public java.util.concurrent.Future deleteQuickResponseAsync(final DeleteQuickResponseRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteQuickResponseRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteQuickResponseResult call() throws Exception { DeleteQuickResponseResult result = null; try { result = executeDeleteQuickResponse(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 getAssistantAsync(GetAssistantRequest request) { return getAssistantAsync(request, null); } @Override public java.util.concurrent.Future getAssistantAsync(final GetAssistantRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetAssistantRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetAssistantResult call() throws Exception { GetAssistantResult result = null; try { result = executeGetAssistant(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 getAssistantAssociationAsync(GetAssistantAssociationRequest request) { return getAssistantAssociationAsync(request, null); } @Override public java.util.concurrent.Future getAssistantAssociationAsync(final GetAssistantAssociationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetAssistantAssociationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetAssistantAssociationResult call() throws Exception { GetAssistantAssociationResult result = null; try { result = executeGetAssistantAssociation(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 getContentAsync(GetContentRequest request) { return getContentAsync(request, null); } @Override public java.util.concurrent.Future getContentAsync(final GetContentRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetContentRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetContentResult call() throws Exception { GetContentResult result = null; try { result = executeGetContent(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 getContentAssociationAsync(GetContentAssociationRequest request) { return getContentAssociationAsync(request, null); } @Override public java.util.concurrent.Future getContentAssociationAsync(final GetContentAssociationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetContentAssociationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetContentAssociationResult call() throws Exception { GetContentAssociationResult result = null; try { result = executeGetContentAssociation(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 getContentSummaryAsync(GetContentSummaryRequest request) { return getContentSummaryAsync(request, null); } @Override public java.util.concurrent.Future getContentSummaryAsync(final GetContentSummaryRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetContentSummaryRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetContentSummaryResult call() throws Exception { GetContentSummaryResult result = null; try { result = executeGetContentSummary(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 getImportJobAsync(GetImportJobRequest request) { return getImportJobAsync(request, null); } @Override public java.util.concurrent.Future getImportJobAsync(final GetImportJobRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetImportJobRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetImportJobResult call() throws Exception { GetImportJobResult result = null; try { result = executeGetImportJob(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 getKnowledgeBaseAsync(GetKnowledgeBaseRequest request) { return getKnowledgeBaseAsync(request, null); } @Override public java.util.concurrent.Future getKnowledgeBaseAsync(final GetKnowledgeBaseRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetKnowledgeBaseRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetKnowledgeBaseResult call() throws Exception { GetKnowledgeBaseResult result = null; try { result = executeGetKnowledgeBase(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 getQuickResponseAsync(GetQuickResponseRequest request) { return getQuickResponseAsync(request, null); } @Override public java.util.concurrent.Future getQuickResponseAsync(final GetQuickResponseRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetQuickResponseRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetQuickResponseResult call() throws Exception { GetQuickResponseResult result = null; try { result = executeGetQuickResponse(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 getRecommendationsAsync(GetRecommendationsRequest request) { return getRecommendationsAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future getRecommendationsAsync(final GetRecommendationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetRecommendationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetRecommendationsResult call() throws Exception { GetRecommendationsResult result = null; try { result = executeGetRecommendations(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 getSessionAsync(GetSessionRequest request) { return getSessionAsync(request, null); } @Override public java.util.concurrent.Future getSessionAsync(final GetSessionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetSessionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetSessionResult call() throws Exception { GetSessionResult result = null; try { result = executeGetSession(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 listAssistantAssociationsAsync(ListAssistantAssociationsRequest request) { return listAssistantAssociationsAsync(request, null); } @Override public java.util.concurrent.Future listAssistantAssociationsAsync(final ListAssistantAssociationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListAssistantAssociationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListAssistantAssociationsResult call() throws Exception { ListAssistantAssociationsResult result = null; try { result = executeListAssistantAssociations(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 listAssistantsAsync(ListAssistantsRequest request) { return listAssistantsAsync(request, null); } @Override public java.util.concurrent.Future listAssistantsAsync(final ListAssistantsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListAssistantsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListAssistantsResult call() throws Exception { ListAssistantsResult result = null; try { result = executeListAssistants(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 listContentAssociationsAsync(ListContentAssociationsRequest request) { return listContentAssociationsAsync(request, null); } @Override public java.util.concurrent.Future listContentAssociationsAsync(final ListContentAssociationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListContentAssociationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListContentAssociationsResult call() throws Exception { ListContentAssociationsResult result = null; try { result = executeListContentAssociations(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 listContentsAsync(ListContentsRequest request) { return listContentsAsync(request, null); } @Override public java.util.concurrent.Future listContentsAsync(final ListContentsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListContentsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListContentsResult call() throws Exception { ListContentsResult result = null; try { result = executeListContents(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 listImportJobsAsync(ListImportJobsRequest request) { return listImportJobsAsync(request, null); } @Override public java.util.concurrent.Future listImportJobsAsync(final ListImportJobsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListImportJobsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListImportJobsResult call() throws Exception { ListImportJobsResult result = null; try { result = executeListImportJobs(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 listKnowledgeBasesAsync(ListKnowledgeBasesRequest request) { return listKnowledgeBasesAsync(request, null); } @Override public java.util.concurrent.Future listKnowledgeBasesAsync(final ListKnowledgeBasesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListKnowledgeBasesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListKnowledgeBasesResult call() throws Exception { ListKnowledgeBasesResult result = null; try { result = executeListKnowledgeBases(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 listQuickResponsesAsync(ListQuickResponsesRequest request) { return listQuickResponsesAsync(request, null); } @Override public java.util.concurrent.Future listQuickResponsesAsync(final ListQuickResponsesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListQuickResponsesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListQuickResponsesResult call() throws Exception { ListQuickResponsesResult result = null; try { result = executeListQuickResponses(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 notifyRecommendationsReceivedAsync(NotifyRecommendationsReceivedRequest request) { return notifyRecommendationsReceivedAsync(request, null); } @Override public java.util.concurrent.Future notifyRecommendationsReceivedAsync( final NotifyRecommendationsReceivedRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final NotifyRecommendationsReceivedRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public NotifyRecommendationsReceivedResult call() throws Exception { NotifyRecommendationsReceivedResult result = null; try { result = executeNotifyRecommendationsReceived(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future putFeedbackAsync(PutFeedbackRequest request) { return putFeedbackAsync(request, null); } @Override public java.util.concurrent.Future putFeedbackAsync(final PutFeedbackRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final PutFeedbackRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public PutFeedbackResult call() throws Exception { PutFeedbackResult result = null; try { result = executePutFeedback(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override @Deprecated public java.util.concurrent.Future queryAssistantAsync(QueryAssistantRequest request) { return queryAssistantAsync(request, null); } @Override @Deprecated public java.util.concurrent.Future queryAssistantAsync(final QueryAssistantRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final QueryAssistantRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public QueryAssistantResult call() throws Exception { QueryAssistantResult result = null; try { result = executeQueryAssistant(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 removeKnowledgeBaseTemplateUriAsync(RemoveKnowledgeBaseTemplateUriRequest request) { return removeKnowledgeBaseTemplateUriAsync(request, null); } @Override public java.util.concurrent.Future removeKnowledgeBaseTemplateUriAsync( final RemoveKnowledgeBaseTemplateUriRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final RemoveKnowledgeBaseTemplateUriRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public RemoveKnowledgeBaseTemplateUriResult call() throws Exception { RemoveKnowledgeBaseTemplateUriResult result = null; try { result = executeRemoveKnowledgeBaseTemplateUri(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 searchContentAsync(SearchContentRequest request) { return searchContentAsync(request, null); } @Override public java.util.concurrent.Future searchContentAsync(final SearchContentRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final SearchContentRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public SearchContentResult call() throws Exception { SearchContentResult result = null; try { result = executeSearchContent(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 searchQuickResponsesAsync(SearchQuickResponsesRequest request) { return searchQuickResponsesAsync(request, null); } @Override public java.util.concurrent.Future searchQuickResponsesAsync(final SearchQuickResponsesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final SearchQuickResponsesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public SearchQuickResponsesResult call() throws Exception { SearchQuickResponsesResult result = null; try { result = executeSearchQuickResponses(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 searchSessionsAsync(SearchSessionsRequest request) { return searchSessionsAsync(request, null); } @Override public java.util.concurrent.Future searchSessionsAsync(final SearchSessionsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final SearchSessionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public SearchSessionsResult call() throws Exception { SearchSessionsResult result = null; try { result = executeSearchSessions(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 startContentUploadAsync(StartContentUploadRequest request) { return startContentUploadAsync(request, null); } @Override public java.util.concurrent.Future startContentUploadAsync(final StartContentUploadRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final StartContentUploadRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public StartContentUploadResult call() throws Exception { StartContentUploadResult result = null; try { result = executeStartContentUpload(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 startImportJobAsync(StartImportJobRequest request) { return startImportJobAsync(request, null); } @Override public java.util.concurrent.Future startImportJobAsync(final StartImportJobRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final StartImportJobRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public StartImportJobResult call() throws Exception { StartImportJobResult result = null; try { result = executeStartImportJob(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 updateContentAsync(UpdateContentRequest request) { return updateContentAsync(request, null); } @Override public java.util.concurrent.Future updateContentAsync(final UpdateContentRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateContentRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateContentResult call() throws Exception { UpdateContentResult result = null; try { result = executeUpdateContent(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 updateKnowledgeBaseTemplateUriAsync(UpdateKnowledgeBaseTemplateUriRequest request) { return updateKnowledgeBaseTemplateUriAsync(request, null); } @Override public java.util.concurrent.Future updateKnowledgeBaseTemplateUriAsync( final UpdateKnowledgeBaseTemplateUriRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateKnowledgeBaseTemplateUriRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateKnowledgeBaseTemplateUriResult call() throws Exception { UpdateKnowledgeBaseTemplateUriResult result = null; try { result = executeUpdateKnowledgeBaseTemplateUri(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 updateQuickResponseAsync(UpdateQuickResponseRequest request) { return updateQuickResponseAsync(request, null); } @Override public java.util.concurrent.Future updateQuickResponseAsync(final UpdateQuickResponseRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateQuickResponseRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateQuickResponseResult call() throws Exception { UpdateQuickResponseResult result = null; try { result = executeUpdateQuickResponse(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 updateSessionAsync(UpdateSessionRequest request) { return updateSessionAsync(request, null); } @Override public java.util.concurrent.Future updateSessionAsync(final UpdateSessionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateSessionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateSessionResult call() throws Exception { UpdateSessionResult result = null; try { result = executeUpdateSession(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