com.amazonaws.services.ec2.AmazonEC2AsyncClient Maven / Gradle / Ivy
/*
* Copyright 2010-2013 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 java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import com.amazonaws.AmazonClientException;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.handlers.AsyncHandler;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
import com.amazonaws.services.ec2.model.*;
/**
* Asynchronous client for accessing AmazonEC2.
* All asynchronous calls made using this client are non-blocking. Callers could either
* process the result and handle the exceptions in the worker thread by providing a callback handler
* when making the call, or use the returned Future object to check the result of the call in the calling thread.
*
* Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale
* computing easier for developers.
*
*
* Amazon EC2's simple web service interface allows you to obtain and configure capacity with minimal friction. It provides you with complete control of
* your computing resources and lets you run on Amazon's proven computing environment. Amazon EC2 reduces the time required to obtain and boot new server
* instances to minutes, allowing you to quickly scale capacity, both up and down, as your computing requirements change. Amazon EC2 changes the
* economics of computing by allowing you to pay only for capacity that you actually use. Amazon EC2 provides developers the tools to build failure
* resilient applications and isolate themselves from common failure scenarios.
*
*
* Visit http://aws.amazon.com/ec2/ for more information.
*
*/
public class AmazonEC2AsyncClient extends AmazonEC2Client
implements AmazonEC2Async {
/**
* Executor service for executing asynchronous requests.
*/
private ExecutorService executorService;
/**
* Constructs a new asynchronous client to invoke service methods on
* AmazonEC2. 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
* - Instance profile credentials delivered through the Amazon EC2 metadata service
*
*
*
* All service calls made using this new client object are blocking, and will not
* return until the service call completes.
*
* @see DefaultAWSCredentialsProvider
*/
public AmazonEC2AsyncClient() {
this(new DefaultAWSCredentialsProviderChain());
}
/**
* Constructs a new asynchronous client to invoke service methods on
* AmazonEC2. 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
* - Instance profile credentials delivered through the Amazon EC2 metadata service
*
*
*
* All service calls made using this new client object are blocking, and will not
* return until the service call completes.
*
* @param clientConfiguration The client configuration options controlling how this
* client connects to AmazonEC2
* (ex: proxy settings, retry counts, etc.).
*
* @see DefaultAWSCredentialsProvider
*/
public AmazonEC2AsyncClient(ClientConfiguration clientConfiguration) {
this(new DefaultAWSCredentialsProviderChain(), clientConfiguration, Executors.newCachedThreadPool());
}
/**
* Constructs a new asynchronous client to invoke service methods on
* AmazonEC2 using the specified AWS account credentials.
* Default client settings will be used, and a default cached thread pool will be
* created for executing the asynchronous tasks.
*
*
* All calls made using this new client object are non-blocking, and will immediately
* return a Java Future object that the caller can later check to see if the service
* call has actually completed.
*
* @param awsCredentials The AWS credentials (access key ID and secret key) to use
* when authenticating with AWS services.
*/
public AmazonEC2AsyncClient(AWSCredentials awsCredentials) {
this(awsCredentials, Executors.newCachedThreadPool());
}
/**
* Constructs a new asynchronous client to invoke service methods on
* AmazonEC2 using the specified AWS account credentials
* and executor service. Default client settings will be used.
*
*
* All calls made using this new client object are non-blocking, and will immediately
* return a Java Future object that the caller can later check to see if the service
* call has actually completed.
*
* @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.
*/
public AmazonEC2AsyncClient(AWSCredentials awsCredentials, ExecutorService executorService) {
super(awsCredentials);
this.executorService = executorService;
}
/**
* Constructs a new asynchronous client to invoke service methods on
* AmazonEC2 using the specified AWS account credentials,
* executor service, and client configuration options.
*
*
* All calls made using this new client object are non-blocking, and will immediately
* return a Java Future object that the caller can later check to see if the service
* call has actually completed.
*
* @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.
*/
public AmazonEC2AsyncClient(AWSCredentials awsCredentials,
ClientConfiguration clientConfiguration, ExecutorService executorService) {
super(awsCredentials, clientConfiguration);
this.executorService = executorService;
}
/**
* Constructs a new asynchronous client to invoke service methods on
* AmazonEC2 using the specified AWS account credentials provider.
* Default client settings will be used, and a default cached thread pool will be
* created for executing the asynchronous tasks.
*
*
* All calls made using this new client object are non-blocking, and will immediately
* return a Java Future object that the caller can later check to see if the service
* call has actually completed.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials
* to authenticate requests with AWS services.
*/
public AmazonEC2AsyncClient(AWSCredentialsProvider awsCredentialsProvider) {
this(awsCredentialsProvider, Executors.newCachedThreadPool());
}
/**
* Constructs a new asynchronous client to invoke service methods on
* AmazonEC2 using the specified AWS account credentials provider
* and executor service. Default client settings will be used.
*
*
* All calls made using this new client object are non-blocking, and will immediately
* return a Java Future object that the caller can later check to see if the service
* call has actually completed.
*
* @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.
*/
public AmazonEC2AsyncClient(AWSCredentialsProvider awsCredentialsProvider, ExecutorService executorService) {
this(awsCredentialsProvider, new ClientConfiguration(), executorService);
}
/**
* Constructs a new asynchronous client to invoke service methods on
* AmazonEC2 using the specified AWS account credentials
* provider and client configuration options.
*
*
* All calls made using this new client object are non-blocking, and will immediately
* return a Java Future object that the caller can later check to see if the service
* call has actually completed.
*
* @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).
*/
public AmazonEC2AsyncClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration) {
this(awsCredentialsProvider, clientConfiguration, Executors.newCachedThreadPool());
}
/**
* Constructs a new asynchronous client to invoke service methods on
* AmazonEC2 using the specified AWS account credentials
* provider, executor service, and client configuration options.
*
*
* All calls made using this new client object are non-blocking, and will immediately
* return a Java Future object that the caller can later check to see if the service
* call has actually completed.
*
* @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.
*/
public AmazonEC2AsyncClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration, ExecutorService executorService) {
super(awsCredentialsProvider, clientConfiguration);
this.executorService = executorService;
}
/**
* Returns the executor service used by this async client to execute
* requests.
*
* @return The executor service used by this async client to execute
* requests.
*/
public ExecutorService getExecutorService() {
return executorService;
}
/**
* 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 getExecutorService().shutdown() prior to calling this method.
*/
@Override
public void shutdown() {
super.shutdown();
executorService.shutdownNow();
}
/**
*
* The RebootInstances operation requests a reboot of one or more
* instances. This operation is asynchronous; it only queues a request to
* reboot the specified instance(s). The operation will succeed if the
* instances are valid and belong to the user. Requests to reboot
* terminated instances are ignored.
*
*
* @param rebootInstancesRequest Container for the necessary parameters
* to execute the RebootInstances operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* RebootInstances service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future rebootInstancesAsync(final RebootInstancesRequest rebootInstancesRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
rebootInstances(rebootInstancesRequest);
return null;
}
});
}
/**
*
* The RebootInstances operation requests a reboot of one or more
* instances. This operation is asynchronous; it only queues a request to
* reboot the specified instance(s). The operation will succeed if the
* instances are valid and belong to the user. Requests to reboot
* terminated instances are ignored.
*
*
* @param rebootInstancesRequest Container for the necessary parameters
* to execute the RebootInstances operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* RebootInstances service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future rebootInstancesAsync(
final RebootInstancesRequest rebootInstancesRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
rebootInstances(rebootInstancesRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(rebootInstancesRequest, null);
return null;
}
});
}
/**
*
* The DescribeReservedInstances operation describes Reserved Instances
* that were purchased for use with your account.
*
*
* @param describeReservedInstancesRequest Container for the necessary
* parameters to execute the DescribeReservedInstances operation on
* AmazonEC2.
*
* @return A Java Future object containing the response from the
* DescribeReservedInstances service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeReservedInstancesAsync(final DescribeReservedInstancesRequest describeReservedInstancesRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeReservedInstancesResult call() throws Exception {
return describeReservedInstances(describeReservedInstancesRequest);
}
});
}
/**
*
* The DescribeReservedInstances operation describes Reserved Instances
* that were purchased for use with your account.
*
*
* @param describeReservedInstancesRequest Container for the necessary
* parameters to execute the DescribeReservedInstances operation on
* AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DescribeReservedInstances service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeReservedInstancesAsync(
final DescribeReservedInstancesRequest describeReservedInstancesRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeReservedInstancesResult call() throws Exception {
DescribeReservedInstancesResult result;
try {
result = describeReservedInstances(describeReservedInstancesRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(describeReservedInstancesRequest, result);
return result;
}
});
}
/**
*
* The DescribeAvailabilityZones operation describes availability zones
* that are currently available to the account and their states.
*
*
* Availability zones are not the same across accounts. The availability
* zone us-east-1a
for account A is not necessarily the same
* as us-east-1a
for account B. Zone assignments are mapped
* independently for each account.
*
*
* @param describeAvailabilityZonesRequest Container for the necessary
* parameters to execute the DescribeAvailabilityZones operation on
* AmazonEC2.
*
* @return A Java Future object containing the response from the
* DescribeAvailabilityZones service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeAvailabilityZonesAsync(final DescribeAvailabilityZonesRequest describeAvailabilityZonesRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeAvailabilityZonesResult call() throws Exception {
return describeAvailabilityZones(describeAvailabilityZonesRequest);
}
});
}
/**
*
* The DescribeAvailabilityZones operation describes availability zones
* that are currently available to the account and their states.
*
*
* Availability zones are not the same across accounts. The availability
* zone us-east-1a
for account A is not necessarily the same
* as us-east-1a
for account B. Zone assignments are mapped
* independently for each account.
*
*
* @param describeAvailabilityZonesRequest Container for the necessary
* parameters to execute the DescribeAvailabilityZones operation on
* AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DescribeAvailabilityZones service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeAvailabilityZonesAsync(
final DescribeAvailabilityZonesRequest describeAvailabilityZonesRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeAvailabilityZonesResult call() throws Exception {
DescribeAvailabilityZonesResult result;
try {
result = describeAvailabilityZones(describeAvailabilityZonesRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(describeAvailabilityZonesRequest, result);
return result;
}
});
}
/**
*
* Detach a previously attached volume from a running instance.
*
*
* @param detachVolumeRequest Container for the necessary parameters to
* execute the DetachVolume operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* DetachVolume service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future detachVolumeAsync(final DetachVolumeRequest detachVolumeRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DetachVolumeResult call() throws Exception {
return detachVolume(detachVolumeRequest);
}
});
}
/**
*
* Detach a previously attached volume from a running instance.
*
*
* @param detachVolumeRequest Container for the necessary parameters to
* execute the DetachVolume operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DetachVolume service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future detachVolumeAsync(
final DetachVolumeRequest detachVolumeRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DetachVolumeResult call() throws Exception {
DetachVolumeResult result;
try {
result = detachVolume(detachVolumeRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(detachVolumeRequest, result);
return result;
}
});
}
/**
*
* The DeleteKeyPair operation deletes a key pair.
*
*
* @param deleteKeyPairRequest Container for the necessary parameters to
* execute the DeleteKeyPair operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* DeleteKeyPair service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deleteKeyPairAsync(final DeleteKeyPairRequest deleteKeyPairRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
deleteKeyPair(deleteKeyPairRequest);
return null;
}
});
}
/**
*
* The DeleteKeyPair operation deletes a key pair.
*
*
* @param deleteKeyPairRequest Container for the necessary parameters to
* execute the DeleteKeyPair operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DeleteKeyPair service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deleteKeyPairAsync(
final DeleteKeyPairRequest deleteKeyPairRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
deleteKeyPair(deleteKeyPairRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(deleteKeyPairRequest, null);
return null;
}
});
}
/**
*
* Disables monitoring for a running instance.
*
*
* @param unmonitorInstancesRequest Container for the necessary
* parameters to execute the UnmonitorInstances operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* UnmonitorInstances service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future unmonitorInstancesAsync(final UnmonitorInstancesRequest unmonitorInstancesRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public UnmonitorInstancesResult call() throws Exception {
return unmonitorInstances(unmonitorInstancesRequest);
}
});
}
/**
*
* Disables monitoring for a running instance.
*
*
* @param unmonitorInstancesRequest Container for the necessary
* parameters to execute the UnmonitorInstances operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* UnmonitorInstances service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future unmonitorInstancesAsync(
final UnmonitorInstancesRequest unmonitorInstancesRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public UnmonitorInstancesResult call() throws Exception {
UnmonitorInstancesResult result;
try {
result = unmonitorInstances(unmonitorInstancesRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(unmonitorInstancesRequest, result);
return result;
}
});
}
/**
*
* Attaches a VPN gateway to a VPC. This is the last step required to
* get your VPC fully connected to your data center before launching
* instances in it. For more information, go to Process for Using Amazon
* VPC in the Amazon Virtual Private Cloud Developer Guide.
*
*
* @param attachVpnGatewayRequest Container for the necessary parameters
* to execute the AttachVpnGateway operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* AttachVpnGateway service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future attachVpnGatewayAsync(final AttachVpnGatewayRequest attachVpnGatewayRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public AttachVpnGatewayResult call() throws Exception {
return attachVpnGateway(attachVpnGatewayRequest);
}
});
}
/**
*
* Attaches a VPN gateway to a VPC. This is the last step required to
* get your VPC fully connected to your data center before launching
* instances in it. For more information, go to Process for Using Amazon
* VPC in the Amazon Virtual Private Cloud Developer Guide.
*
*
* @param attachVpnGatewayRequest Container for the necessary parameters
* to execute the AttachVpnGateway operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* AttachVpnGateway service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future attachVpnGatewayAsync(
final AttachVpnGatewayRequest attachVpnGatewayRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public AttachVpnGatewayResult call() throws Exception {
AttachVpnGatewayResult result;
try {
result = attachVpnGateway(attachVpnGatewayRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(attachVpnGatewayRequest, result);
return result;
}
});
}
/**
*
* Creates an Amazon EBS-backed AMI from a "running" or "stopped"
* instance. AMIs that use an Amazon EBS root device boot faster than
* AMIs that use instance stores. They can be up to 1 TiB in size, use
* storage that persists on instance failure, and can be stopped and
* started.
*
*
* @param createImageRequest Container for the necessary parameters to
* execute the CreateImage operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* CreateImage service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future createImageAsync(final CreateImageRequest createImageRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public CreateImageResult call() throws Exception {
return createImage(createImageRequest);
}
});
}
/**
*
* Creates an Amazon EBS-backed AMI from a "running" or "stopped"
* instance. AMIs that use an Amazon EBS root device boot faster than
* AMIs that use instance stores. They can be up to 1 TiB in size, use
* storage that persists on instance failure, and can be stopped and
* started.
*
*
* @param createImageRequest Container for the necessary parameters to
* execute the CreateImage operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* CreateImage service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future createImageAsync(
final CreateImageRequest createImageRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public CreateImageResult call() throws Exception {
CreateImageResult result;
try {
result = createImage(createImageRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(createImageRequest, result);
return result;
}
});
}
/**
*
* The DeleteSecurityGroup operation deletes a security group.
*
*
* NOTE: If you attempt to delete a security group that contains
* instances, a fault is returned. If you attempt to delete a security
* group that is referenced by another security group, a fault is
* returned. For example, if security group B has a rule that allows
* access from security group A, security group A cannot be deleted until
* the allow rule is removed.
*
*
* @param deleteSecurityGroupRequest Container for the necessary
* parameters to execute the DeleteSecurityGroup operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* DeleteSecurityGroup service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deleteSecurityGroupAsync(final DeleteSecurityGroupRequest deleteSecurityGroupRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
deleteSecurityGroup(deleteSecurityGroupRequest);
return null;
}
});
}
/**
*
* The DeleteSecurityGroup operation deletes a security group.
*
*
* NOTE: If you attempt to delete a security group that contains
* instances, a fault is returned. If you attempt to delete a security
* group that is referenced by another security group, a fault is
* returned. For example, if security group B has a rule that allows
* access from security group A, security group A cannot be deleted until
* the allow rule is removed.
*
*
* @param deleteSecurityGroupRequest Container for the necessary
* parameters to execute the DeleteSecurityGroup operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DeleteSecurityGroup service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deleteSecurityGroupAsync(
final DeleteSecurityGroupRequest deleteSecurityGroupRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
deleteSecurityGroup(deleteSecurityGroupRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(deleteSecurityGroupRequest, null);
return null;
}
});
}
/**
*
* @param createInstanceExportTaskRequest Container for the necessary
* parameters to execute the CreateInstanceExportTask operation on
* AmazonEC2.
*
* @return A Java Future object containing the response from the
* CreateInstanceExportTask service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future createInstanceExportTaskAsync(final CreateInstanceExportTaskRequest createInstanceExportTaskRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public CreateInstanceExportTaskResult call() throws Exception {
return createInstanceExportTask(createInstanceExportTaskRequest);
}
});
}
/**
*
* @param createInstanceExportTaskRequest Container for the necessary
* parameters to execute the CreateInstanceExportTask operation on
* AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* CreateInstanceExportTask service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future createInstanceExportTaskAsync(
final CreateInstanceExportTaskRequest createInstanceExportTaskRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public CreateInstanceExportTaskResult call() throws Exception {
CreateInstanceExportTaskResult result;
try {
result = createInstanceExportTask(createInstanceExportTaskRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(createInstanceExportTaskRequest, result);
return result;
}
});
}
/**
*
* Retrieves the encrypted administrator password for the instances
* running Windows.
*
*
* NOTE: The Windows password is only generated the first time an
* AMI is launched. It is not generated for rebundled AMIs or after the
* password is changed on an instance. The password is encrypted using
* the key pair that you provided.
*
*
* @param getPasswordDataRequest Container for the necessary parameters
* to execute the GetPasswordData operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* GetPasswordData service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future getPasswordDataAsync(final GetPasswordDataRequest getPasswordDataRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public GetPasswordDataResult call() throws Exception {
return getPasswordData(getPasswordDataRequest);
}
});
}
/**
*
* Retrieves the encrypted administrator password for the instances
* running Windows.
*
*
* NOTE: The Windows password is only generated the first time an
* AMI is launched. It is not generated for rebundled AMIs or after the
* password is changed on an instance. The password is encrypted using
* the key pair that you provided.
*
*
* @param getPasswordDataRequest Container for the necessary parameters
* to execute the GetPasswordData operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* GetPasswordData service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future getPasswordDataAsync(
final GetPasswordDataRequest getPasswordDataRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public GetPasswordDataResult call() throws Exception {
GetPasswordDataResult result;
try {
result = getPasswordData(getPasswordDataRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(getPasswordDataRequest, result);
return result;
}
});
}
/**
*
* Associates a set of DHCP options (that you've previously created)
* with the specified VPC. Or, associates the default DHCP options with
* the VPC. The default set consists of the standard EC2 host name, no
* domain name, no DNS server, no NTP server, and no NetBIOS server or
* node type. After you associate the options with the VPC, any existing
* instances and all new instances that you launch in that VPC use the
* options. For more information about the supported DHCP options and
* using them with Amazon VPC, go to Using DHCP Options in the Amazon
* Virtual Private Cloud Developer Guide.
*
*
* @param associateDhcpOptionsRequest Container for the necessary
* parameters to execute the AssociateDhcpOptions operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* AssociateDhcpOptions service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future associateDhcpOptionsAsync(final AssociateDhcpOptionsRequest associateDhcpOptionsRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
associateDhcpOptions(associateDhcpOptionsRequest);
return null;
}
});
}
/**
*
* Associates a set of DHCP options (that you've previously created)
* with the specified VPC. Or, associates the default DHCP options with
* the VPC. The default set consists of the standard EC2 host name, no
* domain name, no DNS server, no NTP server, and no NetBIOS server or
* node type. After you associate the options with the VPC, any existing
* instances and all new instances that you launch in that VPC use the
* options. For more information about the supported DHCP options and
* using them with Amazon VPC, go to Using DHCP Options in the Amazon
* Virtual Private Cloud Developer Guide.
*
*
* @param associateDhcpOptionsRequest Container for the necessary
* parameters to execute the AssociateDhcpOptions operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* AssociateDhcpOptions service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future associateDhcpOptionsAsync(
final AssociateDhcpOptionsRequest associateDhcpOptionsRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
associateDhcpOptions(associateDhcpOptionsRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(associateDhcpOptionsRequest, null);
return null;
}
});
}
/**
*
* This action applies only to security groups in a VPC; it's not
* supported for EC2 security groups. For information about Amazon
* Virtual Private Cloud and VPC security groups, go to the Amazon
* Virtual Private Cloud User Guide.
*
*
* The action adds one or more egress rules to a VPC security group.
* Specifically, this permits instances in a security group to send
* traffic to either one or more destination CIDR IP address ranges, or
* to one or more destination security groups in the same VPC.
*
*
* Each rule consists of the protocol (e.g., TCP), plus either a CIDR
* range, or a source group. For the TCP and UDP protocols, you must also
* specify the destination port or port range. For the ICMP protocol, you
* must also specify the ICMP type and code. You can use -1
* as a wildcard for the ICMP type or code.
*
*
* Rule changes are propagated to instances within the security group as
* quickly as possible. However, a small delay might occur.
*
*
* Important: For VPC security groups: You can have up to 50
* rules total per group (covering both ingress and egress).
*
*
* @param authorizeSecurityGroupEgressRequest Container for the necessary
* parameters to execute the AuthorizeSecurityGroupEgress operation on
* AmazonEC2.
*
* @return A Java Future object containing the response from the
* AuthorizeSecurityGroupEgress service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future authorizeSecurityGroupEgressAsync(final AuthorizeSecurityGroupEgressRequest authorizeSecurityGroupEgressRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
authorizeSecurityGroupEgress(authorizeSecurityGroupEgressRequest);
return null;
}
});
}
/**
*
* This action applies only to security groups in a VPC; it's not
* supported for EC2 security groups. For information about Amazon
* Virtual Private Cloud and VPC security groups, go to the Amazon
* Virtual Private Cloud User Guide.
*
*
* The action adds one or more egress rules to a VPC security group.
* Specifically, this permits instances in a security group to send
* traffic to either one or more destination CIDR IP address ranges, or
* to one or more destination security groups in the same VPC.
*
*
* Each rule consists of the protocol (e.g., TCP), plus either a CIDR
* range, or a source group. For the TCP and UDP protocols, you must also
* specify the destination port or port range. For the ICMP protocol, you
* must also specify the ICMP type and code. You can use -1
* as a wildcard for the ICMP type or code.
*
*
* Rule changes are propagated to instances within the security group as
* quickly as possible. However, a small delay might occur.
*
*
* Important: For VPC security groups: You can have up to 50
* rules total per group (covering both ingress and egress).
*
*
* @param authorizeSecurityGroupEgressRequest Container for the necessary
* parameters to execute the AuthorizeSecurityGroupEgress operation on
* AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* AuthorizeSecurityGroupEgress service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future authorizeSecurityGroupEgressAsync(
final AuthorizeSecurityGroupEgressRequest authorizeSecurityGroupEgressRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
authorizeSecurityGroupEgress(authorizeSecurityGroupEgressRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(authorizeSecurityGroupEgressRequest, null);
return null;
}
});
}
/**
*
* Stops an instance that uses an Amazon EBS volume as its root device.
* Instances that use Amazon EBS volumes as their root devices can be
* quickly stopped and started. When an instance is stopped, the compute
* resources are released and you are not billed for hourly instance
* usage. However, your root partition Amazon EBS volume remains,
* continues to persist your data, and you are charged for Amazon EBS
* volume usage. You can restart your instance at any time.
*
*
* NOTE: Before stopping an instance, make sure it is in a state
* from which it can be restarted. Stopping an instance does not preserve
* data stored in RAM. Performing this operation on an instance that uses
* an instance store as its root device returns an error.
*
*
* @param stopInstancesRequest Container for the necessary parameters to
* execute the StopInstances operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* StopInstances service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future stopInstancesAsync(final StopInstancesRequest stopInstancesRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public StopInstancesResult call() throws Exception {
return stopInstances(stopInstancesRequest);
}
});
}
/**
*
* Stops an instance that uses an Amazon EBS volume as its root device.
* Instances that use Amazon EBS volumes as their root devices can be
* quickly stopped and started. When an instance is stopped, the compute
* resources are released and you are not billed for hourly instance
* usage. However, your root partition Amazon EBS volume remains,
* continues to persist your data, and you are charged for Amazon EBS
* volume usage. You can restart your instance at any time.
*
*
* NOTE: Before stopping an instance, make sure it is in a state
* from which it can be restarted. Stopping an instance does not preserve
* data stored in RAM. Performing this operation on an instance that uses
* an instance store as its root device returns an error.
*
*
* @param stopInstancesRequest Container for the necessary parameters to
* execute the StopInstances operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* StopInstances service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future stopInstancesAsync(
final StopInstancesRequest stopInstancesRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public StopInstancesResult call() throws Exception {
StopInstancesResult result;
try {
result = stopInstances(stopInstancesRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(stopInstancesRequest, result);
return result;
}
});
}
/**
*
* Imports the public key from an RSA key pair created with a
* third-party tool. This operation differs from CreateKeyPair as the
* private key is never transferred between the caller and AWS servers.
*
*
* RSA key pairs are easily created on Microsoft Windows and Linux OS
* systems using the ssh-keygen
command line tool provided
* with the standard OpenSSH installation. Standard library support for
* RSA key pair creation is also available for Java, Ruby, Python, and
* many other programming languages.
*
*
* The following formats are supported:
*
*
*
* - OpenSSH public key format,
* - Base64 encoded DER format.
* - SSH public key file format as specified in RFC4716 .
*
*
*
* @param importKeyPairRequest Container for the necessary parameters to
* execute the ImportKeyPair operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* ImportKeyPair service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future importKeyPairAsync(final ImportKeyPairRequest importKeyPairRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public ImportKeyPairResult call() throws Exception {
return importKeyPair(importKeyPairRequest);
}
});
}
/**
*
* Imports the public key from an RSA key pair created with a
* third-party tool. This operation differs from CreateKeyPair as the
* private key is never transferred between the caller and AWS servers.
*
*
* RSA key pairs are easily created on Microsoft Windows and Linux OS
* systems using the ssh-keygen
command line tool provided
* with the standard OpenSSH installation. Standard library support for
* RSA key pair creation is also available for Java, Ruby, Python, and
* many other programming languages.
*
*
* The following formats are supported:
*
*
*
* - OpenSSH public key format,
* - Base64 encoded DER format.
* - SSH public key file format as specified in RFC4716 .
*
*
*
* @param importKeyPairRequest Container for the necessary parameters to
* execute the ImportKeyPair operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* ImportKeyPair service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future importKeyPairAsync(
final ImportKeyPairRequest importKeyPairRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public ImportKeyPairResult call() throws Exception {
ImportKeyPairResult result;
try {
result = importKeyPair(importKeyPairRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(importKeyPairRequest, result);
return result;
}
});
}
/**
*
* @param deleteNetworkInterfaceRequest Container for the necessary
* parameters to execute the DeleteNetworkInterface operation on
* AmazonEC2.
*
* @return A Java Future object containing the response from the
* DeleteNetworkInterface service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deleteNetworkInterfaceAsync(final DeleteNetworkInterfaceRequest deleteNetworkInterfaceRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
deleteNetworkInterface(deleteNetworkInterfaceRequest);
return null;
}
});
}
/**
*
* @param deleteNetworkInterfaceRequest Container for the necessary
* parameters to execute the DeleteNetworkInterface operation on
* AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DeleteNetworkInterface service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deleteNetworkInterfaceAsync(
final DeleteNetworkInterfaceRequest deleteNetworkInterfaceRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
deleteNetworkInterface(deleteNetworkInterfaceRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(deleteNetworkInterfaceRequest, null);
return null;
}
});
}
/**
*
* @param modifyVpcAttributeRequest Container for the necessary
* parameters to execute the ModifyVpcAttribute operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* ModifyVpcAttribute service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future modifyVpcAttributeAsync(final ModifyVpcAttributeRequest modifyVpcAttributeRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
modifyVpcAttribute(modifyVpcAttributeRequest);
return null;
}
});
}
/**
*
* @param modifyVpcAttributeRequest Container for the necessary
* parameters to execute the ModifyVpcAttribute operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* ModifyVpcAttribute service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future modifyVpcAttributeAsync(
final ModifyVpcAttributeRequest modifyVpcAttributeRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
modifyVpcAttribute(modifyVpcAttributeRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(modifyVpcAttributeRequest, null);
return null;
}
});
}
/**
*
* The CreateSecurityGroup operation creates a new security group.
*
*
* Every instance is launched in a security group. If no security group
* is specified during launch, the instances are launched in the default
* security group. Instances within the same security group have
* unrestricted network access to each other. Instances will reject
* network access attempts from other instances in a different security
* group. As the owner of instances you can grant or revoke specific
* permissions using the AuthorizeSecurityGroupIngress and
* RevokeSecurityGroupIngress operations.
*
*
* @param createSecurityGroupRequest Container for the necessary
* parameters to execute the CreateSecurityGroup operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* CreateSecurityGroup service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future createSecurityGroupAsync(final CreateSecurityGroupRequest createSecurityGroupRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public CreateSecurityGroupResult call() throws Exception {
return createSecurityGroup(createSecurityGroupRequest);
}
});
}
/**
*
* The CreateSecurityGroup operation creates a new security group.
*
*
* Every instance is launched in a security group. If no security group
* is specified during launch, the instances are launched in the default
* security group. Instances within the same security group have
* unrestricted network access to each other. Instances will reject
* network access attempts from other instances in a different security
* group. As the owner of instances you can grant or revoke specific
* permissions using the AuthorizeSecurityGroupIngress and
* RevokeSecurityGroupIngress operations.
*
*
* @param createSecurityGroupRequest Container for the necessary
* parameters to execute the CreateSecurityGroup operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* CreateSecurityGroup service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future createSecurityGroupAsync(
final CreateSecurityGroupRequest createSecurityGroupRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public CreateSecurityGroupResult call() throws Exception {
CreateSecurityGroupResult result;
try {
result = createSecurityGroup(createSecurityGroupRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(createSecurityGroupRequest, result);
return result;
}
});
}
/**
*
* Describes the Spot Price history.
*
*
* Spot Instances are instances that Amazon EC2 starts on your behalf
* when the maximum price that you specify exceeds the current Spot
* Price. Amazon EC2 periodically sets the Spot Price based on available
* Spot Instance capacity and current spot instance requests.
*
*
* For conceptual information about Spot Instances, refer to the Amazon
* Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud
* User Guide .
*
*
*
* @param describeSpotPriceHistoryRequest Container for the necessary
* parameters to execute the DescribeSpotPriceHistory operation on
* AmazonEC2.
*
* @return A Java Future object containing the response from the
* DescribeSpotPriceHistory service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeSpotPriceHistoryAsync(final DescribeSpotPriceHistoryRequest describeSpotPriceHistoryRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeSpotPriceHistoryResult call() throws Exception {
return describeSpotPriceHistory(describeSpotPriceHistoryRequest);
}
});
}
/**
*
* Describes the Spot Price history.
*
*
* Spot Instances are instances that Amazon EC2 starts on your behalf
* when the maximum price that you specify exceeds the current Spot
* Price. Amazon EC2 periodically sets the Spot Price based on available
* Spot Instance capacity and current spot instance requests.
*
*
* For conceptual information about Spot Instances, refer to the Amazon
* Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud
* User Guide .
*
*
*
* @param describeSpotPriceHistoryRequest Container for the necessary
* parameters to execute the DescribeSpotPriceHistory operation on
* AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DescribeSpotPriceHistory service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeSpotPriceHistoryAsync(
final DescribeSpotPriceHistoryRequest describeSpotPriceHistoryRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeSpotPriceHistoryResult call() throws Exception {
DescribeSpotPriceHistoryResult result;
try {
result = describeSpotPriceHistory(describeSpotPriceHistoryRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(describeSpotPriceHistoryRequest, result);
return result;
}
});
}
/**
*
* @param describeNetworkInterfacesRequest Container for the necessary
* parameters to execute the DescribeNetworkInterfaces operation on
* AmazonEC2.
*
* @return A Java Future object containing the response from the
* DescribeNetworkInterfaces service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeNetworkInterfacesAsync(final DescribeNetworkInterfacesRequest describeNetworkInterfacesRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeNetworkInterfacesResult call() throws Exception {
return describeNetworkInterfaces(describeNetworkInterfacesRequest);
}
});
}
/**
*
* @param describeNetworkInterfacesRequest Container for the necessary
* parameters to execute the DescribeNetworkInterfaces operation on
* AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DescribeNetworkInterfaces service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeNetworkInterfacesAsync(
final DescribeNetworkInterfacesRequest describeNetworkInterfacesRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeNetworkInterfacesResult call() throws Exception {
DescribeNetworkInterfacesResult result;
try {
result = describeNetworkInterfaces(describeNetworkInterfacesRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(describeNetworkInterfacesRequest, result);
return result;
}
});
}
/**
*
* The DescribeRegions operation describes regions zones that are
* currently available to the account.
*
*
* @param describeRegionsRequest Container for the necessary parameters
* to execute the DescribeRegions operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* DescribeRegions service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeRegionsAsync(final DescribeRegionsRequest describeRegionsRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeRegionsResult call() throws Exception {
return describeRegions(describeRegionsRequest);
}
});
}
/**
*
* The DescribeRegions operation describes regions zones that are
* currently available to the account.
*
*
* @param describeRegionsRequest Container for the necessary parameters
* to execute the DescribeRegions operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DescribeRegions service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeRegionsAsync(
final DescribeRegionsRequest describeRegionsRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeRegionsResult call() throws Exception {
DescribeRegionsResult result;
try {
result = describeRegions(describeRegionsRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(describeRegionsRequest, result);
return result;
}
});
}
/**
*
* @param createReservedInstancesListingRequest Container for the
* necessary parameters to execute the CreateReservedInstancesListing
* operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* CreateReservedInstancesListing service method, as returned by
* AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future createReservedInstancesListingAsync(final CreateReservedInstancesListingRequest createReservedInstancesListingRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public CreateReservedInstancesListingResult call() throws Exception {
return createReservedInstancesListing(createReservedInstancesListingRequest);
}
});
}
/**
*
* @param createReservedInstancesListingRequest Container for the
* necessary parameters to execute the CreateReservedInstancesListing
* operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* CreateReservedInstancesListing service method, as returned by
* AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future createReservedInstancesListingAsync(
final CreateReservedInstancesListingRequest createReservedInstancesListingRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public CreateReservedInstancesListingResult call() throws Exception {
CreateReservedInstancesListingResult result;
try {
result = createReservedInstancesListing(createReservedInstancesListingRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(createReservedInstancesListingRequest, result);
return result;
}
});
}
/**
*
* Creates a set of DHCP options that you can then associate with one or
* more VPCs, causing all existing and new instances that you launch in
* those VPCs to use the set of DHCP options. The following table lists
* the individual DHCP options you can specify. For more information
* about the options, go to
* http://www.ietf.org/rfc/rfc2132.txt
*
*
* @param createDhcpOptionsRequest Container for the necessary parameters
* to execute the CreateDhcpOptions operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* CreateDhcpOptions service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future createDhcpOptionsAsync(final CreateDhcpOptionsRequest createDhcpOptionsRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public CreateDhcpOptionsResult call() throws Exception {
return createDhcpOptions(createDhcpOptionsRequest);
}
});
}
/**
*
* Creates a set of DHCP options that you can then associate with one or
* more VPCs, causing all existing and new instances that you launch in
* those VPCs to use the set of DHCP options. The following table lists
* the individual DHCP options you can specify. For more information
* about the options, go to
* http://www.ietf.org/rfc/rfc2132.txt
*
*
* @param createDhcpOptionsRequest Container for the necessary parameters
* to execute the CreateDhcpOptions operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* CreateDhcpOptions service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future createDhcpOptionsAsync(
final CreateDhcpOptionsRequest createDhcpOptionsRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public CreateDhcpOptionsResult call() throws Exception {
CreateDhcpOptionsResult result;
try {
result = createDhcpOptions(createDhcpOptionsRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(createDhcpOptionsRequest, result);
return result;
}
});
}
/**
*
* Resets permission settings for the specified snapshot.
*
*
* @param resetSnapshotAttributeRequest Container for the necessary
* parameters to execute the ResetSnapshotAttribute operation on
* AmazonEC2.
*
* @return A Java Future object containing the response from the
* ResetSnapshotAttribute service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future resetSnapshotAttributeAsync(final ResetSnapshotAttributeRequest resetSnapshotAttributeRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
resetSnapshotAttribute(resetSnapshotAttributeRequest);
return null;
}
});
}
/**
*
* Resets permission settings for the specified snapshot.
*
*
* @param resetSnapshotAttributeRequest Container for the necessary
* parameters to execute the ResetSnapshotAttribute operation on
* AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* ResetSnapshotAttribute service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future resetSnapshotAttributeAsync(
final ResetSnapshotAttributeRequest resetSnapshotAttributeRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
resetSnapshotAttribute(resetSnapshotAttributeRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(resetSnapshotAttributeRequest, null);
return null;
}
});
}
/**
*
* Deletes a route from a route table in a VPC. For more information
* about route tables, go to
* Route Tables in the Amazon Virtual Private Cloud User Guide.
*
*
* @param deleteRouteRequest Container for the necessary parameters to
* execute the DeleteRoute operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* DeleteRoute service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deleteRouteAsync(final DeleteRouteRequest deleteRouteRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
deleteRoute(deleteRouteRequest);
return null;
}
});
}
/**
*
* Deletes a route from a route table in a VPC. For more information
* about route tables, go to
* Route Tables in the Amazon Virtual Private Cloud User Guide.
*
*
* @param deleteRouteRequest Container for the necessary parameters to
* execute the DeleteRoute operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DeleteRoute service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deleteRouteAsync(
final DeleteRouteRequest deleteRouteRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
deleteRoute(deleteRouteRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(deleteRouteRequest, null);
return null;
}
});
}
/**
*
* Gives you information about your Internet gateways. You can filter
* the results to return information only about Internet gateways that
* match criteria you specify. For example, you could get information
* only about gateways with particular tags. The Internet gateway must
* match at least one of the specified values for it to be included in
* the results.
*
*
* You can specify multiple filters (e.g., the Internet gateway is
* attached to a particular VPC and is tagged with a particular value).
* The result includes information for a particular Internet gateway only
* if the gateway matches all your filters. If there's no match, no
* special message is returned; the response is simply empty.
*
*
* You can use wildcards with the filter values: an asterisk matches
* zero or more characters, and ?
matches exactly one
* character. You can escape special characters using a backslash before
* the character. For example, a value of \*amazon\?\\
* searches for the literal string *amazon?\
.
*
*
*
* @param describeInternetGatewaysRequest Container for the necessary
* parameters to execute the DescribeInternetGateways operation on
* AmazonEC2.
*
* @return A Java Future object containing the response from the
* DescribeInternetGateways service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeInternetGatewaysAsync(final DescribeInternetGatewaysRequest describeInternetGatewaysRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeInternetGatewaysResult call() throws Exception {
return describeInternetGateways(describeInternetGatewaysRequest);
}
});
}
/**
*
* Gives you information about your Internet gateways. You can filter
* the results to return information only about Internet gateways that
* match criteria you specify. For example, you could get information
* only about gateways with particular tags. The Internet gateway must
* match at least one of the specified values for it to be included in
* the results.
*
*
* You can specify multiple filters (e.g., the Internet gateway is
* attached to a particular VPC and is tagged with a particular value).
* The result includes information for a particular Internet gateway only
* if the gateway matches all your filters. If there's no match, no
* special message is returned; the response is simply empty.
*
*
* You can use wildcards with the filter values: an asterisk matches
* zero or more characters, and ?
matches exactly one
* character. You can escape special characters using a backslash before
* the character. For example, a value of \*amazon\?\\
* searches for the literal string *amazon?\
.
*
*
*
* @param describeInternetGatewaysRequest Container for the necessary
* parameters to execute the DescribeInternetGateways operation on
* AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DescribeInternetGateways service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeInternetGatewaysAsync(
final DescribeInternetGatewaysRequest describeInternetGatewaysRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeInternetGatewaysResult call() throws Exception {
DescribeInternetGatewaysResult result;
try {
result = describeInternetGateways(describeInternetGatewaysRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(describeInternetGatewaysRequest, result);
return result;
}
});
}
/**
*
* @param importVolumeRequest Container for the necessary parameters to
* execute the ImportVolume operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* ImportVolume service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future importVolumeAsync(final ImportVolumeRequest importVolumeRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public ImportVolumeResult call() throws Exception {
return importVolume(importVolumeRequest);
}
});
}
/**
*
* @param importVolumeRequest Container for the necessary parameters to
* execute the ImportVolume operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* ImportVolume service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future importVolumeAsync(
final ImportVolumeRequest importVolumeRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public ImportVolumeResult call() throws Exception {
ImportVolumeResult result;
try {
result = importVolume(importVolumeRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(importVolumeRequest, result);
return result;
}
});
}
/**
*
* The DescribeSecurityGroups operation returns information about
* security groups that you own.
*
*
* If you specify security group names, information about those security
* group is returned. Otherwise, information for all security group is
* returned. If you specify a group that does not exist, a fault is
* returned.
*
*
* @param describeSecurityGroupsRequest Container for the necessary
* parameters to execute the DescribeSecurityGroups operation on
* AmazonEC2.
*
* @return A Java Future object containing the response from the
* DescribeSecurityGroups service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeSecurityGroupsAsync(final DescribeSecurityGroupsRequest describeSecurityGroupsRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeSecurityGroupsResult call() throws Exception {
return describeSecurityGroups(describeSecurityGroupsRequest);
}
});
}
/**
*
* The DescribeSecurityGroups operation returns information about
* security groups that you own.
*
*
* If you specify security group names, information about those security
* group is returned. Otherwise, information for all security group is
* returned. If you specify a group that does not exist, a fault is
* returned.
*
*
* @param describeSecurityGroupsRequest Container for the necessary
* parameters to execute the DescribeSecurityGroups operation on
* AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DescribeSecurityGroups service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeSecurityGroupsAsync(
final DescribeSecurityGroupsRequest describeSecurityGroupsRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeSecurityGroupsResult call() throws Exception {
DescribeSecurityGroupsResult result;
try {
result = describeSecurityGroups(describeSecurityGroupsRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(describeSecurityGroupsRequest, result);
return result;
}
});
}
/**
*
* Detaches a VPN gateway from a VPC. You do this if you're planning to
* turn off the VPC and not use it anymore. You can confirm a VPN gateway
* has been completely detached from a VPC by describing the VPN gateway
* (any attachments to the VPN gateway are also described).
*
*
* You must wait for the attachment's state to switch to detached before
* you can delete the VPC or attach a different VPC to the VPN gateway.
*
*
* @param detachVpnGatewayRequest Container for the necessary parameters
* to execute the DetachVpnGateway operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* DetachVpnGateway service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future detachVpnGatewayAsync(final DetachVpnGatewayRequest detachVpnGatewayRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
detachVpnGateway(detachVpnGatewayRequest);
return null;
}
});
}
/**
*
* Detaches a VPN gateway from a VPC. You do this if you're planning to
* turn off the VPC and not use it anymore. You can confirm a VPN gateway
* has been completely detached from a VPC by describing the VPN gateway
* (any attachments to the VPN gateway are also described).
*
*
* You must wait for the attachment's state to switch to detached before
* you can delete the VPC or attach a different VPC to the VPN gateway.
*
*
* @param detachVpnGatewayRequest Container for the necessary parameters
* to execute the DetachVpnGateway operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DetachVpnGateway service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future detachVpnGatewayAsync(
final DetachVpnGatewayRequest detachVpnGatewayRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
detachVpnGateway(detachVpnGatewayRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(detachVpnGatewayRequest, null);
return null;
}
});
}
/**
*
* The DeregisterImage operation deregisters an AMI. Once deregistered,
* instances of the AMI can no longer be launched.
*
*
* @param deregisterImageRequest Container for the necessary parameters
* to execute the DeregisterImage operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* DeregisterImage service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deregisterImageAsync(final DeregisterImageRequest deregisterImageRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
deregisterImage(deregisterImageRequest);
return null;
}
});
}
/**
*
* The DeregisterImage operation deregisters an AMI. Once deregistered,
* instances of the AMI can no longer be launched.
*
*
* @param deregisterImageRequest Container for the necessary parameters
* to execute the DeregisterImage operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DeregisterImage service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deregisterImageAsync(
final DeregisterImageRequest deregisterImageRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
deregisterImage(deregisterImageRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(deregisterImageRequest, null);
return null;
}
});
}
/**
*
* Describes the data feed for Spot Instances.
*
*
* For conceptual information about Spot Instances, refer to the Amazon
* Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud
* User Guide .
*
*
*
* @param describeSpotDatafeedSubscriptionRequest Container for the
* necessary parameters to execute the DescribeSpotDatafeedSubscription
* operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* DescribeSpotDatafeedSubscription service method, as returned by
* AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeSpotDatafeedSubscriptionAsync(final DescribeSpotDatafeedSubscriptionRequest describeSpotDatafeedSubscriptionRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeSpotDatafeedSubscriptionResult call() throws Exception {
return describeSpotDatafeedSubscription(describeSpotDatafeedSubscriptionRequest);
}
});
}
/**
*
* Describes the data feed for Spot Instances.
*
*
* For conceptual information about Spot Instances, refer to the Amazon
* Elastic Compute Cloud Developer Guide or Amazon Elastic Compute Cloud
* User Guide .
*
*
*
* @param describeSpotDatafeedSubscriptionRequest Container for the
* necessary parameters to execute the DescribeSpotDatafeedSubscription
* operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DescribeSpotDatafeedSubscription service method, as returned by
* AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeSpotDatafeedSubscriptionAsync(
final DescribeSpotDatafeedSubscriptionRequest describeSpotDatafeedSubscriptionRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeSpotDatafeedSubscriptionResult call() throws Exception {
DescribeSpotDatafeedSubscriptionResult result;
try {
result = describeSpotDatafeedSubscription(describeSpotDatafeedSubscriptionRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(describeSpotDatafeedSubscriptionRequest, result);
return result;
}
});
}
/**
*
* Deletes tags from the specified Amazon EC2 resources.
*
*
* @param deleteTagsRequest Container for the necessary parameters to
* execute the DeleteTags operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* DeleteTags service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deleteTagsAsync(final DeleteTagsRequest deleteTagsRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
deleteTags(deleteTagsRequest);
return null;
}
});
}
/**
*
* Deletes tags from the specified Amazon EC2 resources.
*
*
* @param deleteTagsRequest Container for the necessary parameters to
* execute the DeleteTags operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DeleteTags service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deleteTagsAsync(
final DeleteTagsRequest deleteTagsRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
deleteTags(deleteTagsRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(deleteTagsRequest, null);
return null;
}
});
}
/**
*
* Deletes a subnet from a VPC. You must terminate all running instances
* in the subnet before deleting it, otherwise Amazon VPC returns an
* error.
*
*
* @param deleteSubnetRequest Container for the necessary parameters to
* execute the DeleteSubnet operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* DeleteSubnet service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deleteSubnetAsync(final DeleteSubnetRequest deleteSubnetRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
deleteSubnet(deleteSubnetRequest);
return null;
}
});
}
/**
*
* Deletes a subnet from a VPC. You must terminate all running instances
* in the subnet before deleting it, otherwise Amazon VPC returns an
* error.
*
*
* @param deleteSubnetRequest Container for the necessary parameters to
* execute the DeleteSubnet operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DeleteSubnet service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deleteSubnetAsync(
final DeleteSubnetRequest deleteSubnetRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
deleteSubnet(deleteSubnetRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(deleteSubnetRequest, null);
return null;
}
});
}
/**
*
* @param describeAccountAttributesRequest Container for the necessary
* parameters to execute the DescribeAccountAttributes operation on
* AmazonEC2.
*
* @return A Java Future object containing the response from the
* DescribeAccountAttributes service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeAccountAttributesAsync(final DescribeAccountAttributesRequest describeAccountAttributesRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeAccountAttributesResult call() throws Exception {
return describeAccountAttributes(describeAccountAttributesRequest);
}
});
}
/**
*
* @param describeAccountAttributesRequest Container for the necessary
* parameters to execute the DescribeAccountAttributes operation on
* AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DescribeAccountAttributes service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeAccountAttributesAsync(
final DescribeAccountAttributesRequest describeAccountAttributesRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeAccountAttributesResult call() throws Exception {
DescribeAccountAttributesResult result;
try {
result = describeAccountAttributes(describeAccountAttributesRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(describeAccountAttributesRequest, result);
return result;
}
});
}
/**
*
* Creates a new VPN gateway. A VPN gateway is the VPC-side endpoint for
* your VPN connection. You can create a VPN gateway before creating the
* VPC itself.
*
*
* @param createVpnGatewayRequest Container for the necessary parameters
* to execute the CreateVpnGateway operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* CreateVpnGateway service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future createVpnGatewayAsync(final CreateVpnGatewayRequest createVpnGatewayRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public CreateVpnGatewayResult call() throws Exception {
return createVpnGateway(createVpnGatewayRequest);
}
});
}
/**
*
* Creates a new VPN gateway. A VPN gateway is the VPC-side endpoint for
* your VPN connection. You can create a VPN gateway before creating the
* VPC itself.
*
*
* @param createVpnGatewayRequest Container for the necessary parameters
* to execute the CreateVpnGateway operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* CreateVpnGateway service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future createVpnGatewayAsync(
final CreateVpnGatewayRequest createVpnGatewayRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public CreateVpnGatewayResult call() throws Exception {
CreateVpnGatewayResult result;
try {
result = createVpnGateway(createVpnGatewayRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(createVpnGatewayRequest, result);
return result;
}
});
}
/**
*
* Enable IO on the volume after an event has occured.
*
*
* @param enableVolumeIORequest Container for the necessary parameters to
* execute the EnableVolumeIO operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* EnableVolumeIO service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future enableVolumeIOAsync(final EnableVolumeIORequest enableVolumeIORequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
enableVolumeIO(enableVolumeIORequest);
return null;
}
});
}
/**
*
* Enable IO on the volume after an event has occured.
*
*
* @param enableVolumeIORequest Container for the necessary parameters to
* execute the EnableVolumeIO operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* EnableVolumeIO service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future enableVolumeIOAsync(
final EnableVolumeIORequest enableVolumeIORequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
enableVolumeIO(enableVolumeIORequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(enableVolumeIORequest, null);
return null;
}
});
}
/**
*
* Deletes a VPN gateway. Use this when you want to delete a VPC and all
* its associated components because you no longer need them. We
* recommend that before you delete a VPN gateway, you detach it from the
* VPC and delete the VPN connection. Note that you don't need to delete
* the VPN gateway if you just want to delete and re-create the VPN
* connection between your VPC and data center.
*
*
* @param deleteVpnGatewayRequest Container for the necessary parameters
* to execute the DeleteVpnGateway operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* DeleteVpnGateway service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deleteVpnGatewayAsync(final DeleteVpnGatewayRequest deleteVpnGatewayRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
deleteVpnGateway(deleteVpnGatewayRequest);
return null;
}
});
}
/**
*
* Deletes a VPN gateway. Use this when you want to delete a VPC and all
* its associated components because you no longer need them. We
* recommend that before you delete a VPN gateway, you detach it from the
* VPC and delete the VPN connection. Note that you don't need to delete
* the VPN gateway if you just want to delete and re-create the VPN
* connection between your VPC and data center.
*
*
* @param deleteVpnGatewayRequest Container for the necessary parameters
* to execute the DeleteVpnGateway operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DeleteVpnGateway service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deleteVpnGatewayAsync(
final DeleteVpnGatewayRequest deleteVpnGatewayRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
deleteVpnGateway(deleteVpnGatewayRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(deleteVpnGatewayRequest, null);
return null;
}
});
}
/**
*
* Attach a previously created volume to a running instance.
*
*
* @param attachVolumeRequest Container for the necessary parameters to
* execute the AttachVolume operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* AttachVolume service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future attachVolumeAsync(final AttachVolumeRequest attachVolumeRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public AttachVolumeResult call() throws Exception {
return attachVolume(attachVolumeRequest);
}
});
}
/**
*
* Attach a previously created volume to a running instance.
*
*
* @param attachVolumeRequest Container for the necessary parameters to
* execute the AttachVolume operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* AttachVolume service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future attachVolumeAsync(
final AttachVolumeRequest attachVolumeRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public AttachVolumeResult call() throws Exception {
AttachVolumeResult result;
try {
result = attachVolume(attachVolumeRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(attachVolumeRequest, result);
return result;
}
});
}
/**
*
* Provides details of a user's registered licenses. Zero or more IDs
* may be specified on the call. When one or more license IDs are
* specified, only data for the specified IDs are returned.
*
*
* @param describeLicensesRequest Container for the necessary parameters
* to execute the DescribeLicenses operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* DescribeLicenses service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeLicensesAsync(final DescribeLicensesRequest describeLicensesRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeLicensesResult call() throws Exception {
return describeLicenses(describeLicensesRequest);
}
});
}
/**
*
* Provides details of a user's registered licenses. Zero or more IDs
* may be specified on the call. When one or more license IDs are
* specified, only data for the specified IDs are returned.
*
*
* @param describeLicensesRequest Container for the necessary parameters
* to execute the DescribeLicenses operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DescribeLicenses service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeLicensesAsync(
final DescribeLicensesRequest describeLicensesRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeLicensesResult call() throws Exception {
DescribeLicensesResult result;
try {
result = describeLicenses(describeLicensesRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(describeLicensesRequest, result);
return result;
}
});
}
/**
*
* Describes the status of a volume.
*
*
* @param describeVolumeStatusRequest Container for the necessary
* parameters to execute the DescribeVolumeStatus operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* DescribeVolumeStatus service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeVolumeStatusAsync(final DescribeVolumeStatusRequest describeVolumeStatusRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeVolumeStatusResult call() throws Exception {
return describeVolumeStatus(describeVolumeStatusRequest);
}
});
}
/**
*
* Describes the status of a volume.
*
*
* @param describeVolumeStatusRequest Container for the necessary
* parameters to execute the DescribeVolumeStatus operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DescribeVolumeStatus service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeVolumeStatusAsync(
final DescribeVolumeStatusRequest describeVolumeStatusRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeVolumeStatusResult call() throws Exception {
DescribeVolumeStatusResult result;
try {
result = describeVolumeStatus(describeVolumeStatusRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(describeVolumeStatusRequest, result);
return result;
}
});
}
/**
*
* Activates a specific number of licenses for a 90-day period.
* Activations can be done against a specific license ID.
*
*
* @param activateLicenseRequest Container for the necessary parameters
* to execute the ActivateLicense operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* ActivateLicense service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future activateLicenseAsync(final ActivateLicenseRequest activateLicenseRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
activateLicense(activateLicenseRequest);
return null;
}
});
}
/**
*
* Activates a specific number of licenses for a 90-day period.
* Activations can be done against a specific license ID.
*
*
* @param activateLicenseRequest Container for the necessary parameters
* to execute the ActivateLicense operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* ActivateLicense service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future activateLicenseAsync(
final ActivateLicenseRequest activateLicenseRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
activateLicense(activateLicenseRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(activateLicenseRequest, null);
return null;
}
});
}
/**
*
* The ResetImageAttribute operation resets an attribute of an AMI to
* its default value.
*
*
* NOTE: The productCodes attribute cannot be reset.
*
*
* @param resetImageAttributeRequest Container for the necessary
* parameters to execute the ResetImageAttribute operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* ResetImageAttribute service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future resetImageAttributeAsync(final ResetImageAttributeRequest resetImageAttributeRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
resetImageAttribute(resetImageAttributeRequest);
return null;
}
});
}
/**
*
* The ResetImageAttribute operation resets an attribute of an AMI to
* its default value.
*
*
* NOTE: The productCodes attribute cannot be reset.
*
*
* @param resetImageAttributeRequest Container for the necessary
* parameters to execute the ResetImageAttribute operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* ResetImageAttribute service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future resetImageAttributeAsync(
final ResetImageAttributeRequest resetImageAttributeRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
resetImageAttribute(resetImageAttributeRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(resetImageAttributeRequest, null);
return null;
}
});
}
/**
*
* Gives you information about your VPN connections.
*
*
* IMPORTANT: We strongly recommend you use HTTPS when calling
* this operation because the response contains sensitive cryptographic
* information for configuring your customer gateway. You can filter the
* results to return information only about VPN connections that match
* criteria you specify. For example, you could ask to get information
* about a particular VPN connection (or all) only if the VPN's state is
* pending or available. You can specify multiple filters (e.g., the VPN
* connection is associated with a particular VPN gateway, and the
* gateway's state is pending or available). The result includes
* information for a particular VPN connection only if the VPN connection
* matches all your filters. If there's no match, no special message is
* returned; the response is simply empty. The following table shows the
* available filters.
*
*
* @param describeVpnConnectionsRequest Container for the necessary
* parameters to execute the DescribeVpnConnections operation on
* AmazonEC2.
*
* @return A Java Future object containing the response from the
* DescribeVpnConnections service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeVpnConnectionsAsync(final DescribeVpnConnectionsRequest describeVpnConnectionsRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeVpnConnectionsResult call() throws Exception {
return describeVpnConnections(describeVpnConnectionsRequest);
}
});
}
/**
*
* Gives you information about your VPN connections.
*
*
* IMPORTANT: We strongly recommend you use HTTPS when calling
* this operation because the response contains sensitive cryptographic
* information for configuring your customer gateway. You can filter the
* results to return information only about VPN connections that match
* criteria you specify. For example, you could ask to get information
* about a particular VPN connection (or all) only if the VPN's state is
* pending or available. You can specify multiple filters (e.g., the VPN
* connection is associated with a particular VPN gateway, and the
* gateway's state is pending or available). The result includes
* information for a particular VPN connection only if the VPN connection
* matches all your filters. If there's no match, no special message is
* returned; the response is simply empty. The following table shows the
* available filters.
*
*
* @param describeVpnConnectionsRequest Container for the necessary
* parameters to execute the DescribeVpnConnections operation on
* AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DescribeVpnConnections service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeVpnConnectionsAsync(
final DescribeVpnConnectionsRequest describeVpnConnectionsRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeVpnConnectionsResult call() throws Exception {
DescribeVpnConnectionsResult result;
try {
result = describeVpnConnections(describeVpnConnectionsRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(describeVpnConnectionsRequest, result);
return result;
}
});
}
/**
*
* @param enableVgwRoutePropagationRequest Container for the necessary
* parameters to execute the EnableVgwRoutePropagation operation on
* AmazonEC2.
*
* @return A Java Future object containing the response from the
* EnableVgwRoutePropagation service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future enableVgwRoutePropagationAsync(final EnableVgwRoutePropagationRequest enableVgwRoutePropagationRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
enableVgwRoutePropagation(enableVgwRoutePropagationRequest);
return null;
}
});
}
/**
*
* @param enableVgwRoutePropagationRequest Container for the necessary
* parameters to execute the EnableVgwRoutePropagation operation on
* AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* EnableVgwRoutePropagation service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future enableVgwRoutePropagationAsync(
final EnableVgwRoutePropagationRequest enableVgwRoutePropagationRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
enableVgwRoutePropagation(enableVgwRoutePropagationRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(enableVgwRoutePropagationRequest, null);
return null;
}
});
}
/**
*
* Create a snapshot of the volume identified by volume ID. A volume
* does not have to be detached at the time the snapshot is taken.
*
*
* NOTE: Snapshot creation requires that the system is in a
* consistent state. For instance, this means that if taking a snapshot
* of a database, the tables must be read-only locked to ensure that the
* snapshot will not contain a corrupted version of the database.
* Therefore, be careful when using this API to ensure that the system
* remains in the consistent state until the create snapshot status has
* returned.
*
*
* @param createSnapshotRequest Container for the necessary parameters to
* execute the CreateSnapshot operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* CreateSnapshot service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future createSnapshotAsync(final CreateSnapshotRequest createSnapshotRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public CreateSnapshotResult call() throws Exception {
return createSnapshot(createSnapshotRequest);
}
});
}
/**
*
* Create a snapshot of the volume identified by volume ID. A volume
* does not have to be detached at the time the snapshot is taken.
*
*
* NOTE: Snapshot creation requires that the system is in a
* consistent state. For instance, this means that if taking a snapshot
* of a database, the tables must be read-only locked to ensure that the
* snapshot will not contain a corrupted version of the database.
* Therefore, be careful when using this API to ensure that the system
* remains in the consistent state until the create snapshot status has
* returned.
*
*
* @param createSnapshotRequest Container for the necessary parameters to
* execute the CreateSnapshot operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* CreateSnapshot service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future createSnapshotAsync(
final CreateSnapshotRequest createSnapshotRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public CreateSnapshotResult call() throws Exception {
CreateSnapshotResult result;
try {
result = createSnapshot(createSnapshotRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(createSnapshotRequest, result);
return result;
}
});
}
/**
*
* Deletes a previously created volume. Once successfully deleted, a
* new volume can be created with the same name.
*
*
* @param deleteVolumeRequest Container for the necessary parameters to
* execute the DeleteVolume operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* DeleteVolume service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deleteVolumeAsync(final DeleteVolumeRequest deleteVolumeRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
deleteVolume(deleteVolumeRequest);
return null;
}
});
}
/**
*
* Deletes a previously created volume. Once successfully deleted, a
* new volume can be created with the same name.
*
*
* @param deleteVolumeRequest Container for the necessary parameters to
* execute the DeleteVolume operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DeleteVolume service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future deleteVolumeAsync(
final DeleteVolumeRequest deleteVolumeRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
deleteVolume(deleteVolumeRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(deleteVolumeRequest, null);
return null;
}
});
}
/**
*
* @param createNetworkInterfaceRequest Container for the necessary
* parameters to execute the CreateNetworkInterface operation on
* AmazonEC2.
*
* @return A Java Future object containing the response from the
* CreateNetworkInterface service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future createNetworkInterfaceAsync(final CreateNetworkInterfaceRequest createNetworkInterfaceRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public CreateNetworkInterfaceResult call() throws Exception {
return createNetworkInterface(createNetworkInterfaceRequest);
}
});
}
/**
*
* @param createNetworkInterfaceRequest Container for the necessary
* parameters to execute the CreateNetworkInterface operation on
* AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* CreateNetworkInterface service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future createNetworkInterfaceAsync(
final CreateNetworkInterfaceRequest createNetworkInterfaceRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public CreateNetworkInterfaceResult call() throws Exception {
CreateNetworkInterfaceResult result;
try {
result = createNetworkInterface(createNetworkInterfaceRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(createNetworkInterfaceRequest, result);
return result;
}
});
}
/**
*
* Gives you information about your VPCs. You can filter the results to
* return information only about VPCs that match criteria you specify.
*
*
* For example, you could ask to get information about a particular VPC
* or VPCs (or all your VPCs) only if the VPC's state is available. You
* can specify multiple filters (e.g., the VPC uses one of several sets
* of DHCP options, and the VPC's state is available). The result
* includes information for a particular VPC only if the VPC matches all
* your filters.
*
*
* If there's no match, no special message is returned; the response is
* simply empty. The following table shows the available filters.
*
*
* @param describeVpcsRequest Container for the necessary parameters to
* execute the DescribeVpcs operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* DescribeVpcs service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeVpcsAsync(final DescribeVpcsRequest describeVpcsRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeVpcsResult call() throws Exception {
return describeVpcs(describeVpcsRequest);
}
});
}
/**
*
* Gives you information about your VPCs. You can filter the results to
* return information only about VPCs that match criteria you specify.
*
*
* For example, you could ask to get information about a particular VPC
* or VPCs (or all your VPCs) only if the VPC's state is available. You
* can specify multiple filters (e.g., the VPC uses one of several sets
* of DHCP options, and the VPC's state is available). The result
* includes information for a particular VPC only if the VPC matches all
* your filters.
*
*
* If there's no match, no special message is returned; the response is
* simply empty. The following table shows the available filters.
*
*
* @param describeVpcsRequest Container for the necessary parameters to
* execute the DescribeVpcs operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* DescribeVpcs service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future describeVpcsAsync(
final DescribeVpcsRequest describeVpcsRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public DescribeVpcsResult call() throws Exception {
DescribeVpcsResult result;
try {
result = describeVpcs(describeVpcsRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(describeVpcsRequest, result);
return result;
}
});
}
/**
*
* @param unassignPrivateIpAddressesRequest Container for the necessary
* parameters to execute the UnassignPrivateIpAddresses operation on
* AmazonEC2.
*
* @return A Java Future object containing the response from the
* UnassignPrivateIpAddresses service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future unassignPrivateIpAddressesAsync(final UnassignPrivateIpAddressesRequest unassignPrivateIpAddressesRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
unassignPrivateIpAddresses(unassignPrivateIpAddressesRequest);
return null;
}
});
}
/**
*
* @param unassignPrivateIpAddressesRequest Container for the necessary
* parameters to execute the UnassignPrivateIpAddresses operation on
* AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* UnassignPrivateIpAddresses service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future unassignPrivateIpAddressesAsync(
final UnassignPrivateIpAddressesRequest unassignPrivateIpAddressesRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
unassignPrivateIpAddresses(unassignPrivateIpAddressesRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(unassignPrivateIpAddressesRequest, null);
return null;
}
});
}
/**
*
* @param cancelConversionTaskRequest Container for the necessary
* parameters to execute the CancelConversionTask operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* CancelConversionTask service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future cancelConversionTaskAsync(final CancelConversionTaskRequest cancelConversionTaskRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
cancelConversionTask(cancelConversionTaskRequest);
return null;
}
});
}
/**
*
* @param cancelConversionTaskRequest Container for the necessary
* parameters to execute the CancelConversionTask operation on AmazonEC2.
* @param asyncHandler Asynchronous callback handler for events in the
* life-cycle of the request. Users could provide the implementation of
* the four callback methods in this interface to process the operation
* result or handle the exception.
*
* @return A Java Future object containing the response from the
* CancelConversionTask service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future cancelConversionTaskAsync(
final CancelConversionTaskRequest cancelConversionTaskRequest,
final AsyncHandler asyncHandler)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable() {
public Void call() throws Exception {
try {
cancelConversionTask(cancelConversionTaskRequest);
} catch (Exception ex) {
asyncHandler.onError(ex);
throw ex;
}
asyncHandler.onSuccess(cancelConversionTaskRequest, null);
return null;
}
});
}
/**
*
* The AssociateAddress operation associates an elastic IP address with
* an instance.
*
*
* If the IP address is currently assigned to another instance, the IP
* address is assigned to the new instance. This is an idempotent
* operation. If you enter it more than once, Amazon EC2 does not return
* an error.
*
*
* @param associateAddressRequest Container for the necessary parameters
* to execute the AssociateAddress operation on AmazonEC2.
*
* @return A Java Future object containing the response from the
* AssociateAddress service method, as returned by AmazonEC2.
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonEC2 indicating
* either a problem with the data in the request, or a server side issue.
*/
public Future associateAddressAsync(final AssociateAddressRequest associateAddressRequest)
throws AmazonServiceException, AmazonClientException {
return executorService.submit(new Callable