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

com.amazonaws.services.ivsrealtime.AmazonIVSRealTimeAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Interactive Video Service RealTime module holds the client classes that are used for communicating with Amazon Interactive Video Service RealTime Service

There is a newer version: 1.12.778
Show 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.ivsrealtime;

import javax.annotation.Generated;

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

import java.util.concurrent.ExecutorService;

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

*

* Introduction *

*

* The Amazon Interactive Video Service (IVS) real-time API is REST compatible, using a standard HTTP API and an AWS * EventBridge event stream for responses. JSON is used for both requests and responses, including errors. *

*

* Terminology: *

*
    *
  • *

    * A stage is a virtual space where participants can exchange video in real time. *

    *
  • *
  • *

    * A participant token is a token that authenticates a participant when they join a stage. *

    *
  • *
  • *

    * A participant object represents participants (people) in the stage and contains information about them. When a * token is created, it includes a participant ID; when a participant uses that token to join a stage, the participant * is associated with that participant ID. There is a 1:1 mapping between participant tokens and participants. *

    *
  • *
  • *

    * Server-side composition: The composition process composites participants of a stage into a single video and * forwards it to a set of outputs (e.g., IVS channels). Composition endpoints support this process. *

    *
  • *
  • *

    * Server-side composition: A composition controls the look of the outputs, including how participants are * positioned in the video. *

    *
  • *
*

* Resources *

*

* The following resources contain information about your IVS live stream (see Getting Started with Amazon IVS * Real-Time Streaming): *

*
    *
  • *

    * Stage — A stage is a virtual space where participants can exchange video in real time. *

    *
  • *
*

* Tagging *

*

* A tag is a metadata label that you assign to an AWS resource. A tag comprises a key and a value, * both set by you. For example, you might set a tag as topic:nature to label a particular video category. * See Tagging AWS Resources for more * information, including restrictions that apply to tags and "Tag naming limits and requirements"; Amazon IVS stages * has no service-specific constraints beyond what is documented there. *

*

* Tags can help you identify and organize your AWS resources. For example, you can use the same tag for different * resources to indicate that they are related. You can also use tags to manage access (see Access Tags). *

*

* The Amazon IVS real-time API has these tag-related endpoints: TagResource, UntagResource, and * ListTagsForResource. The following resource supports tagging: Stage. *

*

* At most 50 tags can be applied to a resource. *

*

* Stages Endpoints *

*
    *
  • *

    * CreateParticipantToken — Creates an additional token for a specified stage. This can be done after stage * creation or when tokens expire. *

    *
  • *
  • *

    * CreateStage — Creates a new stage (and optionally participant tokens). *

    *
  • *
  • *

    * DeleteStage — Shuts down and deletes the specified stage (disconnecting all participants). *

    *
  • *
  • *

    * DisconnectParticipant — Disconnects a specified participant and revokes the participant permanently from a * specified stage. *

    *
  • *
  • *

    * GetParticipant — Gets information about the specified participant token. *

    *
  • *
  • *

    * GetStage — Gets information for the specified stage. *

    *
  • *
  • *

    * GetStageSession — Gets information for the specified stage session. *

    *
  • *
  • *

    * ListParticipantEvents — Lists events for a specified participant that occurred during a specified stage * session. *

    *
  • *
  • *

    * ListParticipants — Lists all participants in a specified stage session. *

    *
  • *
  • *

    * ListStages — Gets summary information about all stages in your account, in the AWS region where the API * request is processed. *

    *
  • *
  • *

    * ListStageSessions — Gets all sessions for a specified stage. *

    *
  • *
  • *

    * UpdateStage — Updates a stage’s configuration. *

    *
  • *
*

* Composition Endpoints *

*
    *
  • *

    * GetComposition — Gets information about the specified Composition resource. *

    *
  • *
  • *

    * ListCompositions — Gets summary information about all Compositions in your account, in the AWS region where * the API request is processed. *

    *
  • *
  • *

    * StartComposition — Starts a Composition from a stage based on the configuration provided in the request. *

    *
  • *
  • *

    * StopComposition — Stops and deletes a Composition resource. Any broadcast from the Composition resource is * stopped. *

    *
  • *
*

* EncoderConfiguration Endpoints *

*
    *
  • *

    * CreateEncoderConfiguration — Creates an EncoderConfiguration object. *

    *
  • *
  • *

    * DeleteEncoderConfiguration — Deletes an EncoderConfiguration resource. Ensures that no Compositions are using * this template; otherwise, returns an error. *

    *
  • *
  • *

    * GetEncoderConfiguration — Gets information about the specified EncoderConfiguration resource. *

    *
  • *
  • *

    * ListEncoderConfigurations — Gets summary information about all EncoderConfigurations in your account, in the * AWS region where the API request is processed. *

    *
  • *
*

* StorageConfiguration Endpoints *

* *

* Tags Endpoints *

*
    *
  • *

    * ListTagsForResource — Gets information about AWS tags for the specified ARN. *

    *
  • *
  • *

    * TagResource — Adds or updates tags for the AWS resource with the specified ARN. *

    *
  • *
  • *

    * UntagResource — Removes tags from the resource with the specified ARN. *

    *
  • *
*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AmazonIVSRealTimeAsyncClient extends AmazonIVSRealTimeClient implements AmazonIVSRealTimeAsync { private static final int DEFAULT_THREAD_POOL_SIZE = 50; private final java.util.concurrent.ExecutorService executorService; public static AmazonIVSRealTimeAsyncClientBuilder asyncBuilder() { return AmazonIVSRealTimeAsyncClientBuilder.standard(); } /** * Constructs a new asynchronous client to invoke service methods on ivsrealtime using the specified parameters. * * @param asyncClientParams * Object providing client parameters. */ AmazonIVSRealTimeAsyncClient(AwsAsyncClientParams asyncClientParams) { this(asyncClientParams, false); } /** * Constructs a new asynchronous client to invoke service methods on ivsrealtime using the specified parameters. * * @param asyncClientParams * Object providing client parameters. * @param endpointDiscoveryEnabled * true will enable endpoint discovery if the service supports it. */ AmazonIVSRealTimeAsyncClient(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 createEncoderConfigurationAsync(CreateEncoderConfigurationRequest request) { return createEncoderConfigurationAsync(request, null); } @Override public java.util.concurrent.Future createEncoderConfigurationAsync(final CreateEncoderConfigurationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateEncoderConfigurationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateEncoderConfigurationResult call() throws Exception { CreateEncoderConfigurationResult result = null; try { result = executeCreateEncoderConfiguration(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 createParticipantTokenAsync(CreateParticipantTokenRequest request) { return createParticipantTokenAsync(request, null); } @Override public java.util.concurrent.Future createParticipantTokenAsync(final CreateParticipantTokenRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateParticipantTokenRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateParticipantTokenResult call() throws Exception { CreateParticipantTokenResult result = null; try { result = executeCreateParticipantToken(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 createStageAsync(CreateStageRequest request) { return createStageAsync(request, null); } @Override public java.util.concurrent.Future createStageAsync(final CreateStageRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateStageRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateStageResult call() throws Exception { CreateStageResult result = null; try { result = executeCreateStage(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 createStorageConfigurationAsync(CreateStorageConfigurationRequest request) { return createStorageConfigurationAsync(request, null); } @Override public java.util.concurrent.Future createStorageConfigurationAsync(final CreateStorageConfigurationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateStorageConfigurationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateStorageConfigurationResult call() throws Exception { CreateStorageConfigurationResult result = null; try { result = executeCreateStorageConfiguration(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 deleteEncoderConfigurationAsync(DeleteEncoderConfigurationRequest request) { return deleteEncoderConfigurationAsync(request, null); } @Override public java.util.concurrent.Future deleteEncoderConfigurationAsync(final DeleteEncoderConfigurationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteEncoderConfigurationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteEncoderConfigurationResult call() throws Exception { DeleteEncoderConfigurationResult result = null; try { result = executeDeleteEncoderConfiguration(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 deleteStageAsync(DeleteStageRequest request) { return deleteStageAsync(request, null); } @Override public java.util.concurrent.Future deleteStageAsync(final DeleteStageRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteStageRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteStageResult call() throws Exception { DeleteStageResult result = null; try { result = executeDeleteStage(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 deleteStorageConfigurationAsync(DeleteStorageConfigurationRequest request) { return deleteStorageConfigurationAsync(request, null); } @Override public java.util.concurrent.Future deleteStorageConfigurationAsync(final DeleteStorageConfigurationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteStorageConfigurationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteStorageConfigurationResult call() throws Exception { DeleteStorageConfigurationResult result = null; try { result = executeDeleteStorageConfiguration(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 disconnectParticipantAsync(DisconnectParticipantRequest request) { return disconnectParticipantAsync(request, null); } @Override public java.util.concurrent.Future disconnectParticipantAsync(final DisconnectParticipantRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DisconnectParticipantRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DisconnectParticipantResult call() throws Exception { DisconnectParticipantResult result = null; try { result = executeDisconnectParticipant(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 getCompositionAsync(GetCompositionRequest request) { return getCompositionAsync(request, null); } @Override public java.util.concurrent.Future getCompositionAsync(final GetCompositionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetCompositionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetCompositionResult call() throws Exception { GetCompositionResult result = null; try { result = executeGetComposition(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 getEncoderConfigurationAsync(GetEncoderConfigurationRequest request) { return getEncoderConfigurationAsync(request, null); } @Override public java.util.concurrent.Future getEncoderConfigurationAsync(final GetEncoderConfigurationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetEncoderConfigurationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetEncoderConfigurationResult call() throws Exception { GetEncoderConfigurationResult result = null; try { result = executeGetEncoderConfiguration(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 getParticipantAsync(GetParticipantRequest request) { return getParticipantAsync(request, null); } @Override public java.util.concurrent.Future getParticipantAsync(final GetParticipantRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetParticipantRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetParticipantResult call() throws Exception { GetParticipantResult result = null; try { result = executeGetParticipant(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 getStageAsync(GetStageRequest request) { return getStageAsync(request, null); } @Override public java.util.concurrent.Future getStageAsync(final GetStageRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetStageRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetStageResult call() throws Exception { GetStageResult result = null; try { result = executeGetStage(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 getStageSessionAsync(GetStageSessionRequest request) { return getStageSessionAsync(request, null); } @Override public java.util.concurrent.Future getStageSessionAsync(final GetStageSessionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetStageSessionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetStageSessionResult call() throws Exception { GetStageSessionResult result = null; try { result = executeGetStageSession(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 getStorageConfigurationAsync(GetStorageConfigurationRequest request) { return getStorageConfigurationAsync(request, null); } @Override public java.util.concurrent.Future getStorageConfigurationAsync(final GetStorageConfigurationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetStorageConfigurationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetStorageConfigurationResult call() throws Exception { GetStorageConfigurationResult result = null; try { result = executeGetStorageConfiguration(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 listCompositionsAsync(ListCompositionsRequest request) { return listCompositionsAsync(request, null); } @Override public java.util.concurrent.Future listCompositionsAsync(final ListCompositionsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListCompositionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListCompositionsResult call() throws Exception { ListCompositionsResult result = null; try { result = executeListCompositions(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 listEncoderConfigurationsAsync(ListEncoderConfigurationsRequest request) { return listEncoderConfigurationsAsync(request, null); } @Override public java.util.concurrent.Future listEncoderConfigurationsAsync(final ListEncoderConfigurationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListEncoderConfigurationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListEncoderConfigurationsResult call() throws Exception { ListEncoderConfigurationsResult result = null; try { result = executeListEncoderConfigurations(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 listParticipantEventsAsync(ListParticipantEventsRequest request) { return listParticipantEventsAsync(request, null); } @Override public java.util.concurrent.Future listParticipantEventsAsync(final ListParticipantEventsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListParticipantEventsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListParticipantEventsResult call() throws Exception { ListParticipantEventsResult result = null; try { result = executeListParticipantEvents(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 listParticipantsAsync(ListParticipantsRequest request) { return listParticipantsAsync(request, null); } @Override public java.util.concurrent.Future listParticipantsAsync(final ListParticipantsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListParticipantsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListParticipantsResult call() throws Exception { ListParticipantsResult result = null; try { result = executeListParticipants(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 listStageSessionsAsync(ListStageSessionsRequest request) { return listStageSessionsAsync(request, null); } @Override public java.util.concurrent.Future listStageSessionsAsync(final ListStageSessionsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListStageSessionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListStageSessionsResult call() throws Exception { ListStageSessionsResult result = null; try { result = executeListStageSessions(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 listStagesAsync(ListStagesRequest request) { return listStagesAsync(request, null); } @Override public java.util.concurrent.Future listStagesAsync(final ListStagesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListStagesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListStagesResult call() throws Exception { ListStagesResult result = null; try { result = executeListStages(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 listStorageConfigurationsAsync(ListStorageConfigurationsRequest request) { return listStorageConfigurationsAsync(request, null); } @Override public java.util.concurrent.Future listStorageConfigurationsAsync(final ListStorageConfigurationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListStorageConfigurationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListStorageConfigurationsResult call() throws Exception { ListStorageConfigurationsResult result = null; try { result = executeListStorageConfigurations(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 startCompositionAsync(StartCompositionRequest request) { return startCompositionAsync(request, null); } @Override public java.util.concurrent.Future startCompositionAsync(final StartCompositionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final StartCompositionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public StartCompositionResult call() throws Exception { StartCompositionResult result = null; try { result = executeStartComposition(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 stopCompositionAsync(StopCompositionRequest request) { return stopCompositionAsync(request, null); } @Override public java.util.concurrent.Future stopCompositionAsync(final StopCompositionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final StopCompositionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public StopCompositionResult call() throws Exception { StopCompositionResult result = null; try { result = executeStopComposition(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 updateStageAsync(UpdateStageRequest request) { return updateStageAsync(request, null); } @Override public java.util.concurrent.Future updateStageAsync(final UpdateStageRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateStageRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateStageResult call() throws Exception { UpdateStageResult result = null; try { result = executeUpdateStage(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