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

com.amazonaws.services.networkmanager.AWSNetworkManagerAsyncClient Maven / Gradle / Ivy

Go to download

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

There is a newer version: 1.12.780
Show newest version
/*
 * Copyright 2015-2020 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.networkmanager;

import javax.annotation.Generated;

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

import java.util.concurrent.ExecutorService;

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

*

* Transit Gateway Network Manager (Network Manager) enables you to create a global network, in which you can monitor * your AWS and on-premises networks that are built around transit gateways. *

*

* The Network Manager APIs are supported in the US West (Oregon) Region only. You must specify the * us-west-2 Region in all requests made to Network Manager. *

*/ @ThreadSafe @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AWSNetworkManagerAsyncClient extends AWSNetworkManagerClient implements AWSNetworkManagerAsync { private static final int DEFAULT_THREAD_POOL_SIZE = 50; private final java.util.concurrent.ExecutorService executorService; public static AWSNetworkManagerAsyncClientBuilder asyncBuilder() { return AWSNetworkManagerAsyncClientBuilder.standard(); } /** * Constructs a new asynchronous client to invoke service methods on NetworkManager using the specified parameters. * * @param asyncClientParams * Object providing client parameters. */ AWSNetworkManagerAsyncClient(AwsAsyncClientParams asyncClientParams) { this(asyncClientParams, false); } /** * Constructs a new asynchronous client to invoke service methods on NetworkManager using the specified parameters. * * @param asyncClientParams * Object providing client parameters. * @param endpointDiscoveryEnabled * true will enable endpoint discovery if the service supports it. */ AWSNetworkManagerAsyncClient(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 associateCustomerGatewayAsync(AssociateCustomerGatewayRequest request) { return associateCustomerGatewayAsync(request, null); } @Override public java.util.concurrent.Future associateCustomerGatewayAsync(final AssociateCustomerGatewayRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final AssociateCustomerGatewayRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public AssociateCustomerGatewayResult call() throws Exception { AssociateCustomerGatewayResult result = null; try { result = executeAssociateCustomerGateway(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 associateLinkAsync(AssociateLinkRequest request) { return associateLinkAsync(request, null); } @Override public java.util.concurrent.Future associateLinkAsync(final AssociateLinkRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final AssociateLinkRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public AssociateLinkResult call() throws Exception { AssociateLinkResult result = null; try { result = executeAssociateLink(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 associateTransitGatewayConnectPeerAsync( AssociateTransitGatewayConnectPeerRequest request) { return associateTransitGatewayConnectPeerAsync(request, null); } @Override public java.util.concurrent.Future associateTransitGatewayConnectPeerAsync( final AssociateTransitGatewayConnectPeerRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final AssociateTransitGatewayConnectPeerRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public AssociateTransitGatewayConnectPeerResult call() throws Exception { AssociateTransitGatewayConnectPeerResult result = null; try { result = executeAssociateTransitGatewayConnectPeer(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 createConnectionAsync(CreateConnectionRequest request) { return createConnectionAsync(request, null); } @Override public java.util.concurrent.Future createConnectionAsync(final CreateConnectionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateConnectionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateConnectionResult call() throws Exception { CreateConnectionResult result = null; try { result = executeCreateConnection(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 createDeviceAsync(CreateDeviceRequest request) { return createDeviceAsync(request, null); } @Override public java.util.concurrent.Future createDeviceAsync(final CreateDeviceRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateDeviceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateDeviceResult call() throws Exception { CreateDeviceResult result = null; try { result = executeCreateDevice(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 createGlobalNetworkAsync(CreateGlobalNetworkRequest request) { return createGlobalNetworkAsync(request, null); } @Override public java.util.concurrent.Future createGlobalNetworkAsync(final CreateGlobalNetworkRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateGlobalNetworkRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateGlobalNetworkResult call() throws Exception { CreateGlobalNetworkResult result = null; try { result = executeCreateGlobalNetwork(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 createLinkAsync(CreateLinkRequest request) { return createLinkAsync(request, null); } @Override public java.util.concurrent.Future createLinkAsync(final CreateLinkRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateLinkRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateLinkResult call() throws Exception { CreateLinkResult result = null; try { result = executeCreateLink(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 createSiteAsync(CreateSiteRequest request) { return createSiteAsync(request, null); } @Override public java.util.concurrent.Future createSiteAsync(final CreateSiteRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final CreateSiteRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateSiteResult call() throws Exception { CreateSiteResult result = null; try { result = executeCreateSite(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 deleteConnectionAsync(DeleteConnectionRequest request) { return deleteConnectionAsync(request, null); } @Override public java.util.concurrent.Future deleteConnectionAsync(final DeleteConnectionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteConnectionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteConnectionResult call() throws Exception { DeleteConnectionResult result = null; try { result = executeDeleteConnection(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 deleteDeviceAsync(DeleteDeviceRequest request) { return deleteDeviceAsync(request, null); } @Override public java.util.concurrent.Future deleteDeviceAsync(final DeleteDeviceRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteDeviceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteDeviceResult call() throws Exception { DeleteDeviceResult result = null; try { result = executeDeleteDevice(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 deleteGlobalNetworkAsync(DeleteGlobalNetworkRequest request) { return deleteGlobalNetworkAsync(request, null); } @Override public java.util.concurrent.Future deleteGlobalNetworkAsync(final DeleteGlobalNetworkRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteGlobalNetworkRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteGlobalNetworkResult call() throws Exception { DeleteGlobalNetworkResult result = null; try { result = executeDeleteGlobalNetwork(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 deleteLinkAsync(DeleteLinkRequest request) { return deleteLinkAsync(request, null); } @Override public java.util.concurrent.Future deleteLinkAsync(final DeleteLinkRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteLinkRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteLinkResult call() throws Exception { DeleteLinkResult result = null; try { result = executeDeleteLink(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 deleteSiteAsync(DeleteSiteRequest request) { return deleteSiteAsync(request, null); } @Override public java.util.concurrent.Future deleteSiteAsync(final DeleteSiteRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeleteSiteRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteSiteResult call() throws Exception { DeleteSiteResult result = null; try { result = executeDeleteSite(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 deregisterTransitGatewayAsync(DeregisterTransitGatewayRequest request) { return deregisterTransitGatewayAsync(request, null); } @Override public java.util.concurrent.Future deregisterTransitGatewayAsync(final DeregisterTransitGatewayRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DeregisterTransitGatewayRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DeregisterTransitGatewayResult call() throws Exception { DeregisterTransitGatewayResult result = null; try { result = executeDeregisterTransitGateway(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 describeGlobalNetworksAsync(DescribeGlobalNetworksRequest request) { return describeGlobalNetworksAsync(request, null); } @Override public java.util.concurrent.Future describeGlobalNetworksAsync(final DescribeGlobalNetworksRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DescribeGlobalNetworksRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DescribeGlobalNetworksResult call() throws Exception { DescribeGlobalNetworksResult result = null; try { result = executeDescribeGlobalNetworks(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 disassociateCustomerGatewayAsync(DisassociateCustomerGatewayRequest request) { return disassociateCustomerGatewayAsync(request, null); } @Override public java.util.concurrent.Future disassociateCustomerGatewayAsync(final DisassociateCustomerGatewayRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DisassociateCustomerGatewayRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DisassociateCustomerGatewayResult call() throws Exception { DisassociateCustomerGatewayResult result = null; try { result = executeDisassociateCustomerGateway(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 disassociateLinkAsync(DisassociateLinkRequest request) { return disassociateLinkAsync(request, null); } @Override public java.util.concurrent.Future disassociateLinkAsync(final DisassociateLinkRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DisassociateLinkRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DisassociateLinkResult call() throws Exception { DisassociateLinkResult result = null; try { result = executeDisassociateLink(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 disassociateTransitGatewayConnectPeerAsync( DisassociateTransitGatewayConnectPeerRequest request) { return disassociateTransitGatewayConnectPeerAsync(request, null); } @Override public java.util.concurrent.Future disassociateTransitGatewayConnectPeerAsync( final DisassociateTransitGatewayConnectPeerRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final DisassociateTransitGatewayConnectPeerRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public DisassociateTransitGatewayConnectPeerResult call() throws Exception { DisassociateTransitGatewayConnectPeerResult result = null; try { result = executeDisassociateTransitGatewayConnectPeer(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 getConnectionsAsync(GetConnectionsRequest request) { return getConnectionsAsync(request, null); } @Override public java.util.concurrent.Future getConnectionsAsync(final GetConnectionsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetConnectionsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetConnectionsResult call() throws Exception { GetConnectionsResult result = null; try { result = executeGetConnections(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 getCustomerGatewayAssociationsAsync(GetCustomerGatewayAssociationsRequest request) { return getCustomerGatewayAssociationsAsync(request, null); } @Override public java.util.concurrent.Future getCustomerGatewayAssociationsAsync( final GetCustomerGatewayAssociationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetCustomerGatewayAssociationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetCustomerGatewayAssociationsResult call() throws Exception { GetCustomerGatewayAssociationsResult result = null; try { result = executeGetCustomerGatewayAssociations(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 getDevicesAsync(GetDevicesRequest request) { return getDevicesAsync(request, null); } @Override public java.util.concurrent.Future getDevicesAsync(final GetDevicesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetDevicesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetDevicesResult call() throws Exception { GetDevicesResult result = null; try { result = executeGetDevices(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 getLinkAssociationsAsync(GetLinkAssociationsRequest request) { return getLinkAssociationsAsync(request, null); } @Override public java.util.concurrent.Future getLinkAssociationsAsync(final GetLinkAssociationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetLinkAssociationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetLinkAssociationsResult call() throws Exception { GetLinkAssociationsResult result = null; try { result = executeGetLinkAssociations(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 getLinksAsync(GetLinksRequest request) { return getLinksAsync(request, null); } @Override public java.util.concurrent.Future getLinksAsync(final GetLinksRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetLinksRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetLinksResult call() throws Exception { GetLinksResult result = null; try { result = executeGetLinks(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 getSitesAsync(GetSitesRequest request) { return getSitesAsync(request, null); } @Override public java.util.concurrent.Future getSitesAsync(final GetSitesRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetSitesRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetSitesResult call() throws Exception { GetSitesResult result = null; try { result = executeGetSites(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 getTransitGatewayConnectPeerAssociationsAsync( GetTransitGatewayConnectPeerAssociationsRequest request) { return getTransitGatewayConnectPeerAssociationsAsync(request, null); } @Override public java.util.concurrent.Future getTransitGatewayConnectPeerAssociationsAsync( final GetTransitGatewayConnectPeerAssociationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetTransitGatewayConnectPeerAssociationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetTransitGatewayConnectPeerAssociationsResult call() throws Exception { GetTransitGatewayConnectPeerAssociationsResult result = null; try { result = executeGetTransitGatewayConnectPeerAssociations(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 getTransitGatewayRegistrationsAsync(GetTransitGatewayRegistrationsRequest request) { return getTransitGatewayRegistrationsAsync(request, null); } @Override public java.util.concurrent.Future getTransitGatewayRegistrationsAsync( final GetTransitGatewayRegistrationsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final GetTransitGatewayRegistrationsRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public GetTransitGatewayRegistrationsResult call() throws Exception { GetTransitGatewayRegistrationsResult result = null; try { result = executeGetTransitGatewayRegistrations(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 registerTransitGatewayAsync(RegisterTransitGatewayRequest request) { return registerTransitGatewayAsync(request, null); } @Override public java.util.concurrent.Future registerTransitGatewayAsync(final RegisterTransitGatewayRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final RegisterTransitGatewayRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public RegisterTransitGatewayResult call() throws Exception { RegisterTransitGatewayResult result = null; try { result = executeRegisterTransitGateway(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 updateConnectionAsync(UpdateConnectionRequest request) { return updateConnectionAsync(request, null); } @Override public java.util.concurrent.Future updateConnectionAsync(final UpdateConnectionRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateConnectionRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateConnectionResult call() throws Exception { UpdateConnectionResult result = null; try { result = executeUpdateConnection(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 updateDeviceAsync(UpdateDeviceRequest request) { return updateDeviceAsync(request, null); } @Override public java.util.concurrent.Future updateDeviceAsync(final UpdateDeviceRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateDeviceRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateDeviceResult call() throws Exception { UpdateDeviceResult result = null; try { result = executeUpdateDevice(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 updateGlobalNetworkAsync(UpdateGlobalNetworkRequest request) { return updateGlobalNetworkAsync(request, null); } @Override public java.util.concurrent.Future updateGlobalNetworkAsync(final UpdateGlobalNetworkRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateGlobalNetworkRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateGlobalNetworkResult call() throws Exception { UpdateGlobalNetworkResult result = null; try { result = executeUpdateGlobalNetwork(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 updateLinkAsync(UpdateLinkRequest request) { return updateLinkAsync(request, null); } @Override public java.util.concurrent.Future updateLinkAsync(final UpdateLinkRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateLinkRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateLinkResult call() throws Exception { UpdateLinkResult result = null; try { result = executeUpdateLink(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 updateSiteAsync(UpdateSiteRequest request) { return updateSiteAsync(request, null); } @Override public java.util.concurrent.Future updateSiteAsync(final UpdateSiteRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { final UpdateSiteRequest finalRequest = beforeClientExecution(request); return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateSiteResult call() throws Exception { UpdateSiteResult result = null; try { result = executeUpdateSite(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