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

com.amazonaws.services.organizations.AWSOrganizationsAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Organizations module holds the client classes that are used for communicating with AWS Organizations.

The newest version!
/*
 * Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */
package com.amazonaws.services.organizations;

import static java.util.concurrent.Executors.newFixedThreadPool;

import javax.annotation.Generated;

import com.amazonaws.services.organizations.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSCredentialsProvider;
import java.util.concurrent.ExecutorService;
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;

/**
 * Client for accessing Organizations asynchronously. Each asynchronous method will return a Java Future object
 * representing the asynchronous operation; overloads which accept an {@code AsyncHandler} can be used to receive
 * notification when an asynchronous operation completes.
 * 

*

* Organizations is a web service that enables you to consolidate your multiple Amazon Web Services accounts into an * organization and centrally manage your accounts and their resources. *

*

* This guide provides descriptions of the Organizations operations. For more information about using this service, see * the Organizations User * Guide. *

*

* Support and feedback for Organizations *

*

* We welcome your feedback. Send your comments to [email protected] or post your feedback and * questions in the Organizations support forum. For * more information about the Amazon Web Services support forums, see Forums Help. *

*

* Endpoint to call When using the CLI or the Amazon Web Services SDK *

*

* For the current release of Organizations, specify the us-east-1 region for all Amazon Web Services API * and CLI calls made from the commercial Amazon Web Services Regions outside of China. If calling from one of the * Amazon Web Services Regions in China, then specify cn-northwest-1. You can do this in the CLI by using * these parameters and commands: *

*
    *
  • *

    * Use the following parameter with each command to specify both the endpoint and its region: *

    *

    * --endpoint-url https://organizations.us-east-1.amazonaws.com (from commercial Amazon Web Services * Regions outside of China) *

    *

    * or *

    *

    * --endpoint-url https://organizations.cn-northwest-1.amazonaws.com.cn (from Amazon Web Services * Regions in China) *

    *
  • *
  • *

    * Use the default endpoint, but configure your default region with this command: *

    *

    * aws configure set default.region us-east-1 (from commercial Amazon Web Services Regions outside of * China) *

    *

    * or *

    *

    * aws configure set default.region cn-northwest-1 (from Amazon Web Services Regions in China) *

    *
  • *
  • *

    * Use the following parameter with each command to specify the endpoint: *

    *

    * --region us-east-1 (from commercial Amazon Web Services Regions outside of China) *

    *

    * or *

    *

    * --region cn-northwest-1 (from Amazon Web Services Regions in China) *

    *
  • *
*

* Recording API Requests *

*

* Organizations supports CloudTrail, a service that records Amazon Web Services API calls for your Amazon Web Services * account and delivers log files to an Amazon S3 bucket. By using information collected by CloudTrail, you can * determine which requests the Organizations service received, who made the request and when, and so on. For more about * Organizations and its support for CloudTrail, see Logging Organizations API calls with CloudTrail in the Organizations User Guide. To learn more about * CloudTrail, including how to turn it on and find your log files, see the CloudTrail User * Guide. *

*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AWSOrganizationsAsyncClient extends AWSOrganizationsClient implements AWSOrganizationsAsync { private static final int DEFAULT_THREAD_POOL_SIZE = 50; private final java.util.concurrent.ExecutorService executorService; /** * Constructs a new asynchronous client to invoke service methods on Organizations. A credentials provider chain * will be used that searches for credentials in this order: *
    *
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • *
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • *
  • Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
  • *
  • Instance profile credentials delivered through the Amazon EC2 metadata service
  • *
*

* Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default * maximum number of concurrent connections to the service). * * @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain * @see java.util.concurrent.Executors#newFixedThreadPool(int) * @deprecated use {@link AWSOrganizationsAsyncClientBuilder#defaultClient()} */ @Deprecated public AWSOrganizationsAsyncClient() { this(DefaultAWSCredentialsProviderChain.getInstance()); } /** * Constructs a new asynchronous client to invoke service methods on Organizations. A credentials provider chain * will be used that searches for credentials in this order: *

    *
  • Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
  • *
  • Java System Properties - aws.accessKeyId and aws.secretKey
  • *
  • Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
  • *
  • Instance profile credentials delivered through the Amazon EC2 metadata service
  • *
*

* Asynchronous methods are delegated to a fixed-size thread pool containing a number of threads equal to the * maximum number of concurrent connections configured via {@code ClientConfiguration.getMaxConnections()}. * * @param clientConfiguration * The client configuration options controlling how this client connects to Organizations (ex: proxy * settings, retry counts, etc). * * @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain * @see java.util.concurrent.Executors#newFixedThreadPool(int) * @deprecated use {@link AWSOrganizationsAsyncClientBuilder#withClientConfiguration(ClientConfiguration)} */ @Deprecated public AWSOrganizationsAsyncClient(ClientConfiguration clientConfiguration) { this(DefaultAWSCredentialsProviderChain.getInstance(), clientConfiguration, newFixedThreadPool(clientConfiguration.getMaxConnections())); } /** * Constructs a new asynchronous client to invoke service methods on Organizations using the specified AWS account * credentials. *

* Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default * maximum number of concurrent connections to the service). * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when authenticating with AWS services. * @see java.util.concurrent.Executors#newFixedThreadPool(int) * @deprecated use {@link AWSOrganizationsAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} */ @Deprecated public AWSOrganizationsAsyncClient(AWSCredentials awsCredentials) { this(awsCredentials, newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE)); } /** * Constructs a new asynchronous client to invoke service methods on Organizations using the specified AWS account * credentials and executor service. Default client settings will be used. * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when authenticating with AWS services. * @param executorService * The executor service by which all asynchronous requests will be executed. * @deprecated use {@link AWSOrganizationsAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSOrganizationsAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)} */ @Deprecated public AWSOrganizationsAsyncClient(AWSCredentials awsCredentials, ExecutorService executorService) { this(awsCredentials, configFactory.getConfig(), executorService); } /** * Constructs a new asynchronous client to invoke service methods on Organizations using the specified AWS account * credentials, executor service, and client configuration options. * * @param awsCredentials * The AWS credentials (access key ID and secret key) to use when authenticating with AWS services. * @param clientConfiguration * Client configuration options (ex: max retry limit, proxy settings, etc). * @param executorService * The executor service by which all asynchronous requests will be executed. * @deprecated use {@link AWSOrganizationsAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSOrganizationsAsyncClientBuilder#withClientConfiguration(ClientConfiguration)} and * {@link AWSOrganizationsAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)} */ @Deprecated public AWSOrganizationsAsyncClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration, ExecutorService executorService) { super(awsCredentials, clientConfiguration); this.executorService = executorService; } /** * Constructs a new asynchronous client to invoke service methods on Organizations using the specified AWS account * credentials provider. Default client settings will be used. *

* Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default * maximum number of concurrent connections to the service). * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @see java.util.concurrent.Executors#newFixedThreadPool(int) * @deprecated use {@link AWSOrganizationsAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} */ @Deprecated public AWSOrganizationsAsyncClient(AWSCredentialsProvider awsCredentialsProvider) { this(awsCredentialsProvider, newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE)); } /** * Constructs a new asynchronous client to invoke service methods on Organizations using the provided AWS account * credentials provider and client configuration options. *

* Asynchronous methods are delegated to a fixed-size thread pool containing a number of threads equal to the * maximum number of concurrent connections configured via {@code ClientConfiguration.getMaxConnections()}. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @param clientConfiguration * Client configuration options (ex: max retry limit, proxy settings, etc). * * @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain * @see java.util.concurrent.Executors#newFixedThreadPool(int) * @deprecated use {@link AWSOrganizationsAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSOrganizationsAsyncClientBuilder#withClientConfiguration(ClientConfiguration)} */ @Deprecated public AWSOrganizationsAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) { this(awsCredentialsProvider, clientConfiguration, newFixedThreadPool(clientConfiguration.getMaxConnections())); } /** * Constructs a new asynchronous client to invoke service methods on Organizations using the specified AWS account * credentials provider and executor service. Default client settings will be used. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @param executorService * The executor service by which all asynchronous requests will be executed. * @deprecated use {@link AWSOrganizationsAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSOrganizationsAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)} */ @Deprecated public AWSOrganizationsAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ExecutorService executorService) { this(awsCredentialsProvider, configFactory.getConfig(), executorService); } /** * Constructs a new asynchronous client to invoke service methods on Organizations using the specified AWS account * credentials provider, executor service, and client configuration options. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @param clientConfiguration * Client configuration options (ex: max retry limit, proxy settings, etc). * @param executorService * The executor service by which all asynchronous requests will be executed. * @deprecated use {@link AWSOrganizationsAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSOrganizationsAsyncClientBuilder#withClientConfiguration(ClientConfiguration)} and * {@link AWSOrganizationsAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)} */ @Deprecated public AWSOrganizationsAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, ExecutorService executorService) { super(awsCredentialsProvider, clientConfiguration); this.executorService = executorService; } public static AWSOrganizationsAsyncClientBuilder asyncBuilder() { return AWSOrganizationsAsyncClientBuilder.standard(); } /** * Constructs a new asynchronous client to invoke service methods on Organizations using the specified parameters. * * @param asyncClientParams * Object providing client parameters. */ AWSOrganizationsAsyncClient(AwsAsyncClientParams asyncClientParams) { this(asyncClientParams, false); } /** * Constructs a new asynchronous client to invoke service methods on Organizations using the specified parameters. * * @param asyncClientParams * Object providing client parameters. * @param endpointDiscoveryEnabled * true will enable endpoint discovery if the service supports it. */ AWSOrganizationsAsyncClient(AwsAsyncClientParams asyncClientParams, boolean endpointDiscoveryEnabled) { super(asyncClientParams, endpointDiscoveryEnabled); this.executorService = asyncClientParams.getExecutor(); } /** * Returns the executor service used by this client to execute async requests. * * @return The executor service used by this client to execute async requests. */ public ExecutorService getExecutorService() { return executorService; } @Override public java.util.concurrent.Future acceptHandshakeAsync(AcceptHandshakeRequest request) { return acceptHandshakeAsync(request, null); } @Override public java.util.concurrent.Future acceptHandshakeAsync(final AcceptHandshakeRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final AcceptHandshakeRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public AcceptHandshakeResult call() throws Exception { AcceptHandshakeResult result = null; try { result = executeAcceptHandshake(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future attachPolicyAsync(AttachPolicyRequest request) { return attachPolicyAsync(request, null); } @Override public java.util.concurrent.Future attachPolicyAsync(final AttachPolicyRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final AttachPolicyRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public AttachPolicyResult call() throws Exception { AttachPolicyResult result = null; try { result = executeAttachPolicy(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future cancelHandshakeAsync(CancelHandshakeRequest request) { return cancelHandshakeAsync(request, null); } @Override public java.util.concurrent.Future cancelHandshakeAsync(final CancelHandshakeRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CancelHandshakeRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CancelHandshakeResult call() throws Exception { CancelHandshakeResult result = null; try { result = executeCancelHandshake(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future closeAccountAsync(CloseAccountRequest request) { return closeAccountAsync(request, null); } @Override public java.util.concurrent.Future closeAccountAsync(final CloseAccountRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CloseAccountRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CloseAccountResult call() throws Exception { CloseAccountResult result = null; try { result = executeCloseAccount(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future createAccountAsync(CreateAccountRequest request) { return createAccountAsync(request, null); } @Override public java.util.concurrent.Future createAccountAsync(final CreateAccountRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateAccountRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateAccountResult call() throws Exception { CreateAccountResult result = null; try { result = executeCreateAccount(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future createGovCloudAccountAsync(CreateGovCloudAccountRequest request) { return createGovCloudAccountAsync(request, null); } @Override public java.util.concurrent.Future createGovCloudAccountAsync(final CreateGovCloudAccountRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateGovCloudAccountRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateGovCloudAccountResult call() throws Exception { CreateGovCloudAccountResult result = null; try { result = executeCreateGovCloudAccount(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future createOrganizationAsync(CreateOrganizationRequest request) { return createOrganizationAsync(request, null); } @Override public java.util.concurrent.Future createOrganizationAsync(final CreateOrganizationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateOrganizationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateOrganizationResult call() throws Exception { CreateOrganizationResult result = null; try { result = executeCreateOrganization(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future createOrganizationalUnitAsync(CreateOrganizationalUnitRequest request) { return createOrganizationalUnitAsync(request, null); } @Override public java.util.concurrent.Future createOrganizationalUnitAsync(final CreateOrganizationalUnitRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateOrganizationalUnitRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateOrganizationalUnitResult call() throws Exception { CreateOrganizationalUnitResult result = null; try { result = executeCreateOrganizationalUnit(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future createPolicyAsync(CreatePolicyRequest request) { return createPolicyAsync(request, null); } @Override public java.util.concurrent.Future createPolicyAsync(final CreatePolicyRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreatePolicyRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreatePolicyResult call() throws Exception { CreatePolicyResult result = null; try { result = executeCreatePolicy(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future declineHandshakeAsync(DeclineHandshakeRequest request) { return declineHandshakeAsync(request, null); } @Override public java.util.concurrent.Future declineHandshakeAsync(final DeclineHandshakeRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeclineHandshakeRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeclineHandshakeResult call() throws Exception { DeclineHandshakeResult result = null; try { result = executeDeclineHandshake(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future deleteOrganizationAsync(DeleteOrganizationRequest request) { return deleteOrganizationAsync(request, null); } @Override public java.util.concurrent.Future deleteOrganizationAsync(final DeleteOrganizationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteOrganizationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteOrganizationResult call() throws Exception { DeleteOrganizationResult result = null; try { result = executeDeleteOrganization(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future deleteOrganizationalUnitAsync(DeleteOrganizationalUnitRequest request) { return deleteOrganizationalUnitAsync(request, null); } @Override public java.util.concurrent.Future deleteOrganizationalUnitAsync(final DeleteOrganizationalUnitRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteOrganizationalUnitRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteOrganizationalUnitResult call() throws Exception { DeleteOrganizationalUnitResult result = null; try { result = executeDeleteOrganizationalUnit(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future deletePolicyAsync(DeletePolicyRequest request) { return deletePolicyAsync(request, null); } @Override public java.util.concurrent.Future deletePolicyAsync(final DeletePolicyRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeletePolicyRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeletePolicyResult call() throws Exception { DeletePolicyResult result = null; try { result = executeDeletePolicy(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future deleteResourcePolicyAsync(DeleteResourcePolicyRequest request) { return deleteResourcePolicyAsync(request, null); } @Override public java.util.concurrent.Future deleteResourcePolicyAsync(final DeleteResourcePolicyRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteResourcePolicyRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteResourcePolicyResult call() throws Exception { DeleteResourcePolicyResult result = null; try { result = executeDeleteResourcePolicy(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future deregisterDelegatedAdministratorAsync( DeregisterDelegatedAdministratorRequest request) { return deregisterDelegatedAdministratorAsync(request, null); } @Override public java.util.concurrent.Future deregisterDelegatedAdministratorAsync( final DeregisterDelegatedAdministratorRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeregisterDelegatedAdministratorRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeregisterDelegatedAdministratorResult call() throws Exception { DeregisterDelegatedAdministratorResult result = null; try { result = executeDeregisterDelegatedAdministrator(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future describeAccountAsync(DescribeAccountRequest request) { return describeAccountAsync(request, null); } @Override public java.util.concurrent.Future describeAccountAsync(final DescribeAccountRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeAccountRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeAccountResult call() throws Exception { DescribeAccountResult result = null; try { result = executeDescribeAccount(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future describeCreateAccountStatusAsync(DescribeCreateAccountStatusRequest request) { return describeCreateAccountStatusAsync(request, null); } @Override public java.util.concurrent.Future describeCreateAccountStatusAsync(final DescribeCreateAccountStatusRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeCreateAccountStatusRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeCreateAccountStatusResult call() throws Exception { DescribeCreateAccountStatusResult result = null; try { result = executeDescribeCreateAccountStatus(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future describeEffectivePolicyAsync(DescribeEffectivePolicyRequest request) { return describeEffectivePolicyAsync(request, null); } @Override public java.util.concurrent.Future describeEffectivePolicyAsync(final DescribeEffectivePolicyRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeEffectivePolicyRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeEffectivePolicyResult call() throws Exception { DescribeEffectivePolicyResult result = null; try { result = executeDescribeEffectivePolicy(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future describeHandshakeAsync(DescribeHandshakeRequest request) { return describeHandshakeAsync(request, null); } @Override public java.util.concurrent.Future describeHandshakeAsync(final DescribeHandshakeRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeHandshakeRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeHandshakeResult call() throws Exception { DescribeHandshakeResult result = null; try { result = executeDescribeHandshake(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future describeOrganizationAsync(DescribeOrganizationRequest request) { return describeOrganizationAsync(request, null); } @Override public java.util.concurrent.Future describeOrganizationAsync(final DescribeOrganizationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeOrganizationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeOrganizationResult call() throws Exception { DescribeOrganizationResult result = null; try { result = executeDescribeOrganization(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future describeOrganizationalUnitAsync(DescribeOrganizationalUnitRequest request) { return describeOrganizationalUnitAsync(request, null); } @Override public java.util.concurrent.Future describeOrganizationalUnitAsync(final DescribeOrganizationalUnitRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeOrganizationalUnitRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeOrganizationalUnitResult call() throws Exception { DescribeOrganizationalUnitResult result = null; try { result = executeDescribeOrganizationalUnit(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future describePolicyAsync(DescribePolicyRequest request) { return describePolicyAsync(request, null); } @Override public java.util.concurrent.Future describePolicyAsync(final DescribePolicyRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribePolicyRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribePolicyResult call() throws Exception { DescribePolicyResult result = null; try { result = executeDescribePolicy(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future describeResourcePolicyAsync(DescribeResourcePolicyRequest request) { return describeResourcePolicyAsync(request, null); } @Override public java.util.concurrent.Future describeResourcePolicyAsync(final DescribeResourcePolicyRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeResourcePolicyRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeResourcePolicyResult call() throws Exception { DescribeResourcePolicyResult result = null; try { result = executeDescribeResourcePolicy(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future detachPolicyAsync(DetachPolicyRequest request) { return detachPolicyAsync(request, null); } @Override public java.util.concurrent.Future detachPolicyAsync(final DetachPolicyRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DetachPolicyRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DetachPolicyResult call() throws Exception { DetachPolicyResult result = null; try { result = executeDetachPolicy(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future disableAWSServiceAccessAsync(DisableAWSServiceAccessRequest request) { return disableAWSServiceAccessAsync(request, null); } @Override public java.util.concurrent.Future disableAWSServiceAccessAsync(final DisableAWSServiceAccessRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DisableAWSServiceAccessRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DisableAWSServiceAccessResult call() throws Exception { DisableAWSServiceAccessResult result = null; try { result = executeDisableAWSServiceAccess(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future disablePolicyTypeAsync(DisablePolicyTypeRequest request) { return disablePolicyTypeAsync(request, null); } @Override public java.util.concurrent.Future disablePolicyTypeAsync(final DisablePolicyTypeRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DisablePolicyTypeRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DisablePolicyTypeResult call() throws Exception { DisablePolicyTypeResult result = null; try { result = executeDisablePolicyType(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future enableAWSServiceAccessAsync(EnableAWSServiceAccessRequest request) { return enableAWSServiceAccessAsync(request, null); } @Override public java.util.concurrent.Future enableAWSServiceAccessAsync(final EnableAWSServiceAccessRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final EnableAWSServiceAccessRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public EnableAWSServiceAccessResult call() throws Exception { EnableAWSServiceAccessResult result = null; try { result = executeEnableAWSServiceAccess(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future enableAllFeaturesAsync(EnableAllFeaturesRequest request) { return enableAllFeaturesAsync(request, null); } @Override public java.util.concurrent.Future enableAllFeaturesAsync(final EnableAllFeaturesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final EnableAllFeaturesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public EnableAllFeaturesResult call() throws Exception { EnableAllFeaturesResult result = null; try { result = executeEnableAllFeatures(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future enablePolicyTypeAsync(EnablePolicyTypeRequest request) { return enablePolicyTypeAsync(request, null); } @Override public java.util.concurrent.Future enablePolicyTypeAsync(final EnablePolicyTypeRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final EnablePolicyTypeRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public EnablePolicyTypeResult call() throws Exception { EnablePolicyTypeResult result = null; try { result = executeEnablePolicyType(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future inviteAccountToOrganizationAsync(InviteAccountToOrganizationRequest request) { return inviteAccountToOrganizationAsync(request, null); } @Override public java.util.concurrent.Future inviteAccountToOrganizationAsync(final InviteAccountToOrganizationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final InviteAccountToOrganizationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public InviteAccountToOrganizationResult call() throws Exception { InviteAccountToOrganizationResult result = null; try { result = executeInviteAccountToOrganization(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future leaveOrganizationAsync(LeaveOrganizationRequest request) { return leaveOrganizationAsync(request, null); } @Override public java.util.concurrent.Future leaveOrganizationAsync(final LeaveOrganizationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final LeaveOrganizationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public LeaveOrganizationResult call() throws Exception { LeaveOrganizationResult result = null; try { result = executeLeaveOrganization(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listAWSServiceAccessForOrganizationAsync( ListAWSServiceAccessForOrganizationRequest request) { return listAWSServiceAccessForOrganizationAsync(request, null); } @Override public java.util.concurrent.Future listAWSServiceAccessForOrganizationAsync( final ListAWSServiceAccessForOrganizationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListAWSServiceAccessForOrganizationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListAWSServiceAccessForOrganizationResult call() throws Exception { ListAWSServiceAccessForOrganizationResult result = null; try { result = executeListAWSServiceAccessForOrganization(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listAccountsAsync(ListAccountsRequest request) { return listAccountsAsync(request, null); } @Override public java.util.concurrent.Future listAccountsAsync(final ListAccountsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListAccountsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListAccountsResult call() throws Exception { ListAccountsResult result = null; try { result = executeListAccounts(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listAccountsForParentAsync(ListAccountsForParentRequest request) { return listAccountsForParentAsync(request, null); } @Override public java.util.concurrent.Future listAccountsForParentAsync(final ListAccountsForParentRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListAccountsForParentRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListAccountsForParentResult call() throws Exception { ListAccountsForParentResult result = null; try { result = executeListAccountsForParent(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listChildrenAsync(ListChildrenRequest request) { return listChildrenAsync(request, null); } @Override public java.util.concurrent.Future listChildrenAsync(final ListChildrenRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListChildrenRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListChildrenResult call() throws Exception { ListChildrenResult result = null; try { result = executeListChildren(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listCreateAccountStatusAsync(ListCreateAccountStatusRequest request) { return listCreateAccountStatusAsync(request, null); } @Override public java.util.concurrent.Future listCreateAccountStatusAsync(final ListCreateAccountStatusRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListCreateAccountStatusRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListCreateAccountStatusResult call() throws Exception { ListCreateAccountStatusResult result = null; try { result = executeListCreateAccountStatus(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listDelegatedAdministratorsAsync(ListDelegatedAdministratorsRequest request) { return listDelegatedAdministratorsAsync(request, null); } @Override public java.util.concurrent.Future listDelegatedAdministratorsAsync(final ListDelegatedAdministratorsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListDelegatedAdministratorsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListDelegatedAdministratorsResult call() throws Exception { ListDelegatedAdministratorsResult result = null; try { result = executeListDelegatedAdministrators(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listDelegatedServicesForAccountAsync( ListDelegatedServicesForAccountRequest request) { return listDelegatedServicesForAccountAsync(request, null); } @Override public java.util.concurrent.Future listDelegatedServicesForAccountAsync( final ListDelegatedServicesForAccountRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListDelegatedServicesForAccountRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListDelegatedServicesForAccountResult call() throws Exception { ListDelegatedServicesForAccountResult result = null; try { result = executeListDelegatedServicesForAccount(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listHandshakesForAccountAsync(ListHandshakesForAccountRequest request) { return listHandshakesForAccountAsync(request, null); } @Override public java.util.concurrent.Future listHandshakesForAccountAsync(final ListHandshakesForAccountRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListHandshakesForAccountRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListHandshakesForAccountResult call() throws Exception { ListHandshakesForAccountResult result = null; try { result = executeListHandshakesForAccount(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listHandshakesForOrganizationAsync(ListHandshakesForOrganizationRequest request) { return listHandshakesForOrganizationAsync(request, null); } @Override public java.util.concurrent.Future listHandshakesForOrganizationAsync( final ListHandshakesForOrganizationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListHandshakesForOrganizationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListHandshakesForOrganizationResult call() throws Exception { ListHandshakesForOrganizationResult result = null; try { result = executeListHandshakesForOrganization(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listOrganizationalUnitsForParentAsync( ListOrganizationalUnitsForParentRequest request) { return listOrganizationalUnitsForParentAsync(request, null); } @Override public java.util.concurrent.Future listOrganizationalUnitsForParentAsync( final ListOrganizationalUnitsForParentRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListOrganizationalUnitsForParentRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListOrganizationalUnitsForParentResult call() throws Exception { ListOrganizationalUnitsForParentResult result = null; try { result = executeListOrganizationalUnitsForParent(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listParentsAsync(ListParentsRequest request) { return listParentsAsync(request, null); } @Override public java.util.concurrent.Future listParentsAsync(final ListParentsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListParentsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListParentsResult call() throws Exception { ListParentsResult result = null; try { result = executeListParents(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listPoliciesAsync(ListPoliciesRequest request) { return listPoliciesAsync(request, null); } @Override public java.util.concurrent.Future listPoliciesAsync(final ListPoliciesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListPoliciesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListPoliciesResult call() throws Exception { ListPoliciesResult result = null; try { result = executeListPolicies(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listPoliciesForTargetAsync(ListPoliciesForTargetRequest request) { return listPoliciesForTargetAsync(request, null); } @Override public java.util.concurrent.Future listPoliciesForTargetAsync(final ListPoliciesForTargetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListPoliciesForTargetRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListPoliciesForTargetResult call() throws Exception { ListPoliciesForTargetResult result = null; try { result = executeListPoliciesForTarget(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listRootsAsync(ListRootsRequest request) { return listRootsAsync(request, null); } @Override public java.util.concurrent.Future listRootsAsync(final ListRootsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListRootsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListRootsResult call() throws Exception { ListRootsResult result = null; try { result = executeListRoots(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listTagsForResourceAsync(ListTagsForResourceRequest request) { return listTagsForResourceAsync(request, null); } @Override public java.util.concurrent.Future listTagsForResourceAsync(final ListTagsForResourceRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListTagsForResourceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListTagsForResourceResult call() throws Exception { ListTagsForResourceResult result = null; try { result = executeListTagsForResource(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future listTargetsForPolicyAsync(ListTargetsForPolicyRequest request) { return listTargetsForPolicyAsync(request, null); } @Override public java.util.concurrent.Future listTargetsForPolicyAsync(final ListTargetsForPolicyRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListTargetsForPolicyRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListTargetsForPolicyResult call() throws Exception { ListTargetsForPolicyResult result = null; try { result = executeListTargetsForPolicy(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future moveAccountAsync(MoveAccountRequest request) { return moveAccountAsync(request, null); } @Override public java.util.concurrent.Future moveAccountAsync(final MoveAccountRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final MoveAccountRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public MoveAccountResult call() throws Exception { MoveAccountResult result = null; try { result = executeMoveAccount(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future putResourcePolicyAsync(PutResourcePolicyRequest request) { return putResourcePolicyAsync(request, null); } @Override public java.util.concurrent.Future putResourcePolicyAsync(final PutResourcePolicyRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final PutResourcePolicyRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public PutResourcePolicyResult call() throws Exception { PutResourcePolicyResult result = null; try { result = executePutResourcePolicy(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future registerDelegatedAdministratorAsync(RegisterDelegatedAdministratorRequest request) { return registerDelegatedAdministratorAsync(request, null); } @Override public java.util.concurrent.Future registerDelegatedAdministratorAsync( final RegisterDelegatedAdministratorRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final RegisterDelegatedAdministratorRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public RegisterDelegatedAdministratorResult call() throws Exception { RegisterDelegatedAdministratorResult result = null; try { result = executeRegisterDelegatedAdministrator(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future removeAccountFromOrganizationAsync(RemoveAccountFromOrganizationRequest request) { return removeAccountFromOrganizationAsync(request, null); } @Override public java.util.concurrent.Future removeAccountFromOrganizationAsync( final RemoveAccountFromOrganizationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final RemoveAccountFromOrganizationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public RemoveAccountFromOrganizationResult call() throws Exception { RemoveAccountFromOrganizationResult result = null; try { result = executeRemoveAccountFromOrganization(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future tagResourceAsync(TagResourceRequest request) { return tagResourceAsync(request, null); } @Override public java.util.concurrent.Future tagResourceAsync(final TagResourceRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final TagResourceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public TagResourceResult call() throws Exception { TagResourceResult result = null; try { result = executeTagResource(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future untagResourceAsync(UntagResourceRequest request) { return untagResourceAsync(request, null); } @Override public java.util.concurrent.Future untagResourceAsync(final UntagResourceRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UntagResourceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UntagResourceResult call() throws Exception { UntagResourceResult result = null; try { result = executeUntagResource(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future updateOrganizationalUnitAsync(UpdateOrganizationalUnitRequest request) { return updateOrganizationalUnitAsync(request, null); } @Override public java.util.concurrent.Future updateOrganizationalUnitAsync(final UpdateOrganizationalUnitRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateOrganizationalUnitRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateOrganizationalUnitResult call() throws Exception { UpdateOrganizationalUnitResult result = null; try { result = executeUpdateOrganizationalUnit(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } @Override public java.util.concurrent.Future updatePolicyAsync(UpdatePolicyRequest request) { return updatePolicyAsync(request, null); } @Override public java.util.concurrent.Future updatePolicyAsync(final UpdatePolicyRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdatePolicyRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdatePolicyResult call() throws Exception { UpdatePolicyResult result = null; try { result = executeUpdatePolicy(finalRequest); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(finalRequest, result); } return result; } }); } /** * Shuts down the client, releasing all managed resources. This includes forcibly terminating all pending * asynchronous service calls. Clients who wish to give pending asynchronous service calls time to complete should * call {@code getExecutorService().shutdown()} followed by {@code getExecutorService().awaitTermination()} prior to * calling this method. */ @Override public void shutdown() { super.shutdown(); executorService.shutdownNow(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy