com.amazonaws.services.mediaconvert.AWSMediaConvertAsyncClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-mediaconvert 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.mediaconvert;
import javax.annotation.Generated;
import com.amazonaws.services.mediaconvert.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import java.util.concurrent.ExecutorService;
/**
* Client for accessing MediaConvert asynchronously. Each asynchronous method will return a Java Future object
* representing the asynchronous operation; overloads which accept an {@code AsyncHandler} can be used to receive
* notification when an asynchronous operation completes.
*
* AWS Elemental MediaConvert
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSMediaConvertAsyncClient extends AWSMediaConvertClient implements AWSMediaConvertAsync {
private static final int DEFAULT_THREAD_POOL_SIZE = 50;
private final java.util.concurrent.ExecutorService executorService;
public static AWSMediaConvertAsyncClientBuilder asyncBuilder() {
return AWSMediaConvertAsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on MediaConvert using the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AWSMediaConvertAsyncClient(AwsAsyncClientParams asyncClientParams) {
this(asyncClientParams, false);
}
/**
* Constructs a new asynchronous client to invoke service methods on MediaConvert using the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
* @param endpointDiscoveryEnabled
* true will enable endpoint discovery if the service supports it.
*/
AWSMediaConvertAsyncClient(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 associateCertificateAsync(AssociateCertificateRequest request) {
return associateCertificateAsync(request, null);
}
@Override
public java.util.concurrent.Future associateCertificateAsync(final AssociateCertificateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AssociateCertificateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AssociateCertificateResult call() throws Exception {
AssociateCertificateResult result = null;
try {
result = executeAssociateCertificate(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 cancelJobAsync(CancelJobRequest request) {
return cancelJobAsync(request, null);
}
@Override
public java.util.concurrent.Future cancelJobAsync(final CancelJobRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CancelJobRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CancelJobResult call() throws Exception {
CancelJobResult result = null;
try {
result = executeCancelJob(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 createJobAsync(CreateJobRequest request) {
return createJobAsync(request, null);
}
@Override
public java.util.concurrent.Future createJobAsync(final CreateJobRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateJobRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateJobResult call() throws Exception {
CreateJobResult result = null;
try {
result = executeCreateJob(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 createJobTemplateAsync(CreateJobTemplateRequest request) {
return createJobTemplateAsync(request, null);
}
@Override
public java.util.concurrent.Future createJobTemplateAsync(final CreateJobTemplateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateJobTemplateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateJobTemplateResult call() throws Exception {
CreateJobTemplateResult result = null;
try {
result = executeCreateJobTemplate(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 createPresetAsync(CreatePresetRequest request) {
return createPresetAsync(request, null);
}
@Override
public java.util.concurrent.Future createPresetAsync(final CreatePresetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreatePresetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreatePresetResult call() throws Exception {
CreatePresetResult result = null;
try {
result = executeCreatePreset(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 createQueueAsync(CreateQueueRequest request) {
return createQueueAsync(request, null);
}
@Override
public java.util.concurrent.Future createQueueAsync(final CreateQueueRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateQueueRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateQueueResult call() throws Exception {
CreateQueueResult result = null;
try {
result = executeCreateQueue(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 deleteJobTemplateAsync(DeleteJobTemplateRequest request) {
return deleteJobTemplateAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteJobTemplateAsync(final DeleteJobTemplateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteJobTemplateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteJobTemplateResult call() throws Exception {
DeleteJobTemplateResult result = null;
try {
result = executeDeleteJobTemplate(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 deletePolicyAsync(DeletePolicyRequest request) {
return deletePolicyAsync(request, null);
}
@Override
public java.util.concurrent.Future deletePolicyAsync(final DeletePolicyRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeletePolicyRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeletePolicyResult call() throws Exception {
DeletePolicyResult result = null;
try {
result = executeDeletePolicy(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 deletePresetAsync(DeletePresetRequest request) {
return deletePresetAsync(request, null);
}
@Override
public java.util.concurrent.Future deletePresetAsync(final DeletePresetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeletePresetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeletePresetResult call() throws Exception {
DeletePresetResult result = null;
try {
result = executeDeletePreset(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 deleteQueueAsync(DeleteQueueRequest request) {
return deleteQueueAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteQueueAsync(final DeleteQueueRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteQueueRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteQueueResult call() throws Exception {
DeleteQueueResult result = null;
try {
result = executeDeleteQueue(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 describeEndpointsAsync(DescribeEndpointsRequest request) {
return describeEndpointsAsync(request, null);
}
@Override
@Deprecated
public java.util.concurrent.Future describeEndpointsAsync(final DescribeEndpointsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeEndpointsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeEndpointsResult call() throws Exception {
DescribeEndpointsResult result = null;
try {
result = executeDescribeEndpoints(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 disassociateCertificateAsync(DisassociateCertificateRequest request) {
return disassociateCertificateAsync(request, null);
}
@Override
public java.util.concurrent.Future disassociateCertificateAsync(final DisassociateCertificateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DisassociateCertificateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DisassociateCertificateResult call() throws Exception {
DisassociateCertificateResult result = null;
try {
result = executeDisassociateCertificate(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 getJobAsync(GetJobRequest request) {
return getJobAsync(request, null);
}
@Override
public java.util.concurrent.Future getJobAsync(final GetJobRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetJobRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetJobResult call() throws Exception {
GetJobResult result = null;
try {
result = executeGetJob(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 getJobTemplateAsync(GetJobTemplateRequest request) {
return getJobTemplateAsync(request, null);
}
@Override
public java.util.concurrent.Future getJobTemplateAsync(final GetJobTemplateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetJobTemplateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetJobTemplateResult call() throws Exception {
GetJobTemplateResult result = null;
try {
result = executeGetJobTemplate(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future getPolicyAsync(GetPolicyRequest request) {
return getPolicyAsync(request, null);
}
@Override
public java.util.concurrent.Future getPolicyAsync(final GetPolicyRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetPolicyRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetPolicyResult call() throws Exception {
GetPolicyResult result = null;
try {
result = executeGetPolicy(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
@Override
public java.util.concurrent.Future getPresetAsync(GetPresetRequest request) {
return getPresetAsync(request, null);
}
@Override
public java.util.concurrent.Future getPresetAsync(final GetPresetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetPresetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetPresetResult call() throws Exception {
GetPresetResult result = null;
try {
result = executeGetPreset(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 getQueueAsync(GetQueueRequest request) {
return getQueueAsync(request, null);
}
@Override
public java.util.concurrent.Future getQueueAsync(final GetQueueRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetQueueRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetQueueResult call() throws Exception {
GetQueueResult result = null;
try {
result = executeGetQueue(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 listJobTemplatesAsync(ListJobTemplatesRequest request) {
return listJobTemplatesAsync(request, null);
}
@Override
public java.util.concurrent.Future listJobTemplatesAsync(final ListJobTemplatesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListJobTemplatesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListJobTemplatesResult call() throws Exception {
ListJobTemplatesResult result = null;
try {
result = executeListJobTemplates(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 listJobsAsync(ListJobsRequest request) {
return listJobsAsync(request, null);
}
@Override
public java.util.concurrent.Future listJobsAsync(final ListJobsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListJobsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListJobsResult call() throws Exception {
ListJobsResult result = null;
try {
result = executeListJobs(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 listPresetsAsync(ListPresetsRequest request) {
return listPresetsAsync(request, null);
}
@Override
public java.util.concurrent.Future listPresetsAsync(final ListPresetsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListPresetsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListPresetsResult call() throws Exception {
ListPresetsResult result = null;
try {
result = executeListPresets(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 listQueuesAsync(ListQueuesRequest request) {
return listQueuesAsync(request, null);
}
@Override
public java.util.concurrent.Future listQueuesAsync(final ListQueuesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListQueuesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListQueuesResult call() throws Exception {
ListQueuesResult result = null;
try {
result = executeListQueues(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 putPolicyAsync(PutPolicyRequest request) {
return putPolicyAsync(request, null);
}
@Override
public java.util.concurrent.Future putPolicyAsync(final PutPolicyRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final PutPolicyRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public PutPolicyResult call() throws Exception {
PutPolicyResult result = null;
try {
result = executePutPolicy(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 searchJobsAsync(SearchJobsRequest request) {
return searchJobsAsync(request, null);
}
@Override
public java.util.concurrent.Future searchJobsAsync(final SearchJobsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final SearchJobsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public SearchJobsResult call() throws Exception {
SearchJobsResult result = null;
try {
result = executeSearchJobs(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 updateJobTemplateAsync(UpdateJobTemplateRequest request) {
return updateJobTemplateAsync(request, null);
}
@Override
public java.util.concurrent.Future updateJobTemplateAsync(final UpdateJobTemplateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateJobTemplateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateJobTemplateResult call() throws Exception {
UpdateJobTemplateResult result = null;
try {
result = executeUpdateJobTemplate(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 updatePresetAsync(UpdatePresetRequest request) {
return updatePresetAsync(request, null);
}
@Override
public java.util.concurrent.Future updatePresetAsync(final UpdatePresetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdatePresetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdatePresetResult call() throws Exception {
UpdatePresetResult result = null;
try {
result = executeUpdatePreset(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 updateQueueAsync(UpdateQueueRequest request) {
return updateQueueAsync(request, null);
}
@Override
public java.util.concurrent.Future updateQueueAsync(final UpdateQueueRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateQueueRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateQueueResult call() throws Exception {
UpdateQueueResult result = null;
try {
result = executeUpdateQueue(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();
}
}