com.amazonaws.services.vpclattice.AmazonVPCLatticeAsyncClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk-vpclattice Show documentation
Show all versions of aws-java-sdk-vpclattice Show documentation
The AWS Java SDK for Amazon VPC Lattice module holds the client classes that are used for communicating with Amazon VPC Lattice Service
/*
* 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.vpclattice;
import javax.annotation.Generated;
import com.amazonaws.services.vpclattice.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import java.util.concurrent.ExecutorService;
/**
* Client for accessing Amazon VPC Lattice 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.
*
*
* Amazon VPC Lattice is a fully managed application networking service that you use to connect, secure, and monitor all
* of your services across multiple accounts and virtual private clouds (VPCs). Amazon VPC Lattice interconnects your
* microservices and legacy services within a logical boundary, so that you can discover and manage them more
* efficiently. For more information, see the Amazon VPC
* Lattice User Guide
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AmazonVPCLatticeAsyncClient extends AmazonVPCLatticeClient implements AmazonVPCLatticeAsync {
private static final int DEFAULT_THREAD_POOL_SIZE = 50;
private final java.util.concurrent.ExecutorService executorService;
public static AmazonVPCLatticeAsyncClientBuilder asyncBuilder() {
return AmazonVPCLatticeAsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon VPC Lattice using the specified
* parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AmazonVPCLatticeAsyncClient(AwsAsyncClientParams asyncClientParams) {
this(asyncClientParams, false);
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon VPC Lattice using the specified
* parameters.
*
* @param asyncClientParams
* Object providing client parameters.
* @param endpointDiscoveryEnabled
* true will enable endpoint discovery if the service supports it.
*/
AmazonVPCLatticeAsyncClient(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 batchUpdateRuleAsync(BatchUpdateRuleRequest request) {
return batchUpdateRuleAsync(request, null);
}
@Override
public java.util.concurrent.Future batchUpdateRuleAsync(final BatchUpdateRuleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final BatchUpdateRuleRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public BatchUpdateRuleResult call() throws Exception {
BatchUpdateRuleResult result = null;
try {
result = executeBatchUpdateRule(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 createAccessLogSubscriptionAsync(CreateAccessLogSubscriptionRequest request) {
return createAccessLogSubscriptionAsync(request, null);
}
@Override
public java.util.concurrent.Future createAccessLogSubscriptionAsync(final CreateAccessLogSubscriptionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateAccessLogSubscriptionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateAccessLogSubscriptionResult call() throws Exception {
CreateAccessLogSubscriptionResult result = null;
try {
result = executeCreateAccessLogSubscription(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 createListenerAsync(CreateListenerRequest request) {
return createListenerAsync(request, null);
}
@Override
public java.util.concurrent.Future createListenerAsync(final CreateListenerRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateListenerRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateListenerResult call() throws Exception {
CreateListenerResult result = null;
try {
result = executeCreateListener(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 createRuleAsync(CreateRuleRequest request) {
return createRuleAsync(request, null);
}
@Override
public java.util.concurrent.Future createRuleAsync(final CreateRuleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateRuleRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateRuleResult call() throws Exception {
CreateRuleResult result = null;
try {
result = executeCreateRule(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 createServiceAsync(CreateServiceRequest request) {
return createServiceAsync(request, null);
}
@Override
public java.util.concurrent.Future createServiceAsync(final CreateServiceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateServiceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateServiceResult call() throws Exception {
CreateServiceResult result = null;
try {
result = executeCreateService(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 createServiceNetworkAsync(CreateServiceNetworkRequest request) {
return createServiceNetworkAsync(request, null);
}
@Override
public java.util.concurrent.Future createServiceNetworkAsync(final CreateServiceNetworkRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateServiceNetworkRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateServiceNetworkResult call() throws Exception {
CreateServiceNetworkResult result = null;
try {
result = executeCreateServiceNetwork(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 createServiceNetworkServiceAssociationAsync(
CreateServiceNetworkServiceAssociationRequest request) {
return createServiceNetworkServiceAssociationAsync(request, null);
}
@Override
public java.util.concurrent.Future createServiceNetworkServiceAssociationAsync(
final CreateServiceNetworkServiceAssociationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateServiceNetworkServiceAssociationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateServiceNetworkServiceAssociationResult call() throws Exception {
CreateServiceNetworkServiceAssociationResult result = null;
try {
result = executeCreateServiceNetworkServiceAssociation(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 createServiceNetworkVpcAssociationAsync(
CreateServiceNetworkVpcAssociationRequest request) {
return createServiceNetworkVpcAssociationAsync(request, null);
}
@Override
public java.util.concurrent.Future createServiceNetworkVpcAssociationAsync(
final CreateServiceNetworkVpcAssociationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateServiceNetworkVpcAssociationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateServiceNetworkVpcAssociationResult call() throws Exception {
CreateServiceNetworkVpcAssociationResult result = null;
try {
result = executeCreateServiceNetworkVpcAssociation(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 createTargetGroupAsync(CreateTargetGroupRequest request) {
return createTargetGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future createTargetGroupAsync(final CreateTargetGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateTargetGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateTargetGroupResult call() throws Exception {
CreateTargetGroupResult result = null;
try {
result = executeCreateTargetGroup(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 deleteAccessLogSubscriptionAsync(DeleteAccessLogSubscriptionRequest request) {
return deleteAccessLogSubscriptionAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteAccessLogSubscriptionAsync(final DeleteAccessLogSubscriptionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteAccessLogSubscriptionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteAccessLogSubscriptionResult call() throws Exception {
DeleteAccessLogSubscriptionResult result = null;
try {
result = executeDeleteAccessLogSubscription(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 deleteAuthPolicyAsync(DeleteAuthPolicyRequest request) {
return deleteAuthPolicyAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteAuthPolicyAsync(final DeleteAuthPolicyRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteAuthPolicyRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteAuthPolicyResult call() throws Exception {
DeleteAuthPolicyResult result = null;
try {
result = executeDeleteAuthPolicy(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 deleteListenerAsync(DeleteListenerRequest request) {
return deleteListenerAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteListenerAsync(final DeleteListenerRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteListenerRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteListenerResult call() throws Exception {
DeleteListenerResult result = null;
try {
result = executeDeleteListener(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 deleteRuleAsync(DeleteRuleRequest request) {
return deleteRuleAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteRuleAsync(final DeleteRuleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteRuleRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteRuleResult call() throws Exception {
DeleteRuleResult result = null;
try {
result = executeDeleteRule(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 deleteServiceAsync(DeleteServiceRequest request) {
return deleteServiceAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteServiceAsync(final DeleteServiceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteServiceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteServiceResult call() throws Exception {
DeleteServiceResult result = null;
try {
result = executeDeleteService(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 deleteServiceNetworkAsync(DeleteServiceNetworkRequest request) {
return deleteServiceNetworkAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteServiceNetworkAsync(final DeleteServiceNetworkRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteServiceNetworkRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteServiceNetworkResult call() throws Exception {
DeleteServiceNetworkResult result = null;
try {
result = executeDeleteServiceNetwork(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 deleteServiceNetworkServiceAssociationAsync(
DeleteServiceNetworkServiceAssociationRequest request) {
return deleteServiceNetworkServiceAssociationAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteServiceNetworkServiceAssociationAsync(
final DeleteServiceNetworkServiceAssociationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteServiceNetworkServiceAssociationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteServiceNetworkServiceAssociationResult call() throws Exception {
DeleteServiceNetworkServiceAssociationResult result = null;
try {
result = executeDeleteServiceNetworkServiceAssociation(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 deleteServiceNetworkVpcAssociationAsync(
DeleteServiceNetworkVpcAssociationRequest request) {
return deleteServiceNetworkVpcAssociationAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteServiceNetworkVpcAssociationAsync(
final DeleteServiceNetworkVpcAssociationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteServiceNetworkVpcAssociationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteServiceNetworkVpcAssociationResult call() throws Exception {
DeleteServiceNetworkVpcAssociationResult result = null;
try {
result = executeDeleteServiceNetworkVpcAssociation(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 deleteTargetGroupAsync(DeleteTargetGroupRequest request) {
return deleteTargetGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteTargetGroupAsync(final DeleteTargetGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteTargetGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteTargetGroupResult call() throws Exception {
DeleteTargetGroupResult result = null;
try {
result = executeDeleteTargetGroup(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 deregisterTargetsAsync(DeregisterTargetsRequest request) {
return deregisterTargetsAsync(request, null);
}
@Override
public java.util.concurrent.Future deregisterTargetsAsync(final DeregisterTargetsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeregisterTargetsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeregisterTargetsResult call() throws Exception {
DeregisterTargetsResult result = null;
try {
result = executeDeregisterTargets(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 getAccessLogSubscriptionAsync(GetAccessLogSubscriptionRequest request) {
return getAccessLogSubscriptionAsync(request, null);
}
@Override
public java.util.concurrent.Future getAccessLogSubscriptionAsync(final GetAccessLogSubscriptionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetAccessLogSubscriptionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetAccessLogSubscriptionResult call() throws Exception {
GetAccessLogSubscriptionResult result = null;
try {
result = executeGetAccessLogSubscription(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 getAuthPolicyAsync(GetAuthPolicyRequest request) {
return getAuthPolicyAsync(request, null);
}
@Override
public java.util.concurrent.Future getAuthPolicyAsync(final GetAuthPolicyRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetAuthPolicyRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetAuthPolicyResult call() throws Exception {
GetAuthPolicyResult result = null;
try {
result = executeGetAuthPolicy(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 getListenerAsync(GetListenerRequest request) {
return getListenerAsync(request, null);
}
@Override
public java.util.concurrent.Future getListenerAsync(final GetListenerRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetListenerRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetListenerResult call() throws Exception {
GetListenerResult result = null;
try {
result = executeGetListener(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 getResourcePolicyAsync(GetResourcePolicyRequest request) {
return getResourcePolicyAsync(request, null);
}
@Override
public java.util.concurrent.Future getResourcePolicyAsync(final GetResourcePolicyRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetResourcePolicyRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetResourcePolicyResult call() throws Exception {
GetResourcePolicyResult result = null;
try {
result = executeGetResourcePolicy(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 getRuleAsync(GetRuleRequest request) {
return getRuleAsync(request, null);
}
@Override
public java.util.concurrent.Future getRuleAsync(final GetRuleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetRuleRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetRuleResult call() throws Exception {
GetRuleResult result = null;
try {
result = executeGetRule(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 getServiceAsync(GetServiceRequest request) {
return getServiceAsync(request, null);
}
@Override
public java.util.concurrent.Future getServiceAsync(final GetServiceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetServiceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetServiceResult call() throws Exception {
GetServiceResult result = null;
try {
result = executeGetService(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 getServiceNetworkAsync(GetServiceNetworkRequest request) {
return getServiceNetworkAsync(request, null);
}
@Override
public java.util.concurrent.Future getServiceNetworkAsync(final GetServiceNetworkRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetServiceNetworkRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetServiceNetworkResult call() throws Exception {
GetServiceNetworkResult result = null;
try {
result = executeGetServiceNetwork(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 getServiceNetworkServiceAssociationAsync(
GetServiceNetworkServiceAssociationRequest request) {
return getServiceNetworkServiceAssociationAsync(request, null);
}
@Override
public java.util.concurrent.Future getServiceNetworkServiceAssociationAsync(
final GetServiceNetworkServiceAssociationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetServiceNetworkServiceAssociationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetServiceNetworkServiceAssociationResult call() throws Exception {
GetServiceNetworkServiceAssociationResult result = null;
try {
result = executeGetServiceNetworkServiceAssociation(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 getServiceNetworkVpcAssociationAsync(
GetServiceNetworkVpcAssociationRequest request) {
return getServiceNetworkVpcAssociationAsync(request, null);
}
@Override
public java.util.concurrent.Future getServiceNetworkVpcAssociationAsync(
final GetServiceNetworkVpcAssociationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetServiceNetworkVpcAssociationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetServiceNetworkVpcAssociationResult call() throws Exception {
GetServiceNetworkVpcAssociationResult result = null;
try {
result = executeGetServiceNetworkVpcAssociation(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 getTargetGroupAsync(GetTargetGroupRequest request) {
return getTargetGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future getTargetGroupAsync(final GetTargetGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetTargetGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetTargetGroupResult call() throws Exception {
GetTargetGroupResult result = null;
try {
result = executeGetTargetGroup(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 listAccessLogSubscriptionsAsync(ListAccessLogSubscriptionsRequest request) {
return listAccessLogSubscriptionsAsync(request, null);
}
@Override
public java.util.concurrent.Future listAccessLogSubscriptionsAsync(final ListAccessLogSubscriptionsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListAccessLogSubscriptionsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListAccessLogSubscriptionsResult call() throws Exception {
ListAccessLogSubscriptionsResult result = null;
try {
result = executeListAccessLogSubscriptions(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 listListenersAsync(ListListenersRequest request) {
return listListenersAsync(request, null);
}
@Override
public java.util.concurrent.Future listListenersAsync(final ListListenersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListListenersRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListListenersResult call() throws Exception {
ListListenersResult result = null;
try {
result = executeListListeners(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 listRulesAsync(ListRulesRequest request) {
return listRulesAsync(request, null);
}
@Override
public java.util.concurrent.Future listRulesAsync(final ListRulesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListRulesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListRulesResult call() throws Exception {
ListRulesResult result = null;
try {
result = executeListRules(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 listServiceNetworkServiceAssociationsAsync(
ListServiceNetworkServiceAssociationsRequest request) {
return listServiceNetworkServiceAssociationsAsync(request, null);
}
@Override
public java.util.concurrent.Future listServiceNetworkServiceAssociationsAsync(
final ListServiceNetworkServiceAssociationsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListServiceNetworkServiceAssociationsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListServiceNetworkServiceAssociationsResult call() throws Exception {
ListServiceNetworkServiceAssociationsResult result = null;
try {
result = executeListServiceNetworkServiceAssociations(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 listServiceNetworkVpcAssociationsAsync(
ListServiceNetworkVpcAssociationsRequest request) {
return listServiceNetworkVpcAssociationsAsync(request, null);
}
@Override
public java.util.concurrent.Future listServiceNetworkVpcAssociationsAsync(
final ListServiceNetworkVpcAssociationsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListServiceNetworkVpcAssociationsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListServiceNetworkVpcAssociationsResult call() throws Exception {
ListServiceNetworkVpcAssociationsResult result = null;
try {
result = executeListServiceNetworkVpcAssociations(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 listServiceNetworksAsync(ListServiceNetworksRequest request) {
return listServiceNetworksAsync(request, null);
}
@Override
public java.util.concurrent.Future listServiceNetworksAsync(final ListServiceNetworksRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListServiceNetworksRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListServiceNetworksResult call() throws Exception {
ListServiceNetworksResult result = null;
try {
result = executeListServiceNetworks(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 listServicesAsync(ListServicesRequest request) {
return listServicesAsync(request, null);
}
@Override
public java.util.concurrent.Future listServicesAsync(final ListServicesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListServicesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListServicesResult call() throws Exception {
ListServicesResult result = null;
try {
result = executeListServices(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 listTargetGroupsAsync(ListTargetGroupsRequest request) {
return listTargetGroupsAsync(request, null);
}
@Override
public java.util.concurrent.Future listTargetGroupsAsync(final ListTargetGroupsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListTargetGroupsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListTargetGroupsResult call() throws Exception {
ListTargetGroupsResult result = null;
try {
result = executeListTargetGroups(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 listTargetsAsync(ListTargetsRequest request) {
return listTargetsAsync(request, null);
}
@Override
public java.util.concurrent.Future listTargetsAsync(final ListTargetsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListTargetsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListTargetsResult call() throws Exception {
ListTargetsResult result = null;
try {
result = executeListTargets(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 putAuthPolicyAsync(PutAuthPolicyRequest request) {
return putAuthPolicyAsync(request, null);
}
@Override
public java.util.concurrent.Future putAuthPolicyAsync(final PutAuthPolicyRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final PutAuthPolicyRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public PutAuthPolicyResult call() throws Exception {
PutAuthPolicyResult result = null;
try {
result = executePutAuthPolicy(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 registerTargetsAsync(RegisterTargetsRequest request) {
return registerTargetsAsync(request, null);
}
@Override
public java.util.concurrent.Future registerTargetsAsync(final RegisterTargetsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final RegisterTargetsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public RegisterTargetsResult call() throws Exception {
RegisterTargetsResult result = null;
try {
result = executeRegisterTargets(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 updateAccessLogSubscriptionAsync(UpdateAccessLogSubscriptionRequest request) {
return updateAccessLogSubscriptionAsync(request, null);
}
@Override
public java.util.concurrent.Future updateAccessLogSubscriptionAsync(final UpdateAccessLogSubscriptionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateAccessLogSubscriptionRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateAccessLogSubscriptionResult call() throws Exception {
UpdateAccessLogSubscriptionResult result = null;
try {
result = executeUpdateAccessLogSubscription(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 updateListenerAsync(UpdateListenerRequest request) {
return updateListenerAsync(request, null);
}
@Override
public java.util.concurrent.Future updateListenerAsync(final UpdateListenerRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateListenerRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateListenerResult call() throws Exception {
UpdateListenerResult result = null;
try {
result = executeUpdateListener(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 updateRuleAsync(UpdateRuleRequest request) {
return updateRuleAsync(request, null);
}
@Override
public java.util.concurrent.Future updateRuleAsync(final UpdateRuleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateRuleRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateRuleResult call() throws Exception {
UpdateRuleResult result = null;
try {
result = executeUpdateRule(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 updateServiceAsync(UpdateServiceRequest request) {
return updateServiceAsync(request, null);
}
@Override
public java.util.concurrent.Future updateServiceAsync(final UpdateServiceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateServiceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateServiceResult call() throws Exception {
UpdateServiceResult result = null;
try {
result = executeUpdateService(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 updateServiceNetworkAsync(UpdateServiceNetworkRequest request) {
return updateServiceNetworkAsync(request, null);
}
@Override
public java.util.concurrent.Future updateServiceNetworkAsync(final UpdateServiceNetworkRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateServiceNetworkRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateServiceNetworkResult call() throws Exception {
UpdateServiceNetworkResult result = null;
try {
result = executeUpdateServiceNetwork(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 updateServiceNetworkVpcAssociationAsync(
UpdateServiceNetworkVpcAssociationRequest request) {
return updateServiceNetworkVpcAssociationAsync(request, null);
}
@Override
public java.util.concurrent.Future updateServiceNetworkVpcAssociationAsync(
final UpdateServiceNetworkVpcAssociationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateServiceNetworkVpcAssociationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateServiceNetworkVpcAssociationResult call() throws Exception {
UpdateServiceNetworkVpcAssociationResult result = null;
try {
result = executeUpdateServiceNetworkVpcAssociation(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 updateTargetGroupAsync(UpdateTargetGroupRequest request) {
return updateTargetGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future updateTargetGroupAsync(final UpdateTargetGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateTargetGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateTargetGroupResult call() throws Exception {
UpdateTargetGroupResult result = null;
try {
result = executeUpdateTargetGroup(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();
}
}