com.amazonaws.services.ec2.AmazonEC2AsyncClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ec2 Show documentation
/*
* Copyright 2014-2019 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.ec2;
import static java.util.concurrent.Executors.newFixedThreadPool;
import javax.annotation.Generated;
import com.amazonaws.services.ec2.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 EC2 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 Elastic Compute Cloud
*
* Amazon Elastic Compute Cloud (Amazon EC2) provides secure and resizable computing capacity in the AWS cloud. Using
* Amazon EC2 eliminates the need to invest in hardware up front, so you can develop and deploy applications faster.
*
*
* To learn more, see the following resources:
*
*
* -
*
* Amazon EC2: AmazonEC2 product page, Amazon EC2 documentation
*
*
* -
*
* Amazon EBS: Amazon EBS product page, Amazon EBS documentation
*
*
* -
*
* Amazon VPC: Amazon VPC product page, Amazon VPC documentation
*
*
* -
*
* AWS VPN: AWS VPN product page, AWS VPN documentation
*
*
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AmazonEC2AsyncClient extends AmazonEC2Client implements AmazonEC2Async {
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 EC2. 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 AmazonEC2AsyncClientBuilder#defaultClient()}
*/
@Deprecated
public AmazonEC2AsyncClient() {
this(DefaultAWSCredentialsProviderChain.getInstance());
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon EC2. 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 EC2 (ex: proxy settings,
* retry counts, etc).
*
* @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
* @deprecated use {@link AmazonEC2AsyncClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AmazonEC2AsyncClient(ClientConfiguration clientConfiguration) {
this(DefaultAWSCredentialsProviderChain.getInstance(), clientConfiguration, newFixedThreadPool(clientConfiguration.getMaxConnections()));
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon EC2 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 AmazonEC2AsyncClientBuilder#withCredentials(AWSCredentialsProvider)}
*/
@Deprecated
public AmazonEC2AsyncClient(AWSCredentials awsCredentials) {
this(awsCredentials, newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE));
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon EC2 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 AmazonEC2AsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonEC2AsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AmazonEC2AsyncClient(AWSCredentials awsCredentials, ExecutorService executorService) {
this(awsCredentials, configFactory.getConfig(), executorService);
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon EC2 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 AmazonEC2AsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonEC2AsyncClientBuilder#withClientConfiguration(ClientConfiguration)} and
* {@link AmazonEC2AsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AmazonEC2AsyncClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration, ExecutorService executorService) {
super(awsCredentials, clientConfiguration);
this.executorService = executorService;
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon EC2 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 AmazonEC2AsyncClientBuilder#withCredentials(AWSCredentialsProvider)}
*/
@Deprecated
public AmazonEC2AsyncClient(AWSCredentialsProvider awsCredentialsProvider) {
this(awsCredentialsProvider, newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE));
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon EC2 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 AmazonEC2AsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonEC2AsyncClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AmazonEC2AsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) {
this(awsCredentialsProvider, clientConfiguration, newFixedThreadPool(clientConfiguration.getMaxConnections()));
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon EC2 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 AmazonEC2AsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonEC2AsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AmazonEC2AsyncClient(AWSCredentialsProvider awsCredentialsProvider, ExecutorService executorService) {
this(awsCredentialsProvider, configFactory.getConfig(), executorService);
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon EC2 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 AmazonEC2AsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonEC2AsyncClientBuilder#withClientConfiguration(ClientConfiguration)} and
* {@link AmazonEC2AsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AmazonEC2AsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, ExecutorService executorService) {
super(awsCredentialsProvider, clientConfiguration);
this.executorService = executorService;
}
public static AmazonEC2AsyncClientBuilder asyncBuilder() {
return AmazonEC2AsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon EC2 using the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AmazonEC2AsyncClient(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 acceptReservedInstancesExchangeQuoteAsync(
AcceptReservedInstancesExchangeQuoteRequest request) {
return acceptReservedInstancesExchangeQuoteAsync(request, null);
}
@Override
public java.util.concurrent.Future acceptReservedInstancesExchangeQuoteAsync(
final AcceptReservedInstancesExchangeQuoteRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AcceptReservedInstancesExchangeQuoteRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AcceptReservedInstancesExchangeQuoteResult call() throws Exception {
AcceptReservedInstancesExchangeQuoteResult result = null;
try {
result = executeAcceptReservedInstancesExchangeQuote(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 acceptTransitGatewayVpcAttachmentAsync(
AcceptTransitGatewayVpcAttachmentRequest request) {
return acceptTransitGatewayVpcAttachmentAsync(request, null);
}
@Override
public java.util.concurrent.Future acceptTransitGatewayVpcAttachmentAsync(
final AcceptTransitGatewayVpcAttachmentRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AcceptTransitGatewayVpcAttachmentRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AcceptTransitGatewayVpcAttachmentResult call() throws Exception {
AcceptTransitGatewayVpcAttachmentResult result = null;
try {
result = executeAcceptTransitGatewayVpcAttachment(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 acceptVpcEndpointConnectionsAsync(AcceptVpcEndpointConnectionsRequest request) {
return acceptVpcEndpointConnectionsAsync(request, null);
}
@Override
public java.util.concurrent.Future acceptVpcEndpointConnectionsAsync(final AcceptVpcEndpointConnectionsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AcceptVpcEndpointConnectionsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AcceptVpcEndpointConnectionsResult call() throws Exception {
AcceptVpcEndpointConnectionsResult result = null;
try {
result = executeAcceptVpcEndpointConnections(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 acceptVpcPeeringConnectionAsync(AcceptVpcPeeringConnectionRequest request) {
return acceptVpcPeeringConnectionAsync(request, null);
}
@Override
public java.util.concurrent.Future acceptVpcPeeringConnectionAsync(final AcceptVpcPeeringConnectionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AcceptVpcPeeringConnectionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AcceptVpcPeeringConnectionResult call() throws Exception {
AcceptVpcPeeringConnectionResult result = null;
try {
result = executeAcceptVpcPeeringConnection(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the AcceptVpcPeeringConnection operation.
*
* @see #acceptVpcPeeringConnectionAsync(AcceptVpcPeeringConnectionRequest)
*/
@Override
public java.util.concurrent.Future acceptVpcPeeringConnectionAsync() {
return acceptVpcPeeringConnectionAsync(new AcceptVpcPeeringConnectionRequest());
}
/**
* Simplified method form for invoking the AcceptVpcPeeringConnection operation with an AsyncHandler.
*
* @see #acceptVpcPeeringConnectionAsync(AcceptVpcPeeringConnectionRequest, com.amazonaws.handlers.AsyncHandler)
*/
@Override
public java.util.concurrent.Future acceptVpcPeeringConnectionAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return acceptVpcPeeringConnectionAsync(new AcceptVpcPeeringConnectionRequest(), asyncHandler);
}
@Override
public java.util.concurrent.Future advertiseByoipCidrAsync(AdvertiseByoipCidrRequest request) {
return advertiseByoipCidrAsync(request, null);
}
@Override
public java.util.concurrent.Future advertiseByoipCidrAsync(final AdvertiseByoipCidrRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AdvertiseByoipCidrRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AdvertiseByoipCidrResult call() throws Exception {
AdvertiseByoipCidrResult result = null;
try {
result = executeAdvertiseByoipCidr(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 allocateAddressAsync(AllocateAddressRequest request) {
return allocateAddressAsync(request, null);
}
@Override
public java.util.concurrent.Future allocateAddressAsync(final AllocateAddressRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AllocateAddressRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AllocateAddressResult call() throws Exception {
AllocateAddressResult result = null;
try {
result = executeAllocateAddress(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the AllocateAddress operation.
*
* @see #allocateAddressAsync(AllocateAddressRequest)
*/
@Override
public java.util.concurrent.Future allocateAddressAsync() {
return allocateAddressAsync(new AllocateAddressRequest());
}
/**
* Simplified method form for invoking the AllocateAddress operation with an AsyncHandler.
*
* @see #allocateAddressAsync(AllocateAddressRequest, com.amazonaws.handlers.AsyncHandler)
*/
@Override
public java.util.concurrent.Future allocateAddressAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return allocateAddressAsync(new AllocateAddressRequest(), asyncHandler);
}
@Override
public java.util.concurrent.Future allocateHostsAsync(AllocateHostsRequest request) {
return allocateHostsAsync(request, null);
}
@Override
public java.util.concurrent.Future allocateHostsAsync(final AllocateHostsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AllocateHostsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AllocateHostsResult call() throws Exception {
AllocateHostsResult result = null;
try {
result = executeAllocateHosts(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 applySecurityGroupsToClientVpnTargetNetworkAsync(
ApplySecurityGroupsToClientVpnTargetNetworkRequest request) {
return applySecurityGroupsToClientVpnTargetNetworkAsync(request, null);
}
@Override
public java.util.concurrent.Future applySecurityGroupsToClientVpnTargetNetworkAsync(
final ApplySecurityGroupsToClientVpnTargetNetworkRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ApplySecurityGroupsToClientVpnTargetNetworkRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ApplySecurityGroupsToClientVpnTargetNetworkResult call() throws Exception {
ApplySecurityGroupsToClientVpnTargetNetworkResult result = null;
try {
result = executeApplySecurityGroupsToClientVpnTargetNetwork(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 assignIpv6AddressesAsync(AssignIpv6AddressesRequest request) {
return assignIpv6AddressesAsync(request, null);
}
@Override
public java.util.concurrent.Future assignIpv6AddressesAsync(final AssignIpv6AddressesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AssignIpv6AddressesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AssignIpv6AddressesResult call() throws Exception {
AssignIpv6AddressesResult result = null;
try {
result = executeAssignIpv6Addresses(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 assignPrivateIpAddressesAsync(AssignPrivateIpAddressesRequest request) {
return assignPrivateIpAddressesAsync(request, null);
}
@Override
public java.util.concurrent.Future assignPrivateIpAddressesAsync(final AssignPrivateIpAddressesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AssignPrivateIpAddressesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AssignPrivateIpAddressesResult call() throws Exception {
AssignPrivateIpAddressesResult result = null;
try {
result = executeAssignPrivateIpAddresses(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 associateAddressAsync(AssociateAddressRequest request) {
return associateAddressAsync(request, null);
}
@Override
public java.util.concurrent.Future associateAddressAsync(final AssociateAddressRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AssociateAddressRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AssociateAddressResult call() throws Exception {
AssociateAddressResult result = null;
try {
result = executeAssociateAddress(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 associateClientVpnTargetNetworkAsync(
AssociateClientVpnTargetNetworkRequest request) {
return associateClientVpnTargetNetworkAsync(request, null);
}
@Override
public java.util.concurrent.Future associateClientVpnTargetNetworkAsync(
final AssociateClientVpnTargetNetworkRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AssociateClientVpnTargetNetworkRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AssociateClientVpnTargetNetworkResult call() throws Exception {
AssociateClientVpnTargetNetworkResult result = null;
try {
result = executeAssociateClientVpnTargetNetwork(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 associateDhcpOptionsAsync(AssociateDhcpOptionsRequest request) {
return associateDhcpOptionsAsync(request, null);
}
@Override
public java.util.concurrent.Future associateDhcpOptionsAsync(final AssociateDhcpOptionsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AssociateDhcpOptionsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AssociateDhcpOptionsResult call() throws Exception {
AssociateDhcpOptionsResult result = null;
try {
result = executeAssociateDhcpOptions(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 associateIamInstanceProfileAsync(AssociateIamInstanceProfileRequest request) {
return associateIamInstanceProfileAsync(request, null);
}
@Override
public java.util.concurrent.Future associateIamInstanceProfileAsync(final AssociateIamInstanceProfileRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AssociateIamInstanceProfileRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AssociateIamInstanceProfileResult call() throws Exception {
AssociateIamInstanceProfileResult result = null;
try {
result = executeAssociateIamInstanceProfile(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 associateRouteTableAsync(AssociateRouteTableRequest request) {
return associateRouteTableAsync(request, null);
}
@Override
public java.util.concurrent.Future associateRouteTableAsync(final AssociateRouteTableRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AssociateRouteTableRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AssociateRouteTableResult call() throws Exception {
AssociateRouteTableResult result = null;
try {
result = executeAssociateRouteTable(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 associateSubnetCidrBlockAsync(AssociateSubnetCidrBlockRequest request) {
return associateSubnetCidrBlockAsync(request, null);
}
@Override
public java.util.concurrent.Future associateSubnetCidrBlockAsync(final AssociateSubnetCidrBlockRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AssociateSubnetCidrBlockRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AssociateSubnetCidrBlockResult call() throws Exception {
AssociateSubnetCidrBlockResult result = null;
try {
result = executeAssociateSubnetCidrBlock(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 associateTransitGatewayRouteTableAsync(
AssociateTransitGatewayRouteTableRequest request) {
return associateTransitGatewayRouteTableAsync(request, null);
}
@Override
public java.util.concurrent.Future associateTransitGatewayRouteTableAsync(
final AssociateTransitGatewayRouteTableRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AssociateTransitGatewayRouteTableRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AssociateTransitGatewayRouteTableResult call() throws Exception {
AssociateTransitGatewayRouteTableResult result = null;
try {
result = executeAssociateTransitGatewayRouteTable(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 associateVpcCidrBlockAsync(AssociateVpcCidrBlockRequest request) {
return associateVpcCidrBlockAsync(request, null);
}
@Override
public java.util.concurrent.Future associateVpcCidrBlockAsync(final AssociateVpcCidrBlockRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AssociateVpcCidrBlockRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AssociateVpcCidrBlockResult call() throws Exception {
AssociateVpcCidrBlockResult result = null;
try {
result = executeAssociateVpcCidrBlock(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 attachClassicLinkVpcAsync(AttachClassicLinkVpcRequest request) {
return attachClassicLinkVpcAsync(request, null);
}
@Override
public java.util.concurrent.Future attachClassicLinkVpcAsync(final AttachClassicLinkVpcRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AttachClassicLinkVpcRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AttachClassicLinkVpcResult call() throws Exception {
AttachClassicLinkVpcResult result = null;
try {
result = executeAttachClassicLinkVpc(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 attachInternetGatewayAsync(AttachInternetGatewayRequest request) {
return attachInternetGatewayAsync(request, null);
}
@Override
public java.util.concurrent.Future attachInternetGatewayAsync(final AttachInternetGatewayRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AttachInternetGatewayRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AttachInternetGatewayResult call() throws Exception {
AttachInternetGatewayResult result = null;
try {
result = executeAttachInternetGateway(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 attachNetworkInterfaceAsync(AttachNetworkInterfaceRequest request) {
return attachNetworkInterfaceAsync(request, null);
}
@Override
public java.util.concurrent.Future attachNetworkInterfaceAsync(final AttachNetworkInterfaceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AttachNetworkInterfaceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AttachNetworkInterfaceResult call() throws Exception {
AttachNetworkInterfaceResult result = null;
try {
result = executeAttachNetworkInterface(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 attachVolumeAsync(AttachVolumeRequest request) {
return attachVolumeAsync(request, null);
}
@Override
public java.util.concurrent.Future attachVolumeAsync(final AttachVolumeRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AttachVolumeRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AttachVolumeResult call() throws Exception {
AttachVolumeResult result = null;
try {
result = executeAttachVolume(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 attachVpnGatewayAsync(AttachVpnGatewayRequest request) {
return attachVpnGatewayAsync(request, null);
}
@Override
public java.util.concurrent.Future attachVpnGatewayAsync(final AttachVpnGatewayRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AttachVpnGatewayRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AttachVpnGatewayResult call() throws Exception {
AttachVpnGatewayResult result = null;
try {
result = executeAttachVpnGateway(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 authorizeClientVpnIngressAsync(AuthorizeClientVpnIngressRequest request) {
return authorizeClientVpnIngressAsync(request, null);
}
@Override
public java.util.concurrent.Future authorizeClientVpnIngressAsync(final AuthorizeClientVpnIngressRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AuthorizeClientVpnIngressRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AuthorizeClientVpnIngressResult call() throws Exception {
AuthorizeClientVpnIngressResult result = null;
try {
result = executeAuthorizeClientVpnIngress(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 authorizeSecurityGroupEgressAsync(AuthorizeSecurityGroupEgressRequest request) {
return authorizeSecurityGroupEgressAsync(request, null);
}
@Override
public java.util.concurrent.Future authorizeSecurityGroupEgressAsync(final AuthorizeSecurityGroupEgressRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AuthorizeSecurityGroupEgressRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AuthorizeSecurityGroupEgressResult call() throws Exception {
AuthorizeSecurityGroupEgressResult result = null;
try {
result = executeAuthorizeSecurityGroupEgress(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 authorizeSecurityGroupIngressAsync(AuthorizeSecurityGroupIngressRequest request) {
return authorizeSecurityGroupIngressAsync(request, null);
}
@Override
public java.util.concurrent.Future authorizeSecurityGroupIngressAsync(
final AuthorizeSecurityGroupIngressRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AuthorizeSecurityGroupIngressRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AuthorizeSecurityGroupIngressResult call() throws Exception {
AuthorizeSecurityGroupIngressResult result = null;
try {
result = executeAuthorizeSecurityGroupIngress(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 bundleInstanceAsync(BundleInstanceRequest request) {
return bundleInstanceAsync(request, null);
}
@Override
public java.util.concurrent.Future bundleInstanceAsync(final BundleInstanceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final BundleInstanceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public BundleInstanceResult call() throws Exception {
BundleInstanceResult result = null;
try {
result = executeBundleInstance(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 cancelBundleTaskAsync(CancelBundleTaskRequest request) {
return cancelBundleTaskAsync(request, null);
}
@Override
public java.util.concurrent.Future cancelBundleTaskAsync(final CancelBundleTaskRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CancelBundleTaskRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CancelBundleTaskResult call() throws Exception {
CancelBundleTaskResult result = null;
try {
result = executeCancelBundleTask(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 cancelCapacityReservationAsync(CancelCapacityReservationRequest request) {
return cancelCapacityReservationAsync(request, null);
}
@Override
public java.util.concurrent.Future cancelCapacityReservationAsync(final CancelCapacityReservationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CancelCapacityReservationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CancelCapacityReservationResult call() throws Exception {
CancelCapacityReservationResult result = null;
try {
result = executeCancelCapacityReservation(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 cancelConversionTaskAsync(CancelConversionTaskRequest request) {
return cancelConversionTaskAsync(request, null);
}
@Override
public java.util.concurrent.Future cancelConversionTaskAsync(final CancelConversionTaskRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CancelConversionTaskRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CancelConversionTaskResult call() throws Exception {
CancelConversionTaskResult result = null;
try {
result = executeCancelConversionTask(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 cancelExportTaskAsync(CancelExportTaskRequest request) {
return cancelExportTaskAsync(request, null);
}
@Override
public java.util.concurrent.Future cancelExportTaskAsync(final CancelExportTaskRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CancelExportTaskRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CancelExportTaskResult call() throws Exception {
CancelExportTaskResult result = null;
try {
result = executeCancelExportTask(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 cancelImportTaskAsync(CancelImportTaskRequest request) {
return cancelImportTaskAsync(request, null);
}
@Override
public java.util.concurrent.Future cancelImportTaskAsync(final CancelImportTaskRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CancelImportTaskRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CancelImportTaskResult call() throws Exception {
CancelImportTaskResult result = null;
try {
result = executeCancelImportTask(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the CancelImportTask operation.
*
* @see #cancelImportTaskAsync(CancelImportTaskRequest)
*/
@Override
public java.util.concurrent.Future cancelImportTaskAsync() {
return cancelImportTaskAsync(new CancelImportTaskRequest());
}
/**
* Simplified method form for invoking the CancelImportTask operation with an AsyncHandler.
*
* @see #cancelImportTaskAsync(CancelImportTaskRequest, com.amazonaws.handlers.AsyncHandler)
*/
@Override
public java.util.concurrent.Future cancelImportTaskAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return cancelImportTaskAsync(new CancelImportTaskRequest(), asyncHandler);
}
@Override
public java.util.concurrent.Future cancelReservedInstancesListingAsync(CancelReservedInstancesListingRequest request) {
return cancelReservedInstancesListingAsync(request, null);
}
@Override
public java.util.concurrent.Future cancelReservedInstancesListingAsync(
final CancelReservedInstancesListingRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CancelReservedInstancesListingRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CancelReservedInstancesListingResult call() throws Exception {
CancelReservedInstancesListingResult result = null;
try {
result = executeCancelReservedInstancesListing(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 cancelSpotFleetRequestsAsync(CancelSpotFleetRequestsRequest request) {
return cancelSpotFleetRequestsAsync(request, null);
}
@Override
public java.util.concurrent.Future cancelSpotFleetRequestsAsync(final CancelSpotFleetRequestsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CancelSpotFleetRequestsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CancelSpotFleetRequestsResult call() throws Exception {
CancelSpotFleetRequestsResult result = null;
try {
result = executeCancelSpotFleetRequests(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 cancelSpotInstanceRequestsAsync(CancelSpotInstanceRequestsRequest request) {
return cancelSpotInstanceRequestsAsync(request, null);
}
@Override
public java.util.concurrent.Future cancelSpotInstanceRequestsAsync(final CancelSpotInstanceRequestsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CancelSpotInstanceRequestsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CancelSpotInstanceRequestsResult call() throws Exception {
CancelSpotInstanceRequestsResult result = null;
try {
result = executeCancelSpotInstanceRequests(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 confirmProductInstanceAsync(ConfirmProductInstanceRequest request) {
return confirmProductInstanceAsync(request, null);
}
@Override
public java.util.concurrent.Future confirmProductInstanceAsync(final ConfirmProductInstanceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ConfirmProductInstanceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ConfirmProductInstanceResult call() throws Exception {
ConfirmProductInstanceResult result = null;
try {
result = executeConfirmProductInstance(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 copyFpgaImageAsync(CopyFpgaImageRequest request) {
return copyFpgaImageAsync(request, null);
}
@Override
public java.util.concurrent.Future copyFpgaImageAsync(final CopyFpgaImageRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CopyFpgaImageRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CopyFpgaImageResult call() throws Exception {
CopyFpgaImageResult result = null;
try {
result = executeCopyFpgaImage(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 copySnapshotAsync(CopySnapshotRequest request) {
return copySnapshotAsync(request, null);
}
@Override
public java.util.concurrent.Future copySnapshotAsync(final CopySnapshotRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CopySnapshotRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CopySnapshotResult call() throws Exception {
CopySnapshotResult result = null;
try {
result = executeCopySnapshot(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 createCapacityReservationAsync(CreateCapacityReservationRequest request) {
return createCapacityReservationAsync(request, null);
}
@Override
public java.util.concurrent.Future createCapacityReservationAsync(final CreateCapacityReservationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateCapacityReservationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateCapacityReservationResult call() throws Exception {
CreateCapacityReservationResult result = null;
try {
result = executeCreateCapacityReservation(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 createClientVpnEndpointAsync(CreateClientVpnEndpointRequest request) {
return createClientVpnEndpointAsync(request, null);
}
@Override
public java.util.concurrent.Future createClientVpnEndpointAsync(final CreateClientVpnEndpointRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateClientVpnEndpointRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateClientVpnEndpointResult call() throws Exception {
CreateClientVpnEndpointResult result = null;
try {
result = executeCreateClientVpnEndpoint(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 createClientVpnRouteAsync(CreateClientVpnRouteRequest request) {
return createClientVpnRouteAsync(request, null);
}
@Override
public java.util.concurrent.Future createClientVpnRouteAsync(final CreateClientVpnRouteRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateClientVpnRouteRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateClientVpnRouteResult call() throws Exception {
CreateClientVpnRouteResult result = null;
try {
result = executeCreateClientVpnRoute(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 createCustomerGatewayAsync(CreateCustomerGatewayRequest request) {
return createCustomerGatewayAsync(request, null);
}
@Override
public java.util.concurrent.Future createCustomerGatewayAsync(final CreateCustomerGatewayRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateCustomerGatewayRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateCustomerGatewayResult call() throws Exception {
CreateCustomerGatewayResult result = null;
try {
result = executeCreateCustomerGateway(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 createDefaultSubnetAsync(CreateDefaultSubnetRequest request) {
return createDefaultSubnetAsync(request, null);
}
@Override
public java.util.concurrent.Future createDefaultSubnetAsync(final CreateDefaultSubnetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateDefaultSubnetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateDefaultSubnetResult call() throws Exception {
CreateDefaultSubnetResult result = null;
try {
result = executeCreateDefaultSubnet(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 createDefaultVpcAsync(CreateDefaultVpcRequest request) {
return createDefaultVpcAsync(request, null);
}
@Override
public java.util.concurrent.Future createDefaultVpcAsync(final CreateDefaultVpcRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateDefaultVpcRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateDefaultVpcResult call() throws Exception {
CreateDefaultVpcResult result = null;
try {
result = executeCreateDefaultVpc(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 createDhcpOptionsAsync(CreateDhcpOptionsRequest request) {
return createDhcpOptionsAsync(request, null);
}
@Override
public java.util.concurrent.Future createDhcpOptionsAsync(final CreateDhcpOptionsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateDhcpOptionsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateDhcpOptionsResult call() throws Exception {
CreateDhcpOptionsResult result = null;
try {
result = executeCreateDhcpOptions(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 createEgressOnlyInternetGatewayAsync(
CreateEgressOnlyInternetGatewayRequest request) {
return createEgressOnlyInternetGatewayAsync(request, null);
}
@Override
public java.util.concurrent.Future createEgressOnlyInternetGatewayAsync(
final CreateEgressOnlyInternetGatewayRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateEgressOnlyInternetGatewayRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateEgressOnlyInternetGatewayResult call() throws Exception {
CreateEgressOnlyInternetGatewayResult result = null;
try {
result = executeCreateEgressOnlyInternetGateway(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 createFlowLogsAsync(CreateFlowLogsRequest request) {
return createFlowLogsAsync(request, null);
}
@Override
public java.util.concurrent.Future createFlowLogsAsync(final CreateFlowLogsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateFlowLogsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateFlowLogsResult call() throws Exception {
CreateFlowLogsResult result = null;
try {
result = executeCreateFlowLogs(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 createFpgaImageAsync(CreateFpgaImageRequest request) {
return createFpgaImageAsync(request, null);
}
@Override
public java.util.concurrent.Future createFpgaImageAsync(final CreateFpgaImageRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateFpgaImageRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateFpgaImageResult call() throws Exception {
CreateFpgaImageResult result = null;
try {
result = executeCreateFpgaImage(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 createImageAsync(CreateImageRequest request) {
return createImageAsync(request, null);
}
@Override
public java.util.concurrent.Future createImageAsync(final CreateImageRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateImageRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateImageResult call() throws Exception {
CreateImageResult result = null;
try {
result = executeCreateImage(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 createInstanceExportTaskAsync(CreateInstanceExportTaskRequest request) {
return createInstanceExportTaskAsync(request, null);
}
@Override
public java.util.concurrent.Future createInstanceExportTaskAsync(final CreateInstanceExportTaskRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateInstanceExportTaskRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateInstanceExportTaskResult call() throws Exception {
CreateInstanceExportTaskResult result = null;
try {
result = executeCreateInstanceExportTask(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 createInternetGatewayAsync(CreateInternetGatewayRequest request) {
return createInternetGatewayAsync(request, null);
}
@Override
public java.util.concurrent.Future createInternetGatewayAsync(final CreateInternetGatewayRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateInternetGatewayRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateInternetGatewayResult call() throws Exception {
CreateInternetGatewayResult result = null;
try {
result = executeCreateInternetGateway(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the CreateInternetGateway operation.
*
* @see #createInternetGatewayAsync(CreateInternetGatewayRequest)
*/
@Override
public java.util.concurrent.Future createInternetGatewayAsync() {
return createInternetGatewayAsync(new CreateInternetGatewayRequest());
}
/**
* Simplified method form for invoking the CreateInternetGateway operation with an AsyncHandler.
*
* @see #createInternetGatewayAsync(CreateInternetGatewayRequest, com.amazonaws.handlers.AsyncHandler)
*/
@Override
public java.util.concurrent.Future createInternetGatewayAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return createInternetGatewayAsync(new CreateInternetGatewayRequest(), asyncHandler);
}
@Override
public java.util.concurrent.Future createKeyPairAsync(CreateKeyPairRequest request) {
return createKeyPairAsync(request, null);
}
@Override
public java.util.concurrent.Future createKeyPairAsync(final CreateKeyPairRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateKeyPairRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateKeyPairResult call() throws Exception {
CreateKeyPairResult result = null;
try {
result = executeCreateKeyPair(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 createLaunchTemplateAsync(CreateLaunchTemplateRequest request) {
return createLaunchTemplateAsync(request, null);
}
@Override
public java.util.concurrent.Future createLaunchTemplateAsync(final CreateLaunchTemplateRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateLaunchTemplateRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateLaunchTemplateResult call() throws Exception {
CreateLaunchTemplateResult result = null;
try {
result = executeCreateLaunchTemplate(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 createLaunchTemplateVersionAsync(CreateLaunchTemplateVersionRequest request) {
return createLaunchTemplateVersionAsync(request, null);
}
@Override
public java.util.concurrent.Future createLaunchTemplateVersionAsync(final CreateLaunchTemplateVersionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateLaunchTemplateVersionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateLaunchTemplateVersionResult call() throws Exception {
CreateLaunchTemplateVersionResult result = null;
try {
result = executeCreateLaunchTemplateVersion(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 createNatGatewayAsync(CreateNatGatewayRequest request) {
return createNatGatewayAsync(request, null);
}
@Override
public java.util.concurrent.Future createNatGatewayAsync(final CreateNatGatewayRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateNatGatewayRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateNatGatewayResult call() throws Exception {
CreateNatGatewayResult result = null;
try {
result = executeCreateNatGateway(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 createNetworkAclAsync(CreateNetworkAclRequest request) {
return createNetworkAclAsync(request, null);
}
@Override
public java.util.concurrent.Future createNetworkAclAsync(final CreateNetworkAclRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateNetworkAclRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateNetworkAclResult call() throws Exception {
CreateNetworkAclResult result = null;
try {
result = executeCreateNetworkAcl(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 createNetworkAclEntryAsync(CreateNetworkAclEntryRequest request) {
return createNetworkAclEntryAsync(request, null);
}
@Override
public java.util.concurrent.Future createNetworkAclEntryAsync(final CreateNetworkAclEntryRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateNetworkAclEntryRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateNetworkAclEntryResult call() throws Exception {
CreateNetworkAclEntryResult result = null;
try {
result = executeCreateNetworkAclEntry(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 createNetworkInterfaceAsync(CreateNetworkInterfaceRequest request) {
return createNetworkInterfaceAsync(request, null);
}
@Override
public java.util.concurrent.Future createNetworkInterfaceAsync(final CreateNetworkInterfaceRequest request,
final com.amazonaws.handlers.AsyncHandler