com.amazonaws.services.appstream.AmazonAppStreamAsyncClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-appstream Show documentation
/*
* Copyright 2013-2018 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.appstream;
import static java.util.concurrent.Executors.newFixedThreadPool;
import javax.annotation.Generated;
import com.amazonaws.services.appstream.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSCredentialsProvider;
import java.util.concurrent.ExecutorService;
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
/**
* Client for accessing Amazon AppStream asynchronously. Each asynchronous method will return a Java Future object
* representing the asynchronous operation; overloads which accept an {@code AsyncHandler} can be used to receive
* notification when an asynchronous operation completes.
*
* Amazon AppStream 2.0
*
* You can use Amazon AppStream 2.0 to stream desktop applications to any device running a web browser, without
* rewriting them.
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AmazonAppStreamAsyncClient extends AmazonAppStreamClient implements AmazonAppStreamAsync {
private static final int DEFAULT_THREAD_POOL_SIZE = 50;
private final java.util.concurrent.ExecutorService executorService;
/**
* Constructs a new asynchronous client to invoke service methods on Amazon AppStream. A credentials provider chain
* will be used that searches for credentials in this order:
*
* - Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
* - Java System Properties - aws.accessKeyId and aws.secretKey
* - Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
* - Instance profile credentials delivered through the Amazon EC2 metadata service
*
*
* Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default
* maximum number of concurrent connections to the service).
*
* @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
* @deprecated use {@link AmazonAppStreamAsyncClientBuilder#defaultClient()}
*/
@Deprecated
public AmazonAppStreamAsyncClient() {
this(DefaultAWSCredentialsProviderChain.getInstance());
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon AppStream. A credentials provider chain
* will be used that searches for credentials in this order:
*
* - Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
* - Java System Properties - aws.accessKeyId and aws.secretKey
* - Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
* - Instance profile credentials delivered through the Amazon EC2 metadata service
*
*
* Asynchronous methods are delegated to a fixed-size thread pool containing a number of threads equal to the
* maximum number of concurrent connections configured via {@code ClientConfiguration.getMaxConnections()}.
*
* @param clientConfiguration
* The client configuration options controlling how this client connects to Amazon AppStream (ex: proxy
* settings, retry counts, etc).
*
* @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
* @deprecated use {@link AmazonAppStreamAsyncClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AmazonAppStreamAsyncClient(ClientConfiguration clientConfiguration) {
this(DefaultAWSCredentialsProviderChain.getInstance(), clientConfiguration, newFixedThreadPool(clientConfiguration.getMaxConnections()));
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon AppStream using the specified AWS
* account credentials.
*
* Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default
* maximum number of concurrent connections to the service).
*
* @param awsCredentials
* The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
* @deprecated use {@link AmazonAppStreamAsyncClientBuilder#withCredentials(AWSCredentialsProvider)}
*/
@Deprecated
public AmazonAppStreamAsyncClient(AWSCredentials awsCredentials) {
this(awsCredentials, newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE));
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon AppStream using the specified AWS
* account credentials and executor service. Default client settings will be used.
*
* @param awsCredentials
* The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
* @param executorService
* The executor service by which all asynchronous requests will be executed.
* @deprecated use {@link AmazonAppStreamAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonAppStreamAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AmazonAppStreamAsyncClient(AWSCredentials awsCredentials, ExecutorService executorService) {
this(awsCredentials, configFactory.getConfig(), executorService);
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon AppStream using the specified AWS
* account credentials, executor service, and client configuration options.
*
* @param awsCredentials
* The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
* @param clientConfiguration
* Client configuration options (ex: max retry limit, proxy settings, etc).
* @param executorService
* The executor service by which all asynchronous requests will be executed.
* @deprecated use {@link AmazonAppStreamAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonAppStreamAsyncClientBuilder#withClientConfiguration(ClientConfiguration)} and
* {@link AmazonAppStreamAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AmazonAppStreamAsyncClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration, ExecutorService executorService) {
super(awsCredentials, clientConfiguration);
this.executorService = executorService;
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon AppStream using the specified AWS
* account credentials provider. Default client settings will be used.
*
* Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default
* maximum number of concurrent connections to the service).
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
* @deprecated use {@link AmazonAppStreamAsyncClientBuilder#withCredentials(AWSCredentialsProvider)}
*/
@Deprecated
public AmazonAppStreamAsyncClient(AWSCredentialsProvider awsCredentialsProvider) {
this(awsCredentialsProvider, newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE));
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon AppStream using the provided AWS account
* credentials provider and client configuration options.
*
* Asynchronous methods are delegated to a fixed-size thread pool containing a number of threads equal to the
* maximum number of concurrent connections configured via {@code ClientConfiguration.getMaxConnections()}.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
* @param clientConfiguration
* Client configuration options (ex: max retry limit, proxy settings, etc).
*
* @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
* @deprecated use {@link AmazonAppStreamAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonAppStreamAsyncClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AmazonAppStreamAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) {
this(awsCredentialsProvider, clientConfiguration, newFixedThreadPool(clientConfiguration.getMaxConnections()));
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon AppStream using the specified AWS
* account credentials provider and executor service. Default client settings will be used.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
* @param executorService
* The executor service by which all asynchronous requests will be executed.
* @deprecated use {@link AmazonAppStreamAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonAppStreamAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AmazonAppStreamAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ExecutorService executorService) {
this(awsCredentialsProvider, configFactory.getConfig(), executorService);
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon AppStream using the specified AWS
* account credentials provider, executor service, and client configuration options.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
* @param clientConfiguration
* Client configuration options (ex: max retry limit, proxy settings, etc).
* @param executorService
* The executor service by which all asynchronous requests will be executed.
* @deprecated use {@link AmazonAppStreamAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonAppStreamAsyncClientBuilder#withClientConfiguration(ClientConfiguration)} and
* {@link AmazonAppStreamAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AmazonAppStreamAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, ExecutorService executorService) {
super(awsCredentialsProvider, clientConfiguration);
this.executorService = executorService;
}
public static AmazonAppStreamAsyncClientBuilder asyncBuilder() {
return AmazonAppStreamAsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon AppStream using the specified
* parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AmazonAppStreamAsyncClient(AwsAsyncClientParams asyncClientParams) {
super(asyncClientParams);
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 associateFleetAsync(AssociateFleetRequest request) {
return associateFleetAsync(request, null);
}
@Override
public java.util.concurrent.Future associateFleetAsync(final AssociateFleetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AssociateFleetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AssociateFleetResult call() throws Exception {
AssociateFleetResult result = null;
try {
result = executeAssociateFleet(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 copyImageAsync(CopyImageRequest request) {
return copyImageAsync(request, null);
}
@Override
public java.util.concurrent.Future copyImageAsync(final CopyImageRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CopyImageRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CopyImageResult call() throws Exception {
CopyImageResult result = null;
try {
result = executeCopyImage(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 createDirectoryConfigAsync(CreateDirectoryConfigRequest request) {
return createDirectoryConfigAsync(request, null);
}
@Override
public java.util.concurrent.Future createDirectoryConfigAsync(final CreateDirectoryConfigRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateDirectoryConfigRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateDirectoryConfigResult call() throws Exception {
CreateDirectoryConfigResult result = null;
try {
result = executeCreateDirectoryConfig(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 createFleetAsync(CreateFleetRequest request) {
return createFleetAsync(request, null);
}
@Override
public java.util.concurrent.Future createFleetAsync(final CreateFleetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateFleetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateFleetResult call() throws Exception {
CreateFleetResult result = null;
try {
result = executeCreateFleet(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 createImageBuilderAsync(CreateImageBuilderRequest request) {
return createImageBuilderAsync(request, null);
}
@Override
public java.util.concurrent.Future createImageBuilderAsync(final CreateImageBuilderRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateImageBuilderRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateImageBuilderResult call() throws Exception {
CreateImageBuilderResult result = null;
try {
result = executeCreateImageBuilder(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 createImageBuilderStreamingURLAsync(CreateImageBuilderStreamingURLRequest request) {
return createImageBuilderStreamingURLAsync(request, null);
}
@Override
public java.util.concurrent.Future createImageBuilderStreamingURLAsync(
final CreateImageBuilderStreamingURLRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateImageBuilderStreamingURLRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateImageBuilderStreamingURLResult call() throws Exception {
CreateImageBuilderStreamingURLResult result = null;
try {
result = executeCreateImageBuilderStreamingURL(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 createStackAsync(CreateStackRequest request) {
return createStackAsync(request, null);
}
@Override
public java.util.concurrent.Future createStackAsync(final CreateStackRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateStackRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateStackResult call() throws Exception {
CreateStackResult result = null;
try {
result = executeCreateStack(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 createStreamingURLAsync(CreateStreamingURLRequest request) {
return createStreamingURLAsync(request, null);
}
@Override
public java.util.concurrent.Future createStreamingURLAsync(final CreateStreamingURLRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateStreamingURLRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateStreamingURLResult call() throws Exception {
CreateStreamingURLResult result = null;
try {
result = executeCreateStreamingURL(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 deleteDirectoryConfigAsync(DeleteDirectoryConfigRequest request) {
return deleteDirectoryConfigAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteDirectoryConfigAsync(final DeleteDirectoryConfigRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteDirectoryConfigRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteDirectoryConfigResult call() throws Exception {
DeleteDirectoryConfigResult result = null;
try {
result = executeDeleteDirectoryConfig(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 deleteFleetAsync(DeleteFleetRequest request) {
return deleteFleetAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteFleetAsync(final DeleteFleetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteFleetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteFleetResult call() throws Exception {
DeleteFleetResult result = null;
try {
result = executeDeleteFleet(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 deleteImageAsync(DeleteImageRequest request) {
return deleteImageAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteImageAsync(final DeleteImageRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteImageRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteImageResult call() throws Exception {
DeleteImageResult result = null;
try {
result = executeDeleteImage(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 deleteImageBuilderAsync(DeleteImageBuilderRequest request) {
return deleteImageBuilderAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteImageBuilderAsync(final DeleteImageBuilderRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteImageBuilderRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteImageBuilderResult call() throws Exception {
DeleteImageBuilderResult result = null;
try {
result = executeDeleteImageBuilder(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 deleteStackAsync(DeleteStackRequest request) {
return deleteStackAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteStackAsync(final DeleteStackRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteStackRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteStackResult call() throws Exception {
DeleteStackResult result = null;
try {
result = executeDeleteStack(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 describeDirectoryConfigsAsync(DescribeDirectoryConfigsRequest request) {
return describeDirectoryConfigsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeDirectoryConfigsAsync(final DescribeDirectoryConfigsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeDirectoryConfigsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeDirectoryConfigsResult call() throws Exception {
DescribeDirectoryConfigsResult result = null;
try {
result = executeDescribeDirectoryConfigs(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 describeFleetsAsync(DescribeFleetsRequest request) {
return describeFleetsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeFleetsAsync(final DescribeFleetsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeFleetsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeFleetsResult call() throws Exception {
DescribeFleetsResult result = null;
try {
result = executeDescribeFleets(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 describeImageBuildersAsync(DescribeImageBuildersRequest request) {
return describeImageBuildersAsync(request, null);
}
@Override
public java.util.concurrent.Future describeImageBuildersAsync(final DescribeImageBuildersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeImageBuildersRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeImageBuildersResult call() throws Exception {
DescribeImageBuildersResult result = null;
try {
result = executeDescribeImageBuilders(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 describeImagesAsync(DescribeImagesRequest request) {
return describeImagesAsync(request, null);
}
@Override
public java.util.concurrent.Future describeImagesAsync(final DescribeImagesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeImagesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeImagesResult call() throws Exception {
DescribeImagesResult result = null;
try {
result = executeDescribeImages(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 describeSessionsAsync(DescribeSessionsRequest request) {
return describeSessionsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeSessionsAsync(final DescribeSessionsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeSessionsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeSessionsResult call() throws Exception {
DescribeSessionsResult result = null;
try {
result = executeDescribeSessions(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 describeStacksAsync(DescribeStacksRequest request) {
return describeStacksAsync(request, null);
}
@Override
public java.util.concurrent.Future describeStacksAsync(final DescribeStacksRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeStacksRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeStacksResult call() throws Exception {
DescribeStacksResult result = null;
try {
result = executeDescribeStacks(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 disassociateFleetAsync(DisassociateFleetRequest request) {
return disassociateFleetAsync(request, null);
}
@Override
public java.util.concurrent.Future disassociateFleetAsync(final DisassociateFleetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DisassociateFleetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DisassociateFleetResult call() throws Exception {
DisassociateFleetResult result = null;
try {
result = executeDisassociateFleet(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 expireSessionAsync(ExpireSessionRequest request) {
return expireSessionAsync(request, null);
}
@Override
public java.util.concurrent.Future expireSessionAsync(final ExpireSessionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ExpireSessionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ExpireSessionResult call() throws Exception {
ExpireSessionResult result = null;
try {
result = executeExpireSession(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 listAssociatedFleetsAsync(ListAssociatedFleetsRequest request) {
return listAssociatedFleetsAsync(request, null);
}
@Override
public java.util.concurrent.Future listAssociatedFleetsAsync(final ListAssociatedFleetsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListAssociatedFleetsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListAssociatedFleetsResult call() throws Exception {
ListAssociatedFleetsResult result = null;
try {
result = executeListAssociatedFleets(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 listAssociatedStacksAsync(ListAssociatedStacksRequest request) {
return listAssociatedStacksAsync(request, null);
}
@Override
public java.util.concurrent.Future listAssociatedStacksAsync(final ListAssociatedStacksRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListAssociatedStacksRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListAssociatedStacksResult call() throws Exception {
ListAssociatedStacksResult result = null;
try {
result = executeListAssociatedStacks(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 startFleetAsync(StartFleetRequest request) {
return startFleetAsync(request, null);
}
@Override
public java.util.concurrent.Future startFleetAsync(final StartFleetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartFleetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartFleetResult call() throws Exception {
StartFleetResult result = null;
try {
result = executeStartFleet(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 startImageBuilderAsync(StartImageBuilderRequest request) {
return startImageBuilderAsync(request, null);
}
@Override
public java.util.concurrent.Future startImageBuilderAsync(final StartImageBuilderRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StartImageBuilderRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StartImageBuilderResult call() throws Exception {
StartImageBuilderResult result = null;
try {
result = executeStartImageBuilder(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 stopFleetAsync(StopFleetRequest request) {
return stopFleetAsync(request, null);
}
@Override
public java.util.concurrent.Future stopFleetAsync(final StopFleetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StopFleetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StopFleetResult call() throws Exception {
StopFleetResult result = null;
try {
result = executeStopFleet(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 stopImageBuilderAsync(StopImageBuilderRequest request) {
return stopImageBuilderAsync(request, null);
}
@Override
public java.util.concurrent.Future stopImageBuilderAsync(final StopImageBuilderRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final StopImageBuilderRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public StopImageBuilderResult call() throws Exception {
StopImageBuilderResult result = null;
try {
result = executeStopImageBuilder(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 updateDirectoryConfigAsync(UpdateDirectoryConfigRequest request) {
return updateDirectoryConfigAsync(request, null);
}
@Override
public java.util.concurrent.Future updateDirectoryConfigAsync(final UpdateDirectoryConfigRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateDirectoryConfigRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateDirectoryConfigResult call() throws Exception {
UpdateDirectoryConfigResult result = null;
try {
result = executeUpdateDirectoryConfig(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 updateFleetAsync(UpdateFleetRequest request) {
return updateFleetAsync(request, null);
}
@Override
public java.util.concurrent.Future updateFleetAsync(final UpdateFleetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateFleetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateFleetResult call() throws Exception {
UpdateFleetResult result = null;
try {
result = executeUpdateFleet(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 updateStackAsync(UpdateStackRequest request) {
return updateStackAsync(request, null);
}
@Override
public java.util.concurrent.Future updateStackAsync(final UpdateStackRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateStackRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateStackResult call() throws Exception {
UpdateStackResult result = null;
try {
result = executeUpdateStack(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();
}
}