com.amazonaws.services.mediatailor.AWSMediaTailorAsyncClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-mediatailor Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.mediatailor;
import javax.annotation.Generated;
import com.amazonaws.services.mediatailor.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import java.util.concurrent.ExecutorService;
/**
* Client for accessing MediaTailor 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.
*
*
* Use the AWS Elemental MediaTailor SDKs and CLI to configure scalable ad insertion and linear channels. With
* MediaTailor, you can assemble existing content into a linear stream and serve targeted ads to viewers while
* maintaining broadcast quality in over-the-top (OTT) video applications. For information about using the service,
* including detailed information about the settings covered in this guide, see the AWS Elemental MediaTailor User Guide.
*
*
* Through the SDKs and the CLI you manage AWS Elemental MediaTailor configurations and channels the same as you do
* through the console. For example, you specify ad insertion behavior and mapping information for the origin server and
* the ad decision server (ADS).
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSMediaTailorAsyncClient extends AWSMediaTailorClient implements AWSMediaTailorAsync {
private static final int DEFAULT_THREAD_POOL_SIZE = 50;
private final java.util.concurrent.ExecutorService executorService;
public static AWSMediaTailorAsyncClientBuilder asyncBuilder() {
return AWSMediaTailorAsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on MediaTailor using the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AWSMediaTailorAsyncClient(AwsAsyncClientParams asyncClientParams) {
this(asyncClientParams, false);
}
/**
* Constructs a new asynchronous client to invoke service methods on MediaTailor using the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
* @param endpointDiscoveryEnabled
* true will enable endpoint discovery if the service supports it.
*/
AWSMediaTailorAsyncClient(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 configureLogsForChannelAsync(ConfigureLogsForChannelRequest request) {
return configureLogsForChannelAsync(request, null);
}
@Override
public java.util.concurrent.Future configureLogsForChannelAsync(final ConfigureLogsForChannelRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ConfigureLogsForChannelRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ConfigureLogsForChannelResult call() throws Exception {
ConfigureLogsForChannelResult result = null;
try {
result = executeConfigureLogsForChannel(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 configureLogsForPlaybackConfigurationAsync(
ConfigureLogsForPlaybackConfigurationRequest request) {
return configureLogsForPlaybackConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future configureLogsForPlaybackConfigurationAsync(
final ConfigureLogsForPlaybackConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ConfigureLogsForPlaybackConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ConfigureLogsForPlaybackConfigurationResult call() throws Exception {
ConfigureLogsForPlaybackConfigurationResult result = null;
try {
result = executeConfigureLogsForPlaybackConfiguration(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 createChannelAsync(CreateChannelRequest request) {
return createChannelAsync(request, null);
}
@Override
public java.util.concurrent.Future createChannelAsync(final CreateChannelRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateChannelRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateChannelResult call() throws Exception {
CreateChannelResult result = null;
try {
result = executeCreateChannel(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 createLiveSourceAsync(CreateLiveSourceRequest request) {
return createLiveSourceAsync(request, null);
}
@Override
public java.util.concurrent.Future createLiveSourceAsync(final CreateLiveSourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateLiveSourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateLiveSourceResult call() throws Exception {
CreateLiveSourceResult result = null;
try {
result = executeCreateLiveSource(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 createPrefetchScheduleAsync(CreatePrefetchScheduleRequest request) {
return createPrefetchScheduleAsync(request, null);
}
@Override
public java.util.concurrent.Future createPrefetchScheduleAsync(final CreatePrefetchScheduleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreatePrefetchScheduleRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreatePrefetchScheduleResult call() throws Exception {
CreatePrefetchScheduleResult result = null;
try {
result = executeCreatePrefetchSchedule(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 createProgramAsync(CreateProgramRequest request) {
return createProgramAsync(request, null);
}
@Override
public java.util.concurrent.Future createProgramAsync(final CreateProgramRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateProgramRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateProgramResult call() throws Exception {
CreateProgramResult result = null;
try {
result = executeCreateProgram(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 createSourceLocationAsync(CreateSourceLocationRequest request) {
return createSourceLocationAsync(request, null);
}
@Override
public java.util.concurrent.Future createSourceLocationAsync(final CreateSourceLocationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateSourceLocationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateSourceLocationResult call() throws Exception {
CreateSourceLocationResult result = null;
try {
result = executeCreateSourceLocation(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 createVodSourceAsync(CreateVodSourceRequest request) {
return createVodSourceAsync(request, null);
}
@Override
public java.util.concurrent.Future createVodSourceAsync(final CreateVodSourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateVodSourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateVodSourceResult call() throws Exception {
CreateVodSourceResult result = null;
try {
result = executeCreateVodSource(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 deleteChannelAsync(DeleteChannelRequest request) {
return deleteChannelAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteChannelAsync(final DeleteChannelRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteChannelRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteChannelResult call() throws Exception {
DeleteChannelResult result = null;
try {
result = executeDeleteChannel(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 deleteChannelPolicyAsync(DeleteChannelPolicyRequest request) {
return deleteChannelPolicyAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteChannelPolicyAsync(final DeleteChannelPolicyRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteChannelPolicyRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteChannelPolicyResult call() throws Exception {
DeleteChannelPolicyResult result = null;
try {
result = executeDeleteChannelPolicy(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 deleteLiveSourceAsync(DeleteLiveSourceRequest request) {
return deleteLiveSourceAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteLiveSourceAsync(final DeleteLiveSourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteLiveSourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteLiveSourceResult call() throws Exception {
DeleteLiveSourceResult result = null;
try {
result = executeDeleteLiveSource(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 deletePlaybackConfigurationAsync(DeletePlaybackConfigurationRequest request) {
return deletePlaybackConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future deletePlaybackConfigurationAsync(final DeletePlaybackConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeletePlaybackConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeletePlaybackConfigurationResult call() throws Exception {
DeletePlaybackConfigurationResult result = null;
try {
result = executeDeletePlaybackConfiguration(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 deletePrefetchScheduleAsync(DeletePrefetchScheduleRequest request) {
return deletePrefetchScheduleAsync(request, null);
}
@Override
public java.util.concurrent.Future deletePrefetchScheduleAsync(final DeletePrefetchScheduleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeletePrefetchScheduleRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeletePrefetchScheduleResult call() throws Exception {
DeletePrefetchScheduleResult result = null;
try {
result = executeDeletePrefetchSchedule(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 deleteProgramAsync(DeleteProgramRequest request) {
return deleteProgramAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteProgramAsync(final DeleteProgramRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteProgramRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteProgramResult call() throws Exception {
DeleteProgramResult result = null;
try {
result = executeDeleteProgram(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 deleteSourceLocationAsync(DeleteSourceLocationRequest request) {
return deleteSourceLocationAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteSourceLocationAsync(final DeleteSourceLocationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteSourceLocationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteSourceLocationResult call() throws Exception {
DeleteSourceLocationResult result = null;
try {
result = executeDeleteSourceLocation(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 deleteVodSourceAsync(DeleteVodSourceRequest request) {
return deleteVodSourceAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteVodSourceAsync(final DeleteVodSourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteVodSourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteVodSourceResult call() throws Exception {
DeleteVodSourceResult result = null;
try {
result = executeDeleteVodSource(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 describeChannelAsync(DescribeChannelRequest request) {
return describeChannelAsync(request, null);
}
@Override
public java.util.concurrent.Future describeChannelAsync(final DescribeChannelRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeChannelRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeChannelResult call() throws Exception {
DescribeChannelResult result = null;
try {
result = executeDescribeChannel(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 describeLiveSourceAsync(DescribeLiveSourceRequest request) {
return describeLiveSourceAsync(request, null);
}
@Override
public java.util.concurrent.Future describeLiveSourceAsync(final DescribeLiveSourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeLiveSourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeLiveSourceResult call() throws Exception {
DescribeLiveSourceResult result = null;
try {
result = executeDescribeLiveSource(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 describeProgramAsync(DescribeProgramRequest request) {
return describeProgramAsync(request, null);
}
@Override
public java.util.concurrent.Future describeProgramAsync(final DescribeProgramRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeProgramRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeProgramResult call() throws Exception {
DescribeProgramResult result = null;
try {
result = executeDescribeProgram(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 describeSourceLocationAsync(DescribeSourceLocationRequest request) {
return describeSourceLocationAsync(request, null);
}
@Override
public java.util.concurrent.Future describeSourceLocationAsync(final DescribeSourceLocationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeSourceLocationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeSourceLocationResult call() throws Exception {
DescribeSourceLocationResult result = null;
try {
result = executeDescribeSourceLocation(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 describeVodSourceAsync(DescribeVodSourceRequest request) {
return describeVodSourceAsync(request, null);
}
@Override
public java.util.concurrent.Future describeVodSourceAsync(final DescribeVodSourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeVodSourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeVodSourceResult call() throws Exception {
DescribeVodSourceResult result = null;
try {
result = executeDescribeVodSource(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 getChannelPolicyAsync(GetChannelPolicyRequest request) {
return getChannelPolicyAsync(request, null);
}
@Override
public java.util.concurrent.Future getChannelPolicyAsync(final GetChannelPolicyRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetChannelPolicyRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetChannelPolicyResult call() throws Exception {
GetChannelPolicyResult result = null;
try {
result = executeGetChannelPolicy(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 getChannelScheduleAsync(GetChannelScheduleRequest request) {
return getChannelScheduleAsync(request, null);
}
@Override
public java.util.concurrent.Future getChannelScheduleAsync(final GetChannelScheduleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetChannelScheduleRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetChannelScheduleResult call() throws Exception {
GetChannelScheduleResult result = null;
try {
result = executeGetChannelSchedule(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 getPlaybackConfigurationAsync(GetPlaybackConfigurationRequest request) {
return getPlaybackConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future getPlaybackConfigurationAsync(final GetPlaybackConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetPlaybackConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetPlaybackConfigurationResult call() throws Exception {
GetPlaybackConfigurationResult result = null;
try {
result = executeGetPlaybackConfiguration(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 getPrefetchScheduleAsync(GetPrefetchScheduleRequest request) {
return getPrefetchScheduleAsync(request, null);
}
@Override
public java.util.concurrent.Future getPrefetchScheduleAsync(final GetPrefetchScheduleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetPrefetchScheduleRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetPrefetchScheduleResult call() throws Exception {
GetPrefetchScheduleResult result = null;
try {
result = executeGetPrefetchSchedule(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 listAlertsAsync(ListAlertsRequest request) {
return listAlertsAsync(request, null);
}
@Override
public java.util.concurrent.Future listAlertsAsync(final ListAlertsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListAlertsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListAlertsResult call() throws Exception {
ListAlertsResult result = null;
try {
result = executeListAlerts(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 listChannelsAsync(ListChannelsRequest request) {
return listChannelsAsync(request, null);
}
@Override
public java.util.concurrent.Future listChannelsAsync(final ListChannelsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListChannelsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListChannelsResult call() throws Exception {
ListChannelsResult result = null;
try {
result = executeListChannels(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 listLiveSourcesAsync(ListLiveSourcesRequest request) {
return listLiveSourcesAsync(request, null);
}
@Override
public java.util.concurrent.Future listLiveSourcesAsync(final ListLiveSourcesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListLiveSourcesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListLiveSourcesResult call() throws Exception {
ListLiveSourcesResult result = null;
try {
result = executeListLiveSources(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 listPlaybackConfigurationsAsync(ListPlaybackConfigurationsRequest request) {
return listPlaybackConfigurationsAsync(request, null);
}
@Override
public java.util.concurrent.Future listPlaybackConfigurationsAsync(final ListPlaybackConfigurationsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListPlaybackConfigurationsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListPlaybackConfigurationsResult call() throws Exception {
ListPlaybackConfigurationsResult result = null;
try {
result = executeListPlaybackConfigurations(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 listPrefetchSchedulesAsync(ListPrefetchSchedulesRequest request) {
return listPrefetchSchedulesAsync(request, null);
}
@Override
public java.util.concurrent.Future listPrefetchSchedulesAsync(final ListPrefetchSchedulesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListPrefetchSchedulesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListPrefetchSchedulesResult call() throws Exception {
ListPrefetchSchedulesResult result = null;
try {
result = executeListPrefetchSchedules(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 listSourceLocationsAsync(ListSourceLocationsRequest request) {
return listSourceLocationsAsync(request, null);
}
@Override
public java.util.concurrent.Future listSourceLocationsAsync(final ListSourceLocationsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListSourceLocationsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListSourceLocationsResult call() throws Exception {
ListSourceLocationsResult result = null;
try {
result = executeListSourceLocations(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 listVodSourcesAsync(ListVodSourcesRequest request) {
return listVodSourcesAsync(request, null);
}
@Override
public java.util.concurrent.Future listVodSourcesAsync(final ListVodSourcesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListVodSourcesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListVodSourcesResult call() throws Exception {
ListVodSourcesResult result = null;
try {
result = executeListVodSources(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 putChannelPolicyAsync(PutChannelPolicyRequest request) {
return putChannelPolicyAsync(request, null);
}
@Override
public java.util.concurrent.Future putChannelPolicyAsync(final PutChannelPolicyRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final PutChannelPolicyRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public PutChannelPolicyResult call() throws Exception {
PutChannelPolicyResult result = null;
try {
result = executePutChannelPolicy(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 putPlaybackConfigurationAsync(PutPlaybackConfigurationRequest request) {
return putPlaybackConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future putPlaybackConfigurationAsync(final PutPlaybackConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final PutPlaybackConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public PutPlaybackConfigurationResult call() throws Exception {
PutPlaybackConfigurationResult result = null;
try {
result = executePutPlaybackConfiguration(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 startChannelAsync(StartChannelRequest request) {
return startChannelAsync(request, null);
}
@Override
public java.util.concurrent.Future startChannelAsync(final StartChannelRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartChannelRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartChannelResult call() throws Exception {
StartChannelResult result = null;
try {
result = executeStartChannel(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 stopChannelAsync(StopChannelRequest request) {
return stopChannelAsync(request, null);
}
@Override
public java.util.concurrent.Future stopChannelAsync(final StopChannelRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StopChannelRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StopChannelResult call() throws Exception {
StopChannelResult result = null;
try {
result = executeStopChannel(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 updateChannelAsync(UpdateChannelRequest request) {
return updateChannelAsync(request, null);
}
@Override
public java.util.concurrent.Future updateChannelAsync(final UpdateChannelRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateChannelRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateChannelResult call() throws Exception {
UpdateChannelResult result = null;
try {
result = executeUpdateChannel(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 updateLiveSourceAsync(UpdateLiveSourceRequest request) {
return updateLiveSourceAsync(request, null);
}
@Override
public java.util.concurrent.Future updateLiveSourceAsync(final UpdateLiveSourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateLiveSourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateLiveSourceResult call() throws Exception {
UpdateLiveSourceResult result = null;
try {
result = executeUpdateLiveSource(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 updateProgramAsync(UpdateProgramRequest request) {
return updateProgramAsync(request, null);
}
@Override
public java.util.concurrent.Future updateProgramAsync(final UpdateProgramRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateProgramRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateProgramResult call() throws Exception {
UpdateProgramResult result = null;
try {
result = executeUpdateProgram(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 updateSourceLocationAsync(UpdateSourceLocationRequest request) {
return updateSourceLocationAsync(request, null);
}
@Override
public java.util.concurrent.Future updateSourceLocationAsync(final UpdateSourceLocationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateSourceLocationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateSourceLocationResult call() throws Exception {
UpdateSourceLocationResult result = null;
try {
result = executeUpdateSourceLocation(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 updateVodSourceAsync(UpdateVodSourceRequest request) {
return updateVodSourceAsync(request, null);
}
@Override
public java.util.concurrent.Future updateVodSourceAsync(final UpdateVodSourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateVodSourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateVodSourceResult call() throws Exception {
UpdateVodSourceResult result = null;
try {
result = executeUpdateVodSource(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();
}
}