All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.autoscaling.AmazonAutoScalingAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Android SDK for Auto Scaling module holds the client classes that are used for communicating with Auto Scaling Service

There is a newer version: 2.2.19
Show newest version
/*
 * Copyright 2010-2016 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.autoscaling;

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.autoscaling.model.*;

/**
 * Asynchronous client for accessing AmazonAutoScaling.
 * 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.
 * Auto Scaling 

* Auto Scaling is designed to automatically launch or terminate EC2 * instances based on user-defined policies, schedules, and health * checks. Use this service in conjunction with the Amazon CloudWatch and * Elastic Load Balancing services. *

*/ public class AmazonAutoScalingAsyncClient extends AmazonAutoScalingClient implements AmazonAutoScalingAsync { /** * Executor service for executing asynchronous requests. */ private ExecutorService executorService; private static final int DEFAULT_THREAD_POOL_SIZE = 10; /** * Constructs a new asynchronous client to invoke service methods on * AmazonAutoScaling. 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 DefaultAWSCredentialsProviderChain */ @Deprecated public AmazonAutoScalingAsyncClient() { this(new DefaultAWSCredentialsProviderChain()); } /** * Constructs a new asynchronous client to invoke service methods on * AmazonAutoScaling. 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 AmazonAutoScaling * (ex: proxy settings, retry counts, etc.). * * @see DefaultAWSCredentialsProviderChain */ @Deprecated public AmazonAutoScalingAsyncClient(ClientConfiguration clientConfiguration) { this(new DefaultAWSCredentialsProviderChain(), clientConfiguration, Executors.newFixedThreadPool(clientConfiguration.getMaxConnections())); } /** * Constructs a new asynchronous client to invoke service methods on * AmazonAutoScaling using the specified AWS account credentials. * Default client settings will be used, and a fixed size 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 AmazonAutoScalingAsyncClient(AWSCredentials awsCredentials) { this(awsCredentials, Executors.newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE)); } /** * Constructs a new asynchronous client to invoke service methods on * AmazonAutoScaling 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 AmazonAutoScalingAsyncClient(AWSCredentials awsCredentials, ExecutorService executorService) { super(awsCredentials); this.executorService = executorService; } /** * Constructs a new asynchronous client to invoke service methods on * AmazonAutoScaling 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 AmazonAutoScalingAsyncClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration, ExecutorService executorService) { super(awsCredentials, clientConfiguration); this.executorService = executorService; } /** * Constructs a new asynchronous client to invoke service methods on * AmazonAutoScaling using the specified AWS account credentials provider. * Default client settings will be used, and a fixed size 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 AmazonAutoScalingAsyncClient(AWSCredentialsProvider awsCredentialsProvider) { this(awsCredentialsProvider, Executors.newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE)); } /** * Constructs a new asynchronous client to invoke service methods on * AmazonAutoScaling 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 AmazonAutoScalingAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ExecutorService executorService) { this(awsCredentialsProvider, new ClientConfiguration(), executorService); } /** * Constructs a new asynchronous client to invoke service methods on * AmazonAutoScaling 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 AmazonAutoScalingAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) { this(awsCredentialsProvider, clientConfiguration, Executors.newFixedThreadPool(clientConfiguration.getMaxConnections())); } /** * Constructs a new asynchronous client to invoke service methods on * AmazonAutoScaling 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 AmazonAutoScalingAsyncClient(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() followed by * getExecutorService().awaitTermination() prior to calling this method. */ @Override public void shutdown() { super.shutdown(); executorService.shutdownNow(); } /** *

* Creates or updates a lifecycle hook for the specified Auto Scaling * Group. *

*

* A lifecycle hook tells Auto Scaling that you want to perform an * action on an instance that is not actively in service; for example, * either when the instance launches or before the instance terminates. *

*

* This operation is a part of the basic sequence for adding a lifecycle * hook to an Auto Scaling group: *

*
  1. Create a notification target. A target can be either an * Amazon SQS queue or an Amazon SNS topic.
  2. *
  3. Create an IAM role. This role allows Auto Scaling to publish * lifecycle notifications to the designated SQS queue or SNS topic.
  4. *
  5. Create the lifecycle hook. You can create a hook that acts * when instances launch or when instances terminate.
  6. *
  7. If necessary, record the lifecycle action heartbeat to keep the * instance in a pending state.
  8. *
  9. Complete the lifecycle action.
  10. *

* For more information, see * Auto Scaling Pending State and Auto Scaling Terminating State * in the Auto Scaling Developer Guide . *

*

* If you exceed your maximum limit of lifecycle hooks, which by default * is 50 per region, the call fails. For information about updating this * limit, see * AWS Service Limits * in the Amazon Web Services General Reference . *

* * @param putLifecycleHookRequest Container for the necessary parameters * to execute the PutLifecycleHook operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * PutLifecycleHook service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future putLifecycleHookAsync(final PutLifecycleHookRequest putLifecycleHookRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public PutLifecycleHookResult call() throws Exception { return putLifecycleHook(putLifecycleHookRequest); } }); } /** *

* Creates or updates a lifecycle hook for the specified Auto Scaling * Group. *

*

* A lifecycle hook tells Auto Scaling that you want to perform an * action on an instance that is not actively in service; for example, * either when the instance launches or before the instance terminates. *

*

* This operation is a part of the basic sequence for adding a lifecycle * hook to an Auto Scaling group: *

*
  1. Create a notification target. A target can be either an * Amazon SQS queue or an Amazon SNS topic.
  2. *
  3. Create an IAM role. This role allows Auto Scaling to publish * lifecycle notifications to the designated SQS queue or SNS topic.
  4. *
  5. Create the lifecycle hook. You can create a hook that acts * when instances launch or when instances terminate.
  6. *
  7. If necessary, record the lifecycle action heartbeat to keep the * instance in a pending state.
  8. *
  9. Complete the lifecycle action.
  10. *

* For more information, see * Auto Scaling Pending State and Auto Scaling Terminating State * in the Auto Scaling Developer Guide . *

*

* If you exceed your maximum limit of lifecycle hooks, which by default * is 50 per region, the call fails. For information about updating this * limit, see * AWS Service Limits * in the Amazon Web Services General Reference . *

* * @param putLifecycleHookRequest Container for the necessary parameters * to execute the PutLifecycleHook operation on AmazonAutoScaling. * @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 * PutLifecycleHook service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future putLifecycleHookAsync( final PutLifecycleHookRequest putLifecycleHookRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public PutLifecycleHookResult call() throws Exception { PutLifecycleHookResult result; try { result = putLifecycleHook(putLifecycleHookRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(putLifecycleHookRequest, result); return result; } }); } /** *

* Describes the current Auto Scaling resource limits for your AWS * account. *

*

* For information about requesting an increase in these limits, see * AWS Service Limits * in the Amazon Web Services General Reference . *

* * @param describeAccountLimitsRequest Container for the necessary * parameters to execute the DescribeAccountLimits operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * DescribeAccountLimits service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeAccountLimitsAsync(final DescribeAccountLimitsRequest describeAccountLimitsRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeAccountLimitsResult call() throws Exception { return describeAccountLimits(describeAccountLimitsRequest); } }); } /** *

* Describes the current Auto Scaling resource limits for your AWS * account. *

*

* For information about requesting an increase in these limits, see * AWS Service Limits * in the Amazon Web Services General Reference . *

* * @param describeAccountLimitsRequest Container for the necessary * parameters to execute the DescribeAccountLimits operation on * AmazonAutoScaling. * @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 * DescribeAccountLimits service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeAccountLimitsAsync( final DescribeAccountLimitsRequest describeAccountLimitsRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeAccountLimitsResult call() throws Exception { DescribeAccountLimitsResult result; try { result = describeAccountLimits(describeAccountLimitsRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(describeAccountLimitsRequest, result); return result; } }); } /** *

* Describes one or more Auto Scaling groups. If a list of names is not * provided, the call describes all Auto Scaling groups. *

* * @param describeAutoScalingGroupsRequest Container for the necessary * parameters to execute the DescribeAutoScalingGroups operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * DescribeAutoScalingGroups service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeAutoScalingGroupsAsync(final DescribeAutoScalingGroupsRequest describeAutoScalingGroupsRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeAutoScalingGroupsResult call() throws Exception { return describeAutoScalingGroups(describeAutoScalingGroupsRequest); } }); } /** *

* Describes one or more Auto Scaling groups. If a list of names is not * provided, the call describes all Auto Scaling groups. *

* * @param describeAutoScalingGroupsRequest Container for the necessary * parameters to execute the DescribeAutoScalingGroups operation on * AmazonAutoScaling. * @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 * DescribeAutoScalingGroups service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeAutoScalingGroupsAsync( final DescribeAutoScalingGroupsRequest describeAutoScalingGroupsRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeAutoScalingGroupsResult call() throws Exception { DescribeAutoScalingGroupsResult result; try { result = describeAutoScalingGroups(describeAutoScalingGroupsRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(describeAutoScalingGroupsRequest, result); return result; } }); } /** *

* Describes the policies for the specified Auto Scaling group. *

* * @param describePoliciesRequest Container for the necessary parameters * to execute the DescribePolicies operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * DescribePolicies service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describePoliciesAsync(final DescribePoliciesRequest describePoliciesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribePoliciesResult call() throws Exception { return describePolicies(describePoliciesRequest); } }); } /** *

* Describes the policies for the specified Auto Scaling group. *

* * @param describePoliciesRequest Container for the necessary parameters * to execute the DescribePolicies operation on AmazonAutoScaling. * @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 * DescribePolicies service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describePoliciesAsync( final DescribePoliciesRequest describePoliciesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribePoliciesResult call() throws Exception { DescribePoliciesResult result; try { result = describePolicies(describePoliciesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(describePoliciesRequest, result); return result; } }); } /** *

* Creates an Auto Scaling group with the specified name and attributes. *

*

* If you exceed your maximum limit of Auto Scaling groups, which by * default is 20 per region, the call fails. For information about * viewing and updating this limit, see DescribeAccountLimits. *

*

* For more information, see * Auto Scaling Groups * in the Auto Scaling Developer Guide . *

* * @param createAutoScalingGroupRequest Container for the necessary * parameters to execute the CreateAutoScalingGroup operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * CreateAutoScalingGroup service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future createAutoScalingGroupAsync(final CreateAutoScalingGroupRequest createAutoScalingGroupRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { createAutoScalingGroup(createAutoScalingGroupRequest); return null; } }); } /** *

* Creates an Auto Scaling group with the specified name and attributes. *

*

* If you exceed your maximum limit of Auto Scaling groups, which by * default is 20 per region, the call fails. For information about * viewing and updating this limit, see DescribeAccountLimits. *

*

* For more information, see * Auto Scaling Groups * in the Auto Scaling Developer Guide . *

* * @param createAutoScalingGroupRequest Container for the necessary * parameters to execute the CreateAutoScalingGroup operation on * AmazonAutoScaling. * @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 * CreateAutoScalingGroup service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future createAutoScalingGroupAsync( final CreateAutoScalingGroupRequest createAutoScalingGroupRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { createAutoScalingGroup(createAutoScalingGroupRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(createAutoScalingGroupRequest, null); return null; } }); } /** *

* Attaches one or more load balancers to the specified Auto Scaling * group. *

*

* To describe the load balancers for an Auto Scaling group, use * DescribeLoadBalancers. To detach the load balancer from the Auto * Scaling group, use DetachLoadBalancers. *

*

* For more information, see * Attach a Load Balancer to Your Auto Scaling Group * in the Auto Scaling Developer Guide . *

* * @param attachLoadBalancersRequest Container for the necessary * parameters to execute the AttachLoadBalancers operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * AttachLoadBalancers service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future attachLoadBalancersAsync(final AttachLoadBalancersRequest attachLoadBalancersRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public AttachLoadBalancersResult call() throws Exception { return attachLoadBalancers(attachLoadBalancersRequest); } }); } /** *

* Attaches one or more load balancers to the specified Auto Scaling * group. *

*

* To describe the load balancers for an Auto Scaling group, use * DescribeLoadBalancers. To detach the load balancer from the Auto * Scaling group, use DetachLoadBalancers. *

*

* For more information, see * Attach a Load Balancer to Your Auto Scaling Group * in the Auto Scaling Developer Guide . *

* * @param attachLoadBalancersRequest Container for the necessary * parameters to execute the AttachLoadBalancers operation on * AmazonAutoScaling. * @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 * AttachLoadBalancers service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future attachLoadBalancersAsync( final AttachLoadBalancersRequest attachLoadBalancersRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public AttachLoadBalancersResult call() throws Exception { AttachLoadBalancersResult result; try { result = attachLoadBalancers(attachLoadBalancersRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(attachLoadBalancersRequest, result); return result; } }); } /** *

* Deletes the specified notification. *

* * @param deleteNotificationConfigurationRequest Container for the * necessary parameters to execute the DeleteNotificationConfiguration * operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * DeleteNotificationConfiguration service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future deleteNotificationConfigurationAsync(final DeleteNotificationConfigurationRequest deleteNotificationConfigurationRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { deleteNotificationConfiguration(deleteNotificationConfigurationRequest); return null; } }); } /** *

* Deletes the specified notification. *

* * @param deleteNotificationConfigurationRequest Container for the * necessary parameters to execute the DeleteNotificationConfiguration * operation on AmazonAutoScaling. * @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 * DeleteNotificationConfiguration service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future deleteNotificationConfigurationAsync( final DeleteNotificationConfigurationRequest deleteNotificationConfigurationRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { deleteNotificationConfiguration(deleteNotificationConfigurationRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(deleteNotificationConfigurationRequest, null); return null; } }); } /** *

* Describes the specified tags. *

*

* You can use filters to limit the results. For example, you can query * for the tags for a specific Auto Scaling group. You can specify * multiple values for a filter. A tag must match at least one of the * specified values for it to be included in the results. *

*

* You can also specify multiple filters. The result includes * information for a particular tag only if it matches all the filters. * If there's no match, no special message is returned. *

* * @param describeTagsRequest Container for the necessary parameters to * execute the DescribeTags operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * DescribeTags service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeTagsAsync(final DescribeTagsRequest describeTagsRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeTagsResult call() throws Exception { return describeTags(describeTagsRequest); } }); } /** *

* Describes the specified tags. *

*

* You can use filters to limit the results. For example, you can query * for the tags for a specific Auto Scaling group. You can specify * multiple values for a filter. A tag must match at least one of the * specified values for it to be included in the results. *

*

* You can also specify multiple filters. The result includes * information for a particular tag only if it matches all the filters. * If there's no match, no special message is returned. *

* * @param describeTagsRequest Container for the necessary parameters to * execute the DescribeTags operation on AmazonAutoScaling. * @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 * DescribeTags service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeTagsAsync( final DescribeTagsRequest describeTagsRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeTagsResult call() throws Exception { DescribeTagsResult result; try { result = describeTags(describeTagsRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(describeTagsRequest, result); return result; } }); } /** *

* Configures an Auto Scaling group to send notifications when specified * events take place. Subscribers to this topic can have messages for * events delivered to an endpoint such as a web server or email address. *

*

* For more information see * Getting Notifications When Your Auto Scaling Group Changes * in the Auto Scaling Developer Guide . *

*

* This configuration overwrites an existing configuration. *

* * @param putNotificationConfigurationRequest Container for the necessary * parameters to execute the PutNotificationConfiguration operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * PutNotificationConfiguration service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future putNotificationConfigurationAsync(final PutNotificationConfigurationRequest putNotificationConfigurationRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { putNotificationConfiguration(putNotificationConfigurationRequest); return null; } }); } /** *

* Configures an Auto Scaling group to send notifications when specified * events take place. Subscribers to this topic can have messages for * events delivered to an endpoint such as a web server or email address. *

*

* For more information see * Getting Notifications When Your Auto Scaling Group Changes * in the Auto Scaling Developer Guide . *

*

* This configuration overwrites an existing configuration. *

* * @param putNotificationConfigurationRequest Container for the necessary * parameters to execute the PutNotificationConfiguration operation on * AmazonAutoScaling. * @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 * PutNotificationConfiguration service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future putNotificationConfigurationAsync( final PutNotificationConfigurationRequest putNotificationConfigurationRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { putNotificationConfiguration(putNotificationConfigurationRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(putNotificationConfigurationRequest, null); return null; } }); } /** *

* Describes the available types of lifecycle hooks. *

* * @param describeLifecycleHookTypesRequest Container for the necessary * parameters to execute the DescribeLifecycleHookTypes operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * DescribeLifecycleHookTypes service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeLifecycleHookTypesAsync(final DescribeLifecycleHookTypesRequest describeLifecycleHookTypesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeLifecycleHookTypesResult call() throws Exception { return describeLifecycleHookTypes(describeLifecycleHookTypesRequest); } }); } /** *

* Describes the available types of lifecycle hooks. *

* * @param describeLifecycleHookTypesRequest Container for the necessary * parameters to execute the DescribeLifecycleHookTypes operation on * AmazonAutoScaling. * @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 * DescribeLifecycleHookTypes service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeLifecycleHookTypesAsync( final DescribeLifecycleHookTypesRequest describeLifecycleHookTypesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeLifecycleHookTypesResult call() throws Exception { DescribeLifecycleHookTypesResult result; try { result = describeLifecycleHookTypes(describeLifecycleHookTypesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(describeLifecycleHookTypesRequest, result); return result; } }); } /** *

* Removes one or more instances from the specified Auto Scaling group. *

*

* After the instances are detached, you can manage them independently * from the rest of the Auto Scaling group. *

*

* If you do not specify the option to decrement the desired capacity, * Auto Scaling launches instances to replace the ones that are detached. *

*

* For more information, see * Detach EC2 Instances from Your Auto Scaling Group * in the Auto Scaling Developer Guide . *

* * @param detachInstancesRequest Container for the necessary parameters * to execute the DetachInstances operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * DetachInstances service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future detachInstancesAsync(final DetachInstancesRequest detachInstancesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DetachInstancesResult call() throws Exception { return detachInstances(detachInstancesRequest); } }); } /** *

* Removes one or more instances from the specified Auto Scaling group. *

*

* After the instances are detached, you can manage them independently * from the rest of the Auto Scaling group. *

*

* If you do not specify the option to decrement the desired capacity, * Auto Scaling launches instances to replace the ones that are detached. *

*

* For more information, see * Detach EC2 Instances from Your Auto Scaling Group * in the Auto Scaling Developer Guide . *

* * @param detachInstancesRequest Container for the necessary parameters * to execute the DetachInstances operation on AmazonAutoScaling. * @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 * DetachInstances service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future detachInstancesAsync( final DetachInstancesRequest detachInstancesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DetachInstancesResult call() throws Exception { DetachInstancesResult result; try { result = detachInstances(detachInstancesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(detachInstancesRequest, result); return result; } }); } /** *

* Deletes the specified scheduled action. *

* * @param deleteScheduledActionRequest Container for the necessary * parameters to execute the DeleteScheduledAction operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * DeleteScheduledAction service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future deleteScheduledActionAsync(final DeleteScheduledActionRequest deleteScheduledActionRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { deleteScheduledAction(deleteScheduledActionRequest); return null; } }); } /** *

* Deletes the specified scheduled action. *

* * @param deleteScheduledActionRequest Container for the necessary * parameters to execute the DeleteScheduledAction operation on * AmazonAutoScaling. * @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 * DeleteScheduledAction service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future deleteScheduledActionAsync( final DeleteScheduledActionRequest deleteScheduledActionRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { deleteScheduledAction(deleteScheduledActionRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(deleteScheduledActionRequest, null); return null; } }); } /** *

* Enables monitoring of the specified metrics for the specified Auto * Scaling group. *

*

* You can only enable metrics collection if * InstanceMonitoring in the launch configuration for the * group is set to True . *

* * @param enableMetricsCollectionRequest Container for the necessary * parameters to execute the EnableMetricsCollection operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * EnableMetricsCollection service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future enableMetricsCollectionAsync(final EnableMetricsCollectionRequest enableMetricsCollectionRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { enableMetricsCollection(enableMetricsCollectionRequest); return null; } }); } /** *

* Enables monitoring of the specified metrics for the specified Auto * Scaling group. *

*

* You can only enable metrics collection if * InstanceMonitoring in the launch configuration for the * group is set to True . *

* * @param enableMetricsCollectionRequest Container for the necessary * parameters to execute the EnableMetricsCollection operation on * AmazonAutoScaling. * @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 * EnableMetricsCollection service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future enableMetricsCollectionAsync( final EnableMetricsCollectionRequest enableMetricsCollectionRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { enableMetricsCollection(enableMetricsCollectionRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(enableMetricsCollectionRequest, null); return null; } }); } /** *

* Creates a launch configuration. *

*

* If you exceed your maximum limit of launch configurations, which by * default is 100 per region, the call fails. For information about * viewing and updating this limit, see DescribeAccountLimits. *

*

* For more information, see * Launch Configurations * in the Auto Scaling Developer Guide . *

* * @param createLaunchConfigurationRequest Container for the necessary * parameters to execute the CreateLaunchConfiguration operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * CreateLaunchConfiguration service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future createLaunchConfigurationAsync(final CreateLaunchConfigurationRequest createLaunchConfigurationRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { createLaunchConfiguration(createLaunchConfigurationRequest); return null; } }); } /** *

* Creates a launch configuration. *

*

* If you exceed your maximum limit of launch configurations, which by * default is 100 per region, the call fails. For information about * viewing and updating this limit, see DescribeAccountLimits. *

*

* For more information, see * Launch Configurations * in the Auto Scaling Developer Guide . *

* * @param createLaunchConfigurationRequest Container for the necessary * parameters to execute the CreateLaunchConfiguration operation on * AmazonAutoScaling. * @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 * CreateLaunchConfiguration service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future createLaunchConfigurationAsync( final CreateLaunchConfigurationRequest createLaunchConfigurationRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { createLaunchConfiguration(createLaunchConfigurationRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(createLaunchConfigurationRequest, null); return null; } }); } /** *

* Describes one or more Auto Scaling instances. If a list is not * provided, the call describes all instances. *

* * @param describeAutoScalingInstancesRequest Container for the necessary * parameters to execute the DescribeAutoScalingInstances operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * DescribeAutoScalingInstances service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeAutoScalingInstancesAsync(final DescribeAutoScalingInstancesRequest describeAutoScalingInstancesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeAutoScalingInstancesResult call() throws Exception { return describeAutoScalingInstances(describeAutoScalingInstancesRequest); } }); } /** *

* Describes one or more Auto Scaling instances. If a list is not * provided, the call describes all instances. *

* * @param describeAutoScalingInstancesRequest Container for the necessary * parameters to execute the DescribeAutoScalingInstances operation on * AmazonAutoScaling. * @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 * DescribeAutoScalingInstances service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeAutoScalingInstancesAsync( final DescribeAutoScalingInstancesRequest describeAutoScalingInstancesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeAutoScalingInstancesResult call() throws Exception { DescribeAutoScalingInstancesResult result; try { result = describeAutoScalingInstances(describeAutoScalingInstancesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(describeAutoScalingInstancesRequest, result); return result; } }); } /** *

* Describes the lifecycle hooks for the specified Auto Scaling group. *

* * @param describeLifecycleHooksRequest Container for the necessary * parameters to execute the DescribeLifecycleHooks operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * DescribeLifecycleHooks service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeLifecycleHooksAsync(final DescribeLifecycleHooksRequest describeLifecycleHooksRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeLifecycleHooksResult call() throws Exception { return describeLifecycleHooks(describeLifecycleHooksRequest); } }); } /** *

* Describes the lifecycle hooks for the specified Auto Scaling group. *

* * @param describeLifecycleHooksRequest Container for the necessary * parameters to execute the DescribeLifecycleHooks operation on * AmazonAutoScaling. * @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 * DescribeLifecycleHooks service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeLifecycleHooksAsync( final DescribeLifecycleHooksRequest describeLifecycleHooksRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeLifecycleHooksResult call() throws Exception { DescribeLifecycleHooksResult result; try { result = describeLifecycleHooks(describeLifecycleHooksRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(describeLifecycleHooksRequest, result); return result; } }); } /** *

* Updates the configuration for the specified Auto Scaling group. *

*

* To update an Auto Scaling group with a launch configuration with * InstanceMonitoring set to False , you must * first disable the collection of group metrics. Otherwise, you will get * an error. If you have previously enabled the collection of group * metrics, you can disable it using DisableMetricsCollection. *

*

* The new settings are registered upon the completion of this call. Any * launch configuration settings take effect on any triggers after this * call returns. Scaling activities that are currently in progress aren't * affected. *

*

* Note the following: *

* *
    *
  • * If you specify a new value for MinSize without * specifying a value for DesiredCapacity , and the new * MinSize is larger than the current size of the group, we * implicitly call SetDesiredCapacity to set the size of the group to the * new value of MinSize . *

    *
  • *
  • * If you specify a new value for MaxSize without * specifying a value for DesiredCapacity , and the new * MaxSize is smaller than the current size of the group, we * implicitly call SetDesiredCapacity to set the size of the group to the * new value of MaxSize . *

    *
  • *
  • * All other optional parameters are left unchanged if not specified. *

    *
  • * *
* * @param updateAutoScalingGroupRequest Container for the necessary * parameters to execute the UpdateAutoScalingGroup operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * UpdateAutoScalingGroup service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future updateAutoScalingGroupAsync(final UpdateAutoScalingGroupRequest updateAutoScalingGroupRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { updateAutoScalingGroup(updateAutoScalingGroupRequest); return null; } }); } /** *

* Updates the configuration for the specified Auto Scaling group. *

*

* To update an Auto Scaling group with a launch configuration with * InstanceMonitoring set to False , you must * first disable the collection of group metrics. Otherwise, you will get * an error. If you have previously enabled the collection of group * metrics, you can disable it using DisableMetricsCollection. *

*

* The new settings are registered upon the completion of this call. Any * launch configuration settings take effect on any triggers after this * call returns. Scaling activities that are currently in progress aren't * affected. *

*

* Note the following: *

* *
    *
  • * If you specify a new value for MinSize without * specifying a value for DesiredCapacity , and the new * MinSize is larger than the current size of the group, we * implicitly call SetDesiredCapacity to set the size of the group to the * new value of MinSize . *

    *
  • *
  • * If you specify a new value for MaxSize without * specifying a value for DesiredCapacity , and the new * MaxSize is smaller than the current size of the group, we * implicitly call SetDesiredCapacity to set the size of the group to the * new value of MaxSize . *

    *
  • *
  • * All other optional parameters are left unchanged if not specified. *

    *
  • * *
* * @param updateAutoScalingGroupRequest Container for the necessary * parameters to execute the UpdateAutoScalingGroup operation on * AmazonAutoScaling. * @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 * UpdateAutoScalingGroup service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future updateAutoScalingGroupAsync( final UpdateAutoScalingGroupRequest updateAutoScalingGroupRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { updateAutoScalingGroup(updateAutoScalingGroupRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(updateAutoScalingGroupRequest, null); return null; } }); } /** *

* Records a heartbeat for the lifecycle action associated with a * specific token. This extends the timeout by the length of time defined * by the HeartbeatTimeout parameter of PutLifecycleHook. *

*

* This operation is a part of the basic sequence for adding a lifecycle * hook to an Auto Scaling group: *

*
  1. Create a notification target. A target can be either an * Amazon SQS queue or an Amazon SNS topic.
  2. *
  3. Create an IAM role. This role allows Auto Scaling to publish * lifecycle notifications to the designated SQS queue or SNS topic.
  4. *
  5. Create the lifecycle hook. You can create a hook that acts when * instances launch or when instances terminate.
  6. *
  7. If necessary, record the lifecycle action heartbeat to keep * the instance in a pending state.
  8. *
  9. Complete the lifecycle action.
  10. *

* For more information, see * Auto Scaling Pending State and Auto Scaling Terminating State * in the Auto Scaling Developer Guide . *

* * @param recordLifecycleActionHeartbeatRequest Container for the * necessary parameters to execute the RecordLifecycleActionHeartbeat * operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * RecordLifecycleActionHeartbeat service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future recordLifecycleActionHeartbeatAsync(final RecordLifecycleActionHeartbeatRequest recordLifecycleActionHeartbeatRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public RecordLifecycleActionHeartbeatResult call() throws Exception { return recordLifecycleActionHeartbeat(recordLifecycleActionHeartbeatRequest); } }); } /** *

* Records a heartbeat for the lifecycle action associated with a * specific token. This extends the timeout by the length of time defined * by the HeartbeatTimeout parameter of PutLifecycleHook. *

*

* This operation is a part of the basic sequence for adding a lifecycle * hook to an Auto Scaling group: *

*
  1. Create a notification target. A target can be either an * Amazon SQS queue or an Amazon SNS topic.
  2. *
  3. Create an IAM role. This role allows Auto Scaling to publish * lifecycle notifications to the designated SQS queue or SNS topic.
  4. *
  5. Create the lifecycle hook. You can create a hook that acts when * instances launch or when instances terminate.
  6. *
  7. If necessary, record the lifecycle action heartbeat to keep * the instance in a pending state.
  8. *
  9. Complete the lifecycle action.
  10. *

* For more information, see * Auto Scaling Pending State and Auto Scaling Terminating State * in the Auto Scaling Developer Guide . *

* * @param recordLifecycleActionHeartbeatRequest Container for the * necessary parameters to execute the RecordLifecycleActionHeartbeat * operation on AmazonAutoScaling. * @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 * RecordLifecycleActionHeartbeat service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future recordLifecycleActionHeartbeatAsync( final RecordLifecycleActionHeartbeatRequest recordLifecycleActionHeartbeatRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public RecordLifecycleActionHeartbeatResult call() throws Exception { RecordLifecycleActionHeartbeatResult result; try { result = recordLifecycleActionHeartbeat(recordLifecycleActionHeartbeatRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(recordLifecycleActionHeartbeatRequest, result); return result; } }); } /** *

* Describes the scaling process types for use with ResumeProcesses and * SuspendProcesses. *

* * @param describeScalingProcessTypesRequest Container for the necessary * parameters to execute the DescribeScalingProcessTypes operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * DescribeScalingProcessTypes service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeScalingProcessTypesAsync(final DescribeScalingProcessTypesRequest describeScalingProcessTypesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeScalingProcessTypesResult call() throws Exception { return describeScalingProcessTypes(describeScalingProcessTypesRequest); } }); } /** *

* Describes the scaling process types for use with ResumeProcesses and * SuspendProcesses. *

* * @param describeScalingProcessTypesRequest Container for the necessary * parameters to execute the DescribeScalingProcessTypes operation on * AmazonAutoScaling. * @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 * DescribeScalingProcessTypes service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeScalingProcessTypesAsync( final DescribeScalingProcessTypesRequest describeScalingProcessTypesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeScalingProcessTypesResult call() throws Exception { DescribeScalingProcessTypesResult result; try { result = describeScalingProcessTypes(describeScalingProcessTypesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(describeScalingProcessTypesRequest, result); return result; } }); } /** *

* Describes the termination policies supported by Auto Scaling. *

* * @param describeTerminationPolicyTypesRequest Container for the * necessary parameters to execute the DescribeTerminationPolicyTypes * operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * DescribeTerminationPolicyTypes service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeTerminationPolicyTypesAsync(final DescribeTerminationPolicyTypesRequest describeTerminationPolicyTypesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeTerminationPolicyTypesResult call() throws Exception { return describeTerminationPolicyTypes(describeTerminationPolicyTypesRequest); } }); } /** *

* Describes the termination policies supported by Auto Scaling. *

* * @param describeTerminationPolicyTypesRequest Container for the * necessary parameters to execute the DescribeTerminationPolicyTypes * operation on AmazonAutoScaling. * @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 * DescribeTerminationPolicyTypes service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeTerminationPolicyTypesAsync( final DescribeTerminationPolicyTypesRequest describeTerminationPolicyTypesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeTerminationPolicyTypesResult call() throws Exception { DescribeTerminationPolicyTypesResult result; try { result = describeTerminationPolicyTypes(describeTerminationPolicyTypesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(describeTerminationPolicyTypesRequest, result); return result; } }); } /** *

* Completes the lifecycle action for the associated token initiated * under the given lifecycle hook with the specified result. *

*

* This operation is a part of the basic sequence for adding a lifecycle * hook to an Auto Scaling group: *

*
  1. Create a notification target. A target can be either an * Amazon SQS queue or an Amazon SNS topic.
  2. *
  3. Create an IAM role. This role allows Auto Scaling to publish * lifecycle notifications to the designated SQS queue or SNS topic.
  4. *
  5. Create the lifecycle hook. You can create a hook that acts when * instances launch or when instances terminate.
  6. *
  7. If necessary, record the lifecycle action heartbeat to keep the * instance in a pending state.
  8. *
  9. Complete the lifecycle action .
  10. *

* For more information, see * Auto Scaling Pending State and Auto Scaling Terminating State * in the Auto Scaling Developer Guide . *

* * @param completeLifecycleActionRequest Container for the necessary * parameters to execute the CompleteLifecycleAction operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * CompleteLifecycleAction service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future completeLifecycleActionAsync(final CompleteLifecycleActionRequest completeLifecycleActionRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public CompleteLifecycleActionResult call() throws Exception { return completeLifecycleAction(completeLifecycleActionRequest); } }); } /** *

* Completes the lifecycle action for the associated token initiated * under the given lifecycle hook with the specified result. *

*

* This operation is a part of the basic sequence for adding a lifecycle * hook to an Auto Scaling group: *

*
  1. Create a notification target. A target can be either an * Amazon SQS queue or an Amazon SNS topic.
  2. *
  3. Create an IAM role. This role allows Auto Scaling to publish * lifecycle notifications to the designated SQS queue or SNS topic.
  4. *
  5. Create the lifecycle hook. You can create a hook that acts when * instances launch or when instances terminate.
  6. *
  7. If necessary, record the lifecycle action heartbeat to keep the * instance in a pending state.
  8. *
  9. Complete the lifecycle action .
  10. *

* For more information, see * Auto Scaling Pending State and Auto Scaling Terminating State * in the Auto Scaling Developer Guide . *

* * @param completeLifecycleActionRequest Container for the necessary * parameters to execute the CompleteLifecycleAction operation on * AmazonAutoScaling. * @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 * CompleteLifecycleAction service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future completeLifecycleActionAsync( final CompleteLifecycleActionRequest completeLifecycleActionRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public CompleteLifecycleActionResult call() throws Exception { CompleteLifecycleActionResult result; try { result = completeLifecycleAction(completeLifecycleActionRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(completeLifecycleActionRequest, result); return result; } }); } /** *

* Deletes the specified Auto Scaling group. *

*

* If the group has instances or scaling activities in progress, you * must specify the option to force the deletion in order for it to * succeed. *

*

* If the group has policies, deleting the group deletes the policies, * the underlying alarm actions, and any alarm that no longer has an * associated action. *

*

* To remove instances from the Auto Scaling group before deleting it, * call DetachInstances with the list of instances and the option to * decrement the desired capacity so that Auto Scaling does not launch * replacement instances. *

*

* To terminate all instances before deleting the Auto Scaling group, * call UpdateAutoScalingGroup and set the minimum size and desired * capacity of the Auto Scaling group to zero. *

* * @param deleteAutoScalingGroupRequest Container for the necessary * parameters to execute the DeleteAutoScalingGroup operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * DeleteAutoScalingGroup service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future deleteAutoScalingGroupAsync(final DeleteAutoScalingGroupRequest deleteAutoScalingGroupRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { deleteAutoScalingGroup(deleteAutoScalingGroupRequest); return null; } }); } /** *

* Deletes the specified Auto Scaling group. *

*

* If the group has instances or scaling activities in progress, you * must specify the option to force the deletion in order for it to * succeed. *

*

* If the group has policies, deleting the group deletes the policies, * the underlying alarm actions, and any alarm that no longer has an * associated action. *

*

* To remove instances from the Auto Scaling group before deleting it, * call DetachInstances with the list of instances and the option to * decrement the desired capacity so that Auto Scaling does not launch * replacement instances. *

*

* To terminate all instances before deleting the Auto Scaling group, * call UpdateAutoScalingGroup and set the minimum size and desired * capacity of the Auto Scaling group to zero. *

* * @param deleteAutoScalingGroupRequest Container for the necessary * parameters to execute the DeleteAutoScalingGroup operation on * AmazonAutoScaling. * @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 * DeleteAutoScalingGroup service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future deleteAutoScalingGroupAsync( final DeleteAutoScalingGroupRequest deleteAutoScalingGroupRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { deleteAutoScalingGroup(deleteAutoScalingGroupRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(deleteAutoScalingGroupRequest, null); return null; } }); } /** *

* Describes the load balancers for the specified Auto Scaling group. *

* * @param describeLoadBalancersRequest Container for the necessary * parameters to execute the DescribeLoadBalancers operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * DescribeLoadBalancers service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeLoadBalancersAsync(final DescribeLoadBalancersRequest describeLoadBalancersRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeLoadBalancersResult call() throws Exception { return describeLoadBalancers(describeLoadBalancersRequest); } }); } /** *

* Describes the load balancers for the specified Auto Scaling group. *

* * @param describeLoadBalancersRequest Container for the necessary * parameters to execute the DescribeLoadBalancers operation on * AmazonAutoScaling. * @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 * DescribeLoadBalancers service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeLoadBalancersAsync( final DescribeLoadBalancersRequest describeLoadBalancersRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeLoadBalancersResult call() throws Exception { DescribeLoadBalancersResult result; try { result = describeLoadBalancers(describeLoadBalancersRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(describeLoadBalancersRequest, result); return result; } }); } /** *

* Removes one or more load balancers from the specified Auto Scaling * group. *

*

* When you detach a load balancer, it enters the Removing * state while deregistering the instances in the group. When all * instances are deregistered, then you can no longer describe the load * balancer using DescribeLoadBalancers. Note that the instances remain * running. *

* * @param detachLoadBalancersRequest Container for the necessary * parameters to execute the DetachLoadBalancers operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * DetachLoadBalancers service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future detachLoadBalancersAsync(final DetachLoadBalancersRequest detachLoadBalancersRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DetachLoadBalancersResult call() throws Exception { return detachLoadBalancers(detachLoadBalancersRequest); } }); } /** *

* Removes one or more load balancers from the specified Auto Scaling * group. *

*

* When you detach a load balancer, it enters the Removing * state while deregistering the instances in the group. When all * instances are deregistered, then you can no longer describe the load * balancer using DescribeLoadBalancers. Note that the instances remain * running. *

* * @param detachLoadBalancersRequest Container for the necessary * parameters to execute the DetachLoadBalancers operation on * AmazonAutoScaling. * @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 * DetachLoadBalancers service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future detachLoadBalancersAsync( final DetachLoadBalancersRequest detachLoadBalancersRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DetachLoadBalancersResult call() throws Exception { DetachLoadBalancersResult result; try { result = detachLoadBalancers(detachLoadBalancersRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(detachLoadBalancersRequest, result); return result; } }); } /** *

* Creates or updates a policy for an Auto Scaling group. To update an * existing policy, use the existing policy name and set the parameters * you want to change. Any existing parameter not changed in an update to * an existing policy is not changed in this update request. *

*

* If you exceed your maximum limit of step adjustments, which by * default is 20 per region, the call fails. For information about * updating this limit, see * AWS Service Limits * in the Amazon Web Services General Reference . *

* * @param putScalingPolicyRequest Container for the necessary parameters * to execute the PutScalingPolicy operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * PutScalingPolicy service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future putScalingPolicyAsync(final PutScalingPolicyRequest putScalingPolicyRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public PutScalingPolicyResult call() throws Exception { return putScalingPolicy(putScalingPolicyRequest); } }); } /** *

* Creates or updates a policy for an Auto Scaling group. To update an * existing policy, use the existing policy name and set the parameters * you want to change. Any existing parameter not changed in an update to * an existing policy is not changed in this update request. *

*

* If you exceed your maximum limit of step adjustments, which by * default is 20 per region, the call fails. For information about * updating this limit, see * AWS Service Limits * in the Amazon Web Services General Reference . *

* * @param putScalingPolicyRequest Container for the necessary parameters * to execute the PutScalingPolicy operation on AmazonAutoScaling. * @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 * PutScalingPolicy service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future putScalingPolicyAsync( final PutScalingPolicyRequest putScalingPolicyRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public PutScalingPolicyResult call() throws Exception { PutScalingPolicyResult result; try { result = putScalingPolicy(putScalingPolicyRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(putScalingPolicyRequest, result); return result; } }); } /** *

* Describes one or more scaling activities for the specified Auto * Scaling group. If you omit the ActivityIds , the call * returns all activities from the past six weeks. Activities are sorted * by the start time. Activities still in progress appear first on the * list. *

* * @param describeScalingActivitiesRequest Container for the necessary * parameters to execute the DescribeScalingActivities operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * DescribeScalingActivities service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeScalingActivitiesAsync(final DescribeScalingActivitiesRequest describeScalingActivitiesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeScalingActivitiesResult call() throws Exception { return describeScalingActivities(describeScalingActivitiesRequest); } }); } /** *

* Describes one or more scaling activities for the specified Auto * Scaling group. If you omit the ActivityIds , the call * returns all activities from the past six weeks. Activities are sorted * by the start time. Activities still in progress appear first on the * list. *

* * @param describeScalingActivitiesRequest Container for the necessary * parameters to execute the DescribeScalingActivities operation on * AmazonAutoScaling. * @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 * DescribeScalingActivities service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeScalingActivitiesAsync( final DescribeScalingActivitiesRequest describeScalingActivitiesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeScalingActivitiesResult call() throws Exception { DescribeScalingActivitiesResult result; try { result = describeScalingActivities(describeScalingActivitiesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(describeScalingActivitiesRequest, result); return result; } }); } /** *

* Moves the specified instances into Standby mode. *

*

* For more information, see * Auto Scaling InService State * in the Auto Scaling Developer Guide . *

* * @param enterStandbyRequest Container for the necessary parameters to * execute the EnterStandby operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * EnterStandby service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future enterStandbyAsync(final EnterStandbyRequest enterStandbyRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public EnterStandbyResult call() throws Exception { return enterStandby(enterStandbyRequest); } }); } /** *

* Moves the specified instances into Standby mode. *

*

* For more information, see * Auto Scaling InService State * in the Auto Scaling Developer Guide . *

* * @param enterStandbyRequest Container for the necessary parameters to * execute the EnterStandby operation on AmazonAutoScaling. * @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 * EnterStandby service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future enterStandbyAsync( final EnterStandbyRequest enterStandbyRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public EnterStandbyResult call() throws Exception { EnterStandbyResult result; try { result = enterStandby(enterStandbyRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(enterStandbyRequest, result); return result; } }); } /** *

* Deletes the specified tags. *

* * @param deleteTagsRequest Container for the necessary parameters to * execute the DeleteTags operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * DeleteTags service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling 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 the specified tags. *

* * @param deleteTagsRequest Container for the necessary parameters to * execute the DeleteTags operation on AmazonAutoScaling. * @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 AmazonAutoScaling. * * * @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 AmazonAutoScaling 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; } }); } /** *

* Creates or updates tags for the specified Auto Scaling group. *

*

* A tag is defined by its resource ID, resource type, key, value, and * propagate flag. The value and the propagate flag are optional * parameters. The only supported resource type is * auto-scaling-group , and the resource ID must be the name * of the group. The PropagateAtLaunch flag determines * whether the tag is added to instances launched in the group. Valid * values are true or false . *

*

* When you specify a tag with a key that already exists, the operation * overwrites the previous tag definition, and you do not get an error * message. *

*

* For more information, see * Tagging Auto Scaling Groups and Instances * in the Auto Scaling Developer Guide . *

* * @param createOrUpdateTagsRequest Container for the necessary * parameters to execute the CreateOrUpdateTags operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * CreateOrUpdateTags service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future createOrUpdateTagsAsync(final CreateOrUpdateTagsRequest createOrUpdateTagsRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { createOrUpdateTags(createOrUpdateTagsRequest); return null; } }); } /** *

* Creates or updates tags for the specified Auto Scaling group. *

*

* A tag is defined by its resource ID, resource type, key, value, and * propagate flag. The value and the propagate flag are optional * parameters. The only supported resource type is * auto-scaling-group , and the resource ID must be the name * of the group. The PropagateAtLaunch flag determines * whether the tag is added to instances launched in the group. Valid * values are true or false . *

*

* When you specify a tag with a key that already exists, the operation * overwrites the previous tag definition, and you do not get an error * message. *

*

* For more information, see * Tagging Auto Scaling Groups and Instances * in the Auto Scaling Developer Guide . *

* * @param createOrUpdateTagsRequest Container for the necessary * parameters to execute the CreateOrUpdateTags operation on * AmazonAutoScaling. * @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 * CreateOrUpdateTags service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future createOrUpdateTagsAsync( final CreateOrUpdateTagsRequest createOrUpdateTagsRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { createOrUpdateTags(createOrUpdateTagsRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(createOrUpdateTagsRequest, null); return null; } }); } /** *

* Describes the available CloudWatch metrics for Auto Scaling. *

*

* Note that the GroupStandbyInstances metric is not * returned by default. You must explicitly request this metric when * calling EnableMetricsCollection. *

* * @param describeMetricCollectionTypesRequest Container for the * necessary parameters to execute the DescribeMetricCollectionTypes * operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * DescribeMetricCollectionTypes service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeMetricCollectionTypesAsync(final DescribeMetricCollectionTypesRequest describeMetricCollectionTypesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeMetricCollectionTypesResult call() throws Exception { return describeMetricCollectionTypes(describeMetricCollectionTypesRequest); } }); } /** *

* Describes the available CloudWatch metrics for Auto Scaling. *

*

* Note that the GroupStandbyInstances metric is not * returned by default. You must explicitly request this metric when * calling EnableMetricsCollection. *

* * @param describeMetricCollectionTypesRequest Container for the * necessary parameters to execute the DescribeMetricCollectionTypes * operation on AmazonAutoScaling. * @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 * DescribeMetricCollectionTypes service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeMetricCollectionTypesAsync( final DescribeMetricCollectionTypesRequest describeMetricCollectionTypesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeMetricCollectionTypesResult call() throws Exception { DescribeMetricCollectionTypesResult result; try { result = describeMetricCollectionTypes(describeMetricCollectionTypesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(describeMetricCollectionTypesRequest, result); return result; } }); } /** *

* Describes the actions scheduled for your Auto Scaling group that * haven't run. To describe the actions that have already run, use * DescribeScalingActivities. *

* * @param describeScheduledActionsRequest Container for the necessary * parameters to execute the DescribeScheduledActions operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * DescribeScheduledActions service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeScheduledActionsAsync(final DescribeScheduledActionsRequest describeScheduledActionsRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeScheduledActionsResult call() throws Exception { return describeScheduledActions(describeScheduledActionsRequest); } }); } /** *

* Describes the actions scheduled for your Auto Scaling group that * haven't run. To describe the actions that have already run, use * DescribeScalingActivities. *

* * @param describeScheduledActionsRequest Container for the necessary * parameters to execute the DescribeScheduledActions operation on * AmazonAutoScaling. * @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 * DescribeScheduledActions service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeScheduledActionsAsync( final DescribeScheduledActionsRequest describeScheduledActionsRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeScheduledActionsResult call() throws Exception { DescribeScheduledActionsResult result; try { result = describeScheduledActions(describeScheduledActionsRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(describeScheduledActionsRequest, result); return result; } }); } /** *

* Disables monitoring of the specified metrics for the specified Auto * Scaling group. *

* * @param disableMetricsCollectionRequest Container for the necessary * parameters to execute the DisableMetricsCollection operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * DisableMetricsCollection service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future disableMetricsCollectionAsync(final DisableMetricsCollectionRequest disableMetricsCollectionRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { disableMetricsCollection(disableMetricsCollectionRequest); return null; } }); } /** *

* Disables monitoring of the specified metrics for the specified Auto * Scaling group. *

* * @param disableMetricsCollectionRequest Container for the necessary * parameters to execute the DisableMetricsCollection operation on * AmazonAutoScaling. * @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 * DisableMetricsCollection service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future disableMetricsCollectionAsync( final DisableMetricsCollectionRequest disableMetricsCollectionRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { disableMetricsCollection(disableMetricsCollectionRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(disableMetricsCollectionRequest, null); return null; } }); } /** *

* Sets the size of the specified Auto Scaling group. *

*

* For more information about desired capacity, see * What Is Auto Scaling? * in the Auto Scaling Developer Guide . *

* * @param setDesiredCapacityRequest Container for the necessary * parameters to execute the SetDesiredCapacity operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * SetDesiredCapacity service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future setDesiredCapacityAsync(final SetDesiredCapacityRequest setDesiredCapacityRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { setDesiredCapacity(setDesiredCapacityRequest); return null; } }); } /** *

* Sets the size of the specified Auto Scaling group. *

*

* For more information about desired capacity, see * What Is Auto Scaling? * in the Auto Scaling Developer Guide . *

* * @param setDesiredCapacityRequest Container for the necessary * parameters to execute the SetDesiredCapacity operation on * AmazonAutoScaling. * @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 * SetDesiredCapacity service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future setDesiredCapacityAsync( final SetDesiredCapacityRequest setDesiredCapacityRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { setDesiredCapacity(setDesiredCapacityRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(setDesiredCapacityRequest, null); return null; } }); } /** *

* Deletes the specified launch configuration. *

*

* The launch configuration must not be attached to an Auto Scaling * group. When this call completes, the launch configuration is no longer * available for use. *

* * @param deleteLaunchConfigurationRequest Container for the necessary * parameters to execute the DeleteLaunchConfiguration operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * DeleteLaunchConfiguration service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future deleteLaunchConfigurationAsync(final DeleteLaunchConfigurationRequest deleteLaunchConfigurationRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { deleteLaunchConfiguration(deleteLaunchConfigurationRequest); return null; } }); } /** *

* Deletes the specified launch configuration. *

*

* The launch configuration must not be attached to an Auto Scaling * group. When this call completes, the launch configuration is no longer * available for use. *

* * @param deleteLaunchConfigurationRequest Container for the necessary * parameters to execute the DeleteLaunchConfiguration operation on * AmazonAutoScaling. * @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 * DeleteLaunchConfiguration service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future deleteLaunchConfigurationAsync( final DeleteLaunchConfigurationRequest deleteLaunchConfigurationRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { deleteLaunchConfiguration(deleteLaunchConfigurationRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(deleteLaunchConfigurationRequest, null); return null; } }); } /** *

* Terminates the specified instance and optionally adjusts the desired * group size. *

*

* This call simply makes a termination request. The instance is not * terminated immediately. *

* * @param terminateInstanceInAutoScalingGroupRequest Container for the * necessary parameters to execute the * TerminateInstanceInAutoScalingGroup operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * TerminateInstanceInAutoScalingGroup service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future terminateInstanceInAutoScalingGroupAsync(final TerminateInstanceInAutoScalingGroupRequest terminateInstanceInAutoScalingGroupRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public TerminateInstanceInAutoScalingGroupResult call() throws Exception { return terminateInstanceInAutoScalingGroup(terminateInstanceInAutoScalingGroupRequest); } }); } /** *

* Terminates the specified instance and optionally adjusts the desired * group size. *

*

* This call simply makes a termination request. The instance is not * terminated immediately. *

* * @param terminateInstanceInAutoScalingGroupRequest Container for the * necessary parameters to execute the * TerminateInstanceInAutoScalingGroup operation on AmazonAutoScaling. * @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 * TerminateInstanceInAutoScalingGroup service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future terminateInstanceInAutoScalingGroupAsync( final TerminateInstanceInAutoScalingGroupRequest terminateInstanceInAutoScalingGroupRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public TerminateInstanceInAutoScalingGroupResult call() throws Exception { TerminateInstanceInAutoScalingGroupResult result; try { result = terminateInstanceInAutoScalingGroup(terminateInstanceInAutoScalingGroupRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(terminateInstanceInAutoScalingGroupRequest, result); return result; } }); } /** *

* Deletes the specified Auto Scaling policy. *

*

* Deleting a policy deletes the underlying alarm action, but does not * delete the alarm, even if it no longer has an associated action. *

* * @param deletePolicyRequest Container for the necessary parameters to * execute the DeletePolicy operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * DeletePolicy service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future deletePolicyAsync(final DeletePolicyRequest deletePolicyRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { deletePolicy(deletePolicyRequest); return null; } }); } /** *

* Deletes the specified Auto Scaling policy. *

*

* Deleting a policy deletes the underlying alarm action, but does not * delete the alarm, even if it no longer has an associated action. *

* * @param deletePolicyRequest Container for the necessary parameters to * execute the DeletePolicy operation on AmazonAutoScaling. * @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 * DeletePolicy service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future deletePolicyAsync( final DeletePolicyRequest deletePolicyRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { deletePolicy(deletePolicyRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(deletePolicyRequest, null); return null; } }); } /** *

* Sets the health status of the specified instance. *

*

* For more information, see * Health Checks * in the Auto Scaling Developer Guide . *

* * @param setInstanceHealthRequest Container for the necessary parameters * to execute the SetInstanceHealth operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * SetInstanceHealth service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future setInstanceHealthAsync(final SetInstanceHealthRequest setInstanceHealthRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { setInstanceHealth(setInstanceHealthRequest); return null; } }); } /** *

* Sets the health status of the specified instance. *

*

* For more information, see * Health Checks * in the Auto Scaling Developer Guide . *

* * @param setInstanceHealthRequest Container for the necessary parameters * to execute the SetInstanceHealth operation on AmazonAutoScaling. * @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 * SetInstanceHealth service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future setInstanceHealthAsync( final SetInstanceHealthRequest setInstanceHealthRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { setInstanceHealth(setInstanceHealthRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(setInstanceHealthRequest, null); return null; } }); } /** *

* Executes the specified policy. *

* * @param executePolicyRequest Container for the necessary parameters to * execute the ExecutePolicy operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * ExecutePolicy service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future executePolicyAsync(final ExecutePolicyRequest executePolicyRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { executePolicy(executePolicyRequest); return null; } }); } /** *

* Executes the specified policy. *

* * @param executePolicyRequest Container for the necessary parameters to * execute the ExecutePolicy operation on AmazonAutoScaling. * @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 * ExecutePolicy service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future executePolicyAsync( final ExecutePolicyRequest executePolicyRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { executePolicy(executePolicyRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(executePolicyRequest, null); return null; } }); } /** *

* Describes the notification types that are supported by Auto Scaling. *

* * @param describeAutoScalingNotificationTypesRequest Container for the * necessary parameters to execute the * DescribeAutoScalingNotificationTypes operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * DescribeAutoScalingNotificationTypes service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeAutoScalingNotificationTypesAsync(final DescribeAutoScalingNotificationTypesRequest describeAutoScalingNotificationTypesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeAutoScalingNotificationTypesResult call() throws Exception { return describeAutoScalingNotificationTypes(describeAutoScalingNotificationTypesRequest); } }); } /** *

* Describes the notification types that are supported by Auto Scaling. *

* * @param describeAutoScalingNotificationTypesRequest Container for the * necessary parameters to execute the * DescribeAutoScalingNotificationTypes operation on AmazonAutoScaling. * @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 * DescribeAutoScalingNotificationTypes service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeAutoScalingNotificationTypesAsync( final DescribeAutoScalingNotificationTypesRequest describeAutoScalingNotificationTypesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeAutoScalingNotificationTypesResult call() throws Exception { DescribeAutoScalingNotificationTypesResult result; try { result = describeAutoScalingNotificationTypes(describeAutoScalingNotificationTypesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(describeAutoScalingNotificationTypesRequest, result); return result; } }); } /** *

* Suspends the specified Auto Scaling processes for the specified Auto * Scaling group. To suspend specific processes, use the * ScalingProcesses parameter. To suspend all processes, * omit the ScalingProcesses parameter. *

*

* Note that if you suspend either the Launch or * Terminate process types, it can prevent other process * types from functioning properly. *

*

* To resume processes that have been suspended, use ResumeProcesses. *

*

* For more information, see * Suspend and Resume Auto Scaling Processes * in the Auto Scaling Developer Guide . *

* * @param suspendProcessesRequest Container for the necessary parameters * to execute the SuspendProcesses operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * SuspendProcesses service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future suspendProcessesAsync(final SuspendProcessesRequest suspendProcessesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { suspendProcesses(suspendProcessesRequest); return null; } }); } /** *

* Suspends the specified Auto Scaling processes for the specified Auto * Scaling group. To suspend specific processes, use the * ScalingProcesses parameter. To suspend all processes, * omit the ScalingProcesses parameter. *

*

* Note that if you suspend either the Launch or * Terminate process types, it can prevent other process * types from functioning properly. *

*

* To resume processes that have been suspended, use ResumeProcesses. *

*

* For more information, see * Suspend and Resume Auto Scaling Processes * in the Auto Scaling Developer Guide . *

* * @param suspendProcessesRequest Container for the necessary parameters * to execute the SuspendProcesses operation on AmazonAutoScaling. * @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 * SuspendProcesses service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future suspendProcessesAsync( final SuspendProcessesRequest suspendProcessesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { suspendProcesses(suspendProcessesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(suspendProcessesRequest, null); return null; } }); } /** *

* Deletes the specified lifecycle hook. *

*

* If there are any outstanding lifecycle actions, they are completed * first ( ABANDON for launching instances, * CONTINUE for terminating instances). *

* * @param deleteLifecycleHookRequest Container for the necessary * parameters to execute the DeleteLifecycleHook operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * DeleteLifecycleHook service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future deleteLifecycleHookAsync(final DeleteLifecycleHookRequest deleteLifecycleHookRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DeleteLifecycleHookResult call() throws Exception { return deleteLifecycleHook(deleteLifecycleHookRequest); } }); } /** *

* Deletes the specified lifecycle hook. *

*

* If there are any outstanding lifecycle actions, they are completed * first ( ABANDON for launching instances, * CONTINUE for terminating instances). *

* * @param deleteLifecycleHookRequest Container for the necessary * parameters to execute the DeleteLifecycleHook operation on * AmazonAutoScaling. * @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 * DeleteLifecycleHook service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future deleteLifecycleHookAsync( final DeleteLifecycleHookRequest deleteLifecycleHookRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DeleteLifecycleHookResult call() throws Exception { DeleteLifecycleHookResult result; try { result = deleteLifecycleHook(deleteLifecycleHookRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(deleteLifecycleHookRequest, result); return result; } }); } /** *

* Resumes the specified suspended Auto Scaling processes for the * specified Auto Scaling group. To resume specific processes, use the * ScalingProcesses parameter. To resume all processes, omit * the ScalingProcesses parameter. For more information, see * Suspend and Resume Auto Scaling Processes * in the Auto Scaling Developer Guide . *

* * @param resumeProcessesRequest Container for the necessary parameters * to execute the ResumeProcesses operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * ResumeProcesses service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future resumeProcessesAsync(final ResumeProcessesRequest resumeProcessesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { resumeProcesses(resumeProcessesRequest); return null; } }); } /** *

* Resumes the specified suspended Auto Scaling processes for the * specified Auto Scaling group. To resume specific processes, use the * ScalingProcesses parameter. To resume all processes, omit * the ScalingProcesses parameter. For more information, see * Suspend and Resume Auto Scaling Processes * in the Auto Scaling Developer Guide . *

* * @param resumeProcessesRequest Container for the necessary parameters * to execute the ResumeProcesses operation on AmazonAutoScaling. * @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 * ResumeProcesses service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future resumeProcessesAsync( final ResumeProcessesRequest resumeProcessesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { resumeProcesses(resumeProcessesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(resumeProcessesRequest, null); return null; } }); } /** *

* Describes the policy adjustment types for use with PutScalingPolicy. *

* * @param describeAdjustmentTypesRequest Container for the necessary * parameters to execute the DescribeAdjustmentTypes operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * DescribeAdjustmentTypes service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeAdjustmentTypesAsync(final DescribeAdjustmentTypesRequest describeAdjustmentTypesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeAdjustmentTypesResult call() throws Exception { return describeAdjustmentTypes(describeAdjustmentTypesRequest); } }); } /** *

* Describes the policy adjustment types for use with PutScalingPolicy. *

* * @param describeAdjustmentTypesRequest Container for the necessary * parameters to execute the DescribeAdjustmentTypes operation on * AmazonAutoScaling. * @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 * DescribeAdjustmentTypes service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeAdjustmentTypesAsync( final DescribeAdjustmentTypesRequest describeAdjustmentTypesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeAdjustmentTypesResult call() throws Exception { DescribeAdjustmentTypesResult result; try { result = describeAdjustmentTypes(describeAdjustmentTypesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(describeAdjustmentTypesRequest, result); return result; } }); } /** *

* Describes the notification actions associated with the specified Auto * Scaling group. *

* * @param describeNotificationConfigurationsRequest Container for the * necessary parameters to execute the DescribeNotificationConfigurations * operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * DescribeNotificationConfigurations service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeNotificationConfigurationsAsync(final DescribeNotificationConfigurationsRequest describeNotificationConfigurationsRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeNotificationConfigurationsResult call() throws Exception { return describeNotificationConfigurations(describeNotificationConfigurationsRequest); } }); } /** *

* Describes the notification actions associated with the specified Auto * Scaling group. *

* * @param describeNotificationConfigurationsRequest Container for the * necessary parameters to execute the DescribeNotificationConfigurations * operation on AmazonAutoScaling. * @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 * DescribeNotificationConfigurations service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeNotificationConfigurationsAsync( final DescribeNotificationConfigurationsRequest describeNotificationConfigurationsRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeNotificationConfigurationsResult call() throws Exception { DescribeNotificationConfigurationsResult result; try { result = describeNotificationConfigurations(describeNotificationConfigurationsRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(describeNotificationConfigurationsRequest, result); return result; } }); } /** *

* Moves the specified instances out of Standby mode. *

*

* For more information, see * Auto Scaling InService State * in the Auto Scaling Developer Guide . *

* * @param exitStandbyRequest Container for the necessary parameters to * execute the ExitStandby operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * ExitStandby service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future exitStandbyAsync(final ExitStandbyRequest exitStandbyRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ExitStandbyResult call() throws Exception { return exitStandby(exitStandbyRequest); } }); } /** *

* Moves the specified instances out of Standby mode. *

*

* For more information, see * Auto Scaling InService State * in the Auto Scaling Developer Guide . *

* * @param exitStandbyRequest Container for the necessary parameters to * execute the ExitStandby operation on AmazonAutoScaling. * @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 * ExitStandby service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future exitStandbyAsync( final ExitStandbyRequest exitStandbyRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ExitStandbyResult call() throws Exception { ExitStandbyResult result; try { result = exitStandby(exitStandbyRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(exitStandbyRequest, result); return result; } }); } /** *

* Describes one or more launch configurations. If you omit the list of * names, then the call describes all launch configurations. *

* * @param describeLaunchConfigurationsRequest Container for the necessary * parameters to execute the DescribeLaunchConfigurations operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * DescribeLaunchConfigurations service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeLaunchConfigurationsAsync(final DescribeLaunchConfigurationsRequest describeLaunchConfigurationsRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeLaunchConfigurationsResult call() throws Exception { return describeLaunchConfigurations(describeLaunchConfigurationsRequest); } }); } /** *

* Describes one or more launch configurations. If you omit the list of * names, then the call describes all launch configurations. *

* * @param describeLaunchConfigurationsRequest Container for the necessary * parameters to execute the DescribeLaunchConfigurations operation on * AmazonAutoScaling. * @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 * DescribeLaunchConfigurations service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future describeLaunchConfigurationsAsync( final DescribeLaunchConfigurationsRequest describeLaunchConfigurationsRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DescribeLaunchConfigurationsResult call() throws Exception { DescribeLaunchConfigurationsResult result; try { result = describeLaunchConfigurations(describeLaunchConfigurationsRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(describeLaunchConfigurationsRequest, result); return result; } }); } /** *

* Updates the instance protection settings of the specified instances. *

*

* For more information, see * Instance Protection * in the Auto Scaling Developer Guide . *

* * @param setInstanceProtectionRequest Container for the necessary * parameters to execute the SetInstanceProtection operation on * AmazonAutoScaling. * * @return A Java Future object containing the response from the * SetInstanceProtection service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future setInstanceProtectionAsync(final SetInstanceProtectionRequest setInstanceProtectionRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public SetInstanceProtectionResult call() throws Exception { return setInstanceProtection(setInstanceProtectionRequest); } }); } /** *

* Updates the instance protection settings of the specified instances. *

*

* For more information, see * Instance Protection * in the Auto Scaling Developer Guide . *

* * @param setInstanceProtectionRequest Container for the necessary * parameters to execute the SetInstanceProtection operation on * AmazonAutoScaling. * @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 * SetInstanceProtection service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future setInstanceProtectionAsync( final SetInstanceProtectionRequest setInstanceProtectionRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public SetInstanceProtectionResult call() throws Exception { SetInstanceProtectionResult result; try { result = setInstanceProtection(setInstanceProtectionRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(setInstanceProtectionRequest, result); return result; } }); } /** *

* Creates or updates a scheduled scaling action for an Auto Scaling * group. When updating a scheduled scaling action, if you leave a * parameter unspecified, the corresponding value remains unchanged in * the affected Auto Scaling group. *

*

* For more information, see * Scheduled Scaling * in the Auto Scaling Developer Guide . *

* * @param putScheduledUpdateGroupActionRequest Container for the * necessary parameters to execute the PutScheduledUpdateGroupAction * operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * PutScheduledUpdateGroupAction service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future putScheduledUpdateGroupActionAsync(final PutScheduledUpdateGroupActionRequest putScheduledUpdateGroupActionRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { putScheduledUpdateGroupAction(putScheduledUpdateGroupActionRequest); return null; } }); } /** *

* Creates or updates a scheduled scaling action for an Auto Scaling * group. When updating a scheduled scaling action, if you leave a * parameter unspecified, the corresponding value remains unchanged in * the affected Auto Scaling group. *

*

* For more information, see * Scheduled Scaling * in the Auto Scaling Developer Guide . *

* * @param putScheduledUpdateGroupActionRequest Container for the * necessary parameters to execute the PutScheduledUpdateGroupAction * operation on AmazonAutoScaling. * @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 * PutScheduledUpdateGroupAction service method, as returned by * AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future putScheduledUpdateGroupActionAsync( final PutScheduledUpdateGroupActionRequest putScheduledUpdateGroupActionRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { putScheduledUpdateGroupAction(putScheduledUpdateGroupActionRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(putScheduledUpdateGroupActionRequest, null); return null; } }); } /** *

* Attaches one or more EC2 instances to the specified Auto Scaling * group. *

*

* When you attach instances, Auto Scaling increases the desired * capacity of the group by the number of instances being attached. If * the number of instances being attached plus the desired capacity of * the group exceeds the maximum size of the group, the operation fails. *

*

* For more information, see * Attach EC2 Instances to Your Auto Scaling Group * in the Auto Scaling Developer Guide . *

* * @param attachInstancesRequest Container for the necessary parameters * to execute the AttachInstances operation on AmazonAutoScaling. * * @return A Java Future object containing the response from the * AttachInstances service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future attachInstancesAsync(final AttachInstancesRequest attachInstancesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { attachInstances(attachInstancesRequest); return null; } }); } /** *

* Attaches one or more EC2 instances to the specified Auto Scaling * group. *

*

* When you attach instances, Auto Scaling increases the desired * capacity of the group by the number of instances being attached. If * the number of instances being attached plus the desired capacity of * the group exceeds the maximum size of the group, the operation fails. *

*

* For more information, see * Attach EC2 Instances to Your Auto Scaling Group * in the Auto Scaling Developer Guide . *

* * @param attachInstancesRequest Container for the necessary parameters * to execute the AttachInstances operation on AmazonAutoScaling. * @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 * AttachInstances service method, as returned by AmazonAutoScaling. * * * @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 AmazonAutoScaling indicating * either a problem with the data in the request, or a server side issue. */ public Future attachInstancesAsync( final AttachInstancesRequest attachInstancesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { try { attachInstances(attachInstancesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(attachInstancesRequest, null); return null; } }); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy