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

com.amazonaws.services.ram.AWSRAMAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for AWS Resource Access Manager module holds the client classes that are used for communicating with AWS Resource Access Manager Service

There is a newer version: 1.12.780
Show 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.ram;

import javax.annotation.Generated;

import com.amazonaws.services.ram.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;

import java.util.concurrent.ExecutorService;

/**
 * Client for accessing RAM 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.
 * 

*

* This is the Resource Access Manager API Reference. This documentation provides descriptions and syntax for * each of the actions and data types in RAM. RAM is a service that helps you securely share your Amazon Web Services * resources to other Amazon Web Services accounts. If you use Organizations to manage your accounts, then you can share * your resources with your entire organization or to organizational units (OUs). For supported resource types, you can * also share resources with individual Identity and Access Management (IAM) roles and users. *

*

* To learn more about RAM, see the following resources: *

* */ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AWSRAMAsyncClient extends AWSRAMClient implements AWSRAMAsync { private static final int DEFAULT_THREAD_POOL_SIZE = 50; private final java.util.concurrent.ExecutorService executorService; public static AWSRAMAsyncClientBuilder asyncBuilder() { return AWSRAMAsyncClientBuilder.standard(); } /** * Constructs a new asynchronous client to invoke service methods on RAM using the specified parameters. * * @param asyncClientParams * Object providing client parameters. */ AWSRAMAsyncClient(AwsAsyncClientParams asyncClientParams) { this(asyncClientParams, false); } /** * Constructs a new asynchronous client to invoke service methods on RAM using the specified parameters. * * @param asyncClientParams * Object providing client parameters. * @param endpointDiscoveryEnabled * true will enable endpoint discovery if the service supports it. */ AWSRAMAsyncClient(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 acceptResourceShareInvitationAsync(AcceptResourceShareInvitationRequest request) { return acceptResourceShareInvitationAsync(request, null); } @Override public java.util.concurrent.Future acceptResourceShareInvitationAsync( final AcceptResourceShareInvitationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final AcceptResourceShareInvitationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public AcceptResourceShareInvitationResult call() throws Exception { AcceptResourceShareInvitationResult result = null; try { result = executeAcceptResourceShareInvitation(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 associateResourceShareAsync(AssociateResourceShareRequest request) { return associateResourceShareAsync(request, null); } @Override public java.util.concurrent.Future associateResourceShareAsync(final AssociateResourceShareRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final AssociateResourceShareRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public AssociateResourceShareResult call() throws Exception { AssociateResourceShareResult result = null; try { result = executeAssociateResourceShare(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 associateResourceSharePermissionAsync( AssociateResourceSharePermissionRequest request) { return associateResourceSharePermissionAsync(request, null); } @Override public java.util.concurrent.Future associateResourceSharePermissionAsync( final AssociateResourceSharePermissionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final AssociateResourceSharePermissionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public AssociateResourceSharePermissionResult call() throws Exception { AssociateResourceSharePermissionResult result = null; try { result = executeAssociateResourceSharePermission(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 createPermissionAsync(CreatePermissionRequest request) { return createPermissionAsync(request, null); } @Override public java.util.concurrent.Future createPermissionAsync(final CreatePermissionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreatePermissionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreatePermissionResult call() throws Exception { CreatePermissionResult result = null; try { result = executeCreatePermission(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 createPermissionVersionAsync(CreatePermissionVersionRequest request) { return createPermissionVersionAsync(request, null); } @Override public java.util.concurrent.Future createPermissionVersionAsync(final CreatePermissionVersionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreatePermissionVersionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreatePermissionVersionResult call() throws Exception { CreatePermissionVersionResult result = null; try { result = executeCreatePermissionVersion(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 createResourceShareAsync(CreateResourceShareRequest request) { return createResourceShareAsync(request, null); } @Override public java.util.concurrent.Future createResourceShareAsync(final CreateResourceShareRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateResourceShareRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateResourceShareResult call() throws Exception { CreateResourceShareResult result = null; try { result = executeCreateResourceShare(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 deletePermissionAsync(DeletePermissionRequest request) { return deletePermissionAsync(request, null); } @Override public java.util.concurrent.Future deletePermissionAsync(final DeletePermissionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeletePermissionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeletePermissionResult call() throws Exception { DeletePermissionResult result = null; try { result = executeDeletePermission(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 deletePermissionVersionAsync(DeletePermissionVersionRequest request) { return deletePermissionVersionAsync(request, null); } @Override public java.util.concurrent.Future deletePermissionVersionAsync(final DeletePermissionVersionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeletePermissionVersionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeletePermissionVersionResult call() throws Exception { DeletePermissionVersionResult result = null; try { result = executeDeletePermissionVersion(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 deleteResourceShareAsync(DeleteResourceShareRequest request) { return deleteResourceShareAsync(request, null); } @Override public java.util.concurrent.Future deleteResourceShareAsync(final DeleteResourceShareRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteResourceShareRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteResourceShareResult call() throws Exception { DeleteResourceShareResult result = null; try { result = executeDeleteResourceShare(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 disassociateResourceShareAsync(DisassociateResourceShareRequest request) { return disassociateResourceShareAsync(request, null); } @Override public java.util.concurrent.Future disassociateResourceShareAsync(final DisassociateResourceShareRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DisassociateResourceShareRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DisassociateResourceShareResult call() throws Exception { DisassociateResourceShareResult result = null; try { result = executeDisassociateResourceShare(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 disassociateResourceSharePermissionAsync( DisassociateResourceSharePermissionRequest request) { return disassociateResourceSharePermissionAsync(request, null); } @Override public java.util.concurrent.Future disassociateResourceSharePermissionAsync( final DisassociateResourceSharePermissionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DisassociateResourceSharePermissionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DisassociateResourceSharePermissionResult call() throws Exception { DisassociateResourceSharePermissionResult result = null; try { result = executeDisassociateResourceSharePermission(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 enableSharingWithAwsOrganizationAsync( EnableSharingWithAwsOrganizationRequest request) { return enableSharingWithAwsOrganizationAsync(request, null); } @Override public java.util.concurrent.Future enableSharingWithAwsOrganizationAsync( final EnableSharingWithAwsOrganizationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final EnableSharingWithAwsOrganizationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public EnableSharingWithAwsOrganizationResult call() throws Exception { EnableSharingWithAwsOrganizationResult result = null; try { result = executeEnableSharingWithAwsOrganization(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 getPermissionAsync(GetPermissionRequest request) { return getPermissionAsync(request, null); } @Override public java.util.concurrent.Future getPermissionAsync(final GetPermissionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetPermissionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetPermissionResult call() throws Exception { GetPermissionResult result = null; try { result = executeGetPermission(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 getResourcePoliciesAsync(GetResourcePoliciesRequest request) { return getResourcePoliciesAsync(request, null); } @Override public java.util.concurrent.Future getResourcePoliciesAsync(final GetResourcePoliciesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetResourcePoliciesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetResourcePoliciesResult call() throws Exception { GetResourcePoliciesResult result = null; try { result = executeGetResourcePolicies(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 getResourceShareAssociationsAsync(GetResourceShareAssociationsRequest request) { return getResourceShareAssociationsAsync(request, null); } @Override public java.util.concurrent.Future getResourceShareAssociationsAsync(final GetResourceShareAssociationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetResourceShareAssociationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetResourceShareAssociationsResult call() throws Exception { GetResourceShareAssociationsResult result = null; try { result = executeGetResourceShareAssociations(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 getResourceShareInvitationsAsync(GetResourceShareInvitationsRequest request) { return getResourceShareInvitationsAsync(request, null); } @Override public java.util.concurrent.Future getResourceShareInvitationsAsync(final GetResourceShareInvitationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetResourceShareInvitationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetResourceShareInvitationsResult call() throws Exception { GetResourceShareInvitationsResult result = null; try { result = executeGetResourceShareInvitations(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 getResourceSharesAsync(GetResourceSharesRequest request) { return getResourceSharesAsync(request, null); } @Override public java.util.concurrent.Future getResourceSharesAsync(final GetResourceSharesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetResourceSharesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetResourceSharesResult call() throws Exception { GetResourceSharesResult result = null; try { result = executeGetResourceShares(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 listPendingInvitationResourcesAsync(ListPendingInvitationResourcesRequest request) { return listPendingInvitationResourcesAsync(request, null); } @Override public java.util.concurrent.Future listPendingInvitationResourcesAsync( final ListPendingInvitationResourcesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListPendingInvitationResourcesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListPendingInvitationResourcesResult call() throws Exception { ListPendingInvitationResourcesResult result = null; try { result = executeListPendingInvitationResources(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 listPermissionAssociationsAsync(ListPermissionAssociationsRequest request) { return listPermissionAssociationsAsync(request, null); } @Override public java.util.concurrent.Future listPermissionAssociationsAsync(final ListPermissionAssociationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListPermissionAssociationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListPermissionAssociationsResult call() throws Exception { ListPermissionAssociationsResult result = null; try { result = executeListPermissionAssociations(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 listPermissionVersionsAsync(ListPermissionVersionsRequest request) { return listPermissionVersionsAsync(request, null); } @Override public java.util.concurrent.Future listPermissionVersionsAsync(final ListPermissionVersionsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListPermissionVersionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListPermissionVersionsResult call() throws Exception { ListPermissionVersionsResult result = null; try { result = executeListPermissionVersions(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 listPermissionsAsync(ListPermissionsRequest request) { return listPermissionsAsync(request, null); } @Override public java.util.concurrent.Future listPermissionsAsync(final ListPermissionsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListPermissionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListPermissionsResult call() throws Exception { ListPermissionsResult result = null; try { result = executeListPermissions(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 listPrincipalsAsync(ListPrincipalsRequest request) { return listPrincipalsAsync(request, null); } @Override public java.util.concurrent.Future listPrincipalsAsync(final ListPrincipalsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListPrincipalsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListPrincipalsResult call() throws Exception { ListPrincipalsResult result = null; try { result = executeListPrincipals(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 listReplacePermissionAssociationsWorkAsync( ListReplacePermissionAssociationsWorkRequest request) { return listReplacePermissionAssociationsWorkAsync(request, null); } @Override public java.util.concurrent.Future listReplacePermissionAssociationsWorkAsync( final ListReplacePermissionAssociationsWorkRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListReplacePermissionAssociationsWorkRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListReplacePermissionAssociationsWorkResult call() throws Exception { ListReplacePermissionAssociationsWorkResult result = null; try { result = executeListReplacePermissionAssociationsWork(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 listResourceSharePermissionsAsync(ListResourceSharePermissionsRequest request) { return listResourceSharePermissionsAsync(request, null); } @Override public java.util.concurrent.Future listResourceSharePermissionsAsync(final ListResourceSharePermissionsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListResourceSharePermissionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListResourceSharePermissionsResult call() throws Exception { ListResourceSharePermissionsResult result = null; try { result = executeListResourceSharePermissions(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 listResourceTypesAsync(ListResourceTypesRequest request) { return listResourceTypesAsync(request, null); } @Override public java.util.concurrent.Future listResourceTypesAsync(final ListResourceTypesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListResourceTypesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListResourceTypesResult call() throws Exception { ListResourceTypesResult result = null; try { result = executeListResourceTypes(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 listResourcesAsync(ListResourcesRequest request) { return listResourcesAsync(request, null); } @Override public java.util.concurrent.Future listResourcesAsync(final ListResourcesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ListResourcesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ListResourcesResult call() throws Exception { ListResourcesResult result = null; try { result = executeListResources(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 promotePermissionCreatedFromPolicyAsync( PromotePermissionCreatedFromPolicyRequest request) { return promotePermissionCreatedFromPolicyAsync(request, null); } @Override public java.util.concurrent.Future promotePermissionCreatedFromPolicyAsync( final PromotePermissionCreatedFromPolicyRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final PromotePermissionCreatedFromPolicyRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public PromotePermissionCreatedFromPolicyResult call() throws Exception { PromotePermissionCreatedFromPolicyResult result = null; try { result = executePromotePermissionCreatedFromPolicy(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 promoteResourceShareCreatedFromPolicyAsync( PromoteResourceShareCreatedFromPolicyRequest request) { return promoteResourceShareCreatedFromPolicyAsync(request, null); } @Override public java.util.concurrent.Future promoteResourceShareCreatedFromPolicyAsync( final PromoteResourceShareCreatedFromPolicyRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final PromoteResourceShareCreatedFromPolicyRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public PromoteResourceShareCreatedFromPolicyResult call() throws Exception { PromoteResourceShareCreatedFromPolicyResult result = null; try { result = executePromoteResourceShareCreatedFromPolicy(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 rejectResourceShareInvitationAsync(RejectResourceShareInvitationRequest request) { return rejectResourceShareInvitationAsync(request, null); } @Override public java.util.concurrent.Future rejectResourceShareInvitationAsync( final RejectResourceShareInvitationRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final RejectResourceShareInvitationRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public RejectResourceShareInvitationResult call() throws Exception { RejectResourceShareInvitationResult result = null; try { result = executeRejectResourceShareInvitation(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 replacePermissionAssociationsAsync(ReplacePermissionAssociationsRequest request) { return replacePermissionAssociationsAsync(request, null); } @Override public java.util.concurrent.Future replacePermissionAssociationsAsync( final ReplacePermissionAssociationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final ReplacePermissionAssociationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public ReplacePermissionAssociationsResult call() throws Exception { ReplacePermissionAssociationsResult result = null; try { result = executeReplacePermissionAssociations(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 setDefaultPermissionVersionAsync(SetDefaultPermissionVersionRequest request) { return setDefaultPermissionVersionAsync(request, null); } @Override public java.util.concurrent.Future setDefaultPermissionVersionAsync(final SetDefaultPermissionVersionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final SetDefaultPermissionVersionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public SetDefaultPermissionVersionResult call() throws Exception { SetDefaultPermissionVersionResult result = null; try { result = executeSetDefaultPermissionVersion(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 updateResourceShareAsync(UpdateResourceShareRequest request) { return updateResourceShareAsync(request, null); } @Override public java.util.concurrent.Future updateResourceShareAsync(final UpdateResourceShareRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateResourceShareRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateResourceShareResult call() throws Exception { UpdateResourceShareResult result = null; try { result = executeUpdateResourceShare(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 - 2025 Weber Informatics LLC | Privacy Policy