com.amazonaws.services.wafv2.AWSWAFV2AsyncClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-wafv2 Show documentation
/*
* 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.wafv2;
import javax.annotation.Generated;
import com.amazonaws.services.wafv2.model.*;
import com.amazonaws.client.AwsAsyncClientParams;
import com.amazonaws.annotation.ThreadSafe;
import java.util.concurrent.ExecutorService;
/**
* Client for accessing WAFV2 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 latest version of the AWS WAF API, released in November, 2019. The names of the entities that you
* use to access this API, like endpoints and namespaces, all have the versioning information added, like "V2" or "v2",
* to distinguish from the prior version. We recommend migrating your resources to this version, because it has a number
* of significant improvements.
*
*
* If you used AWS WAF prior to this release, you can't use this AWS WAFV2 API to access any AWS WAF resources that you
* created before. You can access your old rules, web ACLs, and other AWS WAF resources only through the AWS WAF Classic
* APIs. The AWS WAF Classic APIs have retained the prior names, endpoints, and namespaces.
*
*
* For information, including how to migrate your AWS WAF resources to this version, see the AWS WAF Developer Guide.
*
*
*
* AWS WAF is a web application firewall that lets you monitor the HTTP and HTTPS requests that are forwarded to Amazon
* CloudFront, an Amazon API Gateway API, or an Application Load Balancer. AWS WAF also lets you control access to your
* content. Based on conditions that you specify, such as the IP addresses that requests originate from or the values of
* query strings, API Gateway, CloudFront, or the Application Load Balancer responds to requests either with the
* requested content or with an HTTP 403 status code (Forbidden). You also can configure CloudFront to return a custom
* error page when a request is blocked.
*
*
* This API guide is for developers who need detailed information about AWS WAF API actions, data types, and errors. For
* detailed information about AWS WAF features and an overview of how to use AWS WAF, see the AWS WAF Developer Guide.
*
*
* You can make calls using the endpoints listed in AWS Service Endpoints for AWS WAF.
*
*
* -
*
* For regional applications, you can use any of the endpoints in the list. A regional application can be an Application
* Load Balancer (ALB) or an API Gateway stage.
*
*
* -
*
* For AWS CloudFront applications, you must use the API endpoint listed for US East (N. Virginia): us-east-1.
*
*
*
*
* Alternatively, you can use one of the AWS SDKs to access an API that's tailored to the programming language or
* platform that you're using. For more information, see AWS SDKs.
*
*
* We currently provide two versions of the AWS WAF API: this API and the prior versions, the classic AWS WAF APIs. This
* new API provides the same functionality as the older versions, with the following major improvements:
*
*
* -
*
* You use one API for both global and regional applications. Where you need to distinguish the scope, you specify a
* Scope
parameter and set it to CLOUDFRONT
or REGIONAL
.
*
*
* -
*
* You can define a Web ACL or rule group with a single call, and update it with a single call. You define all rule
* specifications in JSON format, and pass them to your rule group or Web ACL calls.
*
*
* -
*
* The limits AWS WAF places on the use of rules more closely reflects the cost of running each type of rule. Rule
* groups include capacity settings, so you know the maximum cost of a rule group when you use it.
*
*
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSWAFV2AsyncClient extends AWSWAFV2Client implements AWSWAFV2Async {
private static final int DEFAULT_THREAD_POOL_SIZE = 50;
private final java.util.concurrent.ExecutorService executorService;
public static AWSWAFV2AsyncClientBuilder asyncBuilder() {
return AWSWAFV2AsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on WAFV2 using the specified parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AWSWAFV2AsyncClient(AwsAsyncClientParams asyncClientParams) {
super(asyncClientParams);
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 associateWebACLAsync(AssociateWebACLRequest request) {
return associateWebACLAsync(request, null);
}
@Override
public java.util.concurrent.Future associateWebACLAsync(final AssociateWebACLRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AssociateWebACLRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AssociateWebACLResult call() throws Exception {
AssociateWebACLResult result = null;
try {
result = executeAssociateWebACL(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 checkCapacityAsync(CheckCapacityRequest request) {
return checkCapacityAsync(request, null);
}
@Override
public java.util.concurrent.Future checkCapacityAsync(final CheckCapacityRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CheckCapacityRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CheckCapacityResult call() throws Exception {
CheckCapacityResult result = null;
try {
result = executeCheckCapacity(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 createIPSetAsync(CreateIPSetRequest request) {
return createIPSetAsync(request, null);
}
@Override
public java.util.concurrent.Future createIPSetAsync(final CreateIPSetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateIPSetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateIPSetResult call() throws Exception {
CreateIPSetResult result = null;
try {
result = executeCreateIPSet(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 createRegexPatternSetAsync(CreateRegexPatternSetRequest request) {
return createRegexPatternSetAsync(request, null);
}
@Override
public java.util.concurrent.Future createRegexPatternSetAsync(final CreateRegexPatternSetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateRegexPatternSetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateRegexPatternSetResult call() throws Exception {
CreateRegexPatternSetResult result = null;
try {
result = executeCreateRegexPatternSet(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 createRuleGroupAsync(CreateRuleGroupRequest request) {
return createRuleGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future createRuleGroupAsync(final CreateRuleGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateRuleGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateRuleGroupResult call() throws Exception {
CreateRuleGroupResult result = null;
try {
result = executeCreateRuleGroup(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 createWebACLAsync(CreateWebACLRequest request) {
return createWebACLAsync(request, null);
}
@Override
public java.util.concurrent.Future createWebACLAsync(final CreateWebACLRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateWebACLRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CreateWebACLResult call() throws Exception {
CreateWebACLResult result = null;
try {
result = executeCreateWebACL(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 deleteFirewallManagerRuleGroupsAsync(
DeleteFirewallManagerRuleGroupsRequest request) {
return deleteFirewallManagerRuleGroupsAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteFirewallManagerRuleGroupsAsync(
final DeleteFirewallManagerRuleGroupsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteFirewallManagerRuleGroupsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteFirewallManagerRuleGroupsResult call() throws Exception {
DeleteFirewallManagerRuleGroupsResult result = null;
try {
result = executeDeleteFirewallManagerRuleGroups(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 deleteIPSetAsync(DeleteIPSetRequest request) {
return deleteIPSetAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteIPSetAsync(final DeleteIPSetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteIPSetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteIPSetResult call() throws Exception {
DeleteIPSetResult result = null;
try {
result = executeDeleteIPSet(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 deleteLoggingConfigurationAsync(DeleteLoggingConfigurationRequest request) {
return deleteLoggingConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteLoggingConfigurationAsync(final DeleteLoggingConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteLoggingConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteLoggingConfigurationResult call() throws Exception {
DeleteLoggingConfigurationResult result = null;
try {
result = executeDeleteLoggingConfiguration(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 deletePermissionPolicyAsync(DeletePermissionPolicyRequest request) {
return deletePermissionPolicyAsync(request, null);
}
@Override
public java.util.concurrent.Future deletePermissionPolicyAsync(final DeletePermissionPolicyRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeletePermissionPolicyRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeletePermissionPolicyResult call() throws Exception {
DeletePermissionPolicyResult result = null;
try {
result = executeDeletePermissionPolicy(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 deleteRegexPatternSetAsync(DeleteRegexPatternSetRequest request) {
return deleteRegexPatternSetAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteRegexPatternSetAsync(final DeleteRegexPatternSetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteRegexPatternSetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteRegexPatternSetResult call() throws Exception {
DeleteRegexPatternSetResult result = null;
try {
result = executeDeleteRegexPatternSet(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 deleteRuleGroupAsync(DeleteRuleGroupRequest request) {
return deleteRuleGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteRuleGroupAsync(final DeleteRuleGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteRuleGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteRuleGroupResult call() throws Exception {
DeleteRuleGroupResult result = null;
try {
result = executeDeleteRuleGroup(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 deleteWebACLAsync(DeleteWebACLRequest request) {
return deleteWebACLAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteWebACLAsync(final DeleteWebACLRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteWebACLRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteWebACLResult call() throws Exception {
DeleteWebACLResult result = null;
try {
result = executeDeleteWebACL(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 describeManagedRuleGroupAsync(DescribeManagedRuleGroupRequest request) {
return describeManagedRuleGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future describeManagedRuleGroupAsync(final DescribeManagedRuleGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeManagedRuleGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeManagedRuleGroupResult call() throws Exception {
DescribeManagedRuleGroupResult result = null;
try {
result = executeDescribeManagedRuleGroup(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 disassociateWebACLAsync(DisassociateWebACLRequest request) {
return disassociateWebACLAsync(request, null);
}
@Override
public java.util.concurrent.Future disassociateWebACLAsync(final DisassociateWebACLRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DisassociateWebACLRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DisassociateWebACLResult call() throws Exception {
DisassociateWebACLResult result = null;
try {
result = executeDisassociateWebACL(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 getIPSetAsync(GetIPSetRequest request) {
return getIPSetAsync(request, null);
}
@Override
public java.util.concurrent.Future getIPSetAsync(final GetIPSetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetIPSetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetIPSetResult call() throws Exception {
GetIPSetResult result = null;
try {
result = executeGetIPSet(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 getLoggingConfigurationAsync(GetLoggingConfigurationRequest request) {
return getLoggingConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future getLoggingConfigurationAsync(final GetLoggingConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetLoggingConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetLoggingConfigurationResult call() throws Exception {
GetLoggingConfigurationResult result = null;
try {
result = executeGetLoggingConfiguration(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 getPermissionPolicyAsync(GetPermissionPolicyRequest request) {
return getPermissionPolicyAsync(request, null);
}
@Override
public java.util.concurrent.Future getPermissionPolicyAsync(final GetPermissionPolicyRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetPermissionPolicyRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetPermissionPolicyResult call() throws Exception {
GetPermissionPolicyResult result = null;
try {
result = executeGetPermissionPolicy(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 getRateBasedStatementManagedKeysAsync(
GetRateBasedStatementManagedKeysRequest request) {
return getRateBasedStatementManagedKeysAsync(request, null);
}
@Override
public java.util.concurrent.Future getRateBasedStatementManagedKeysAsync(
final GetRateBasedStatementManagedKeysRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetRateBasedStatementManagedKeysRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetRateBasedStatementManagedKeysResult call() throws Exception {
GetRateBasedStatementManagedKeysResult result = null;
try {
result = executeGetRateBasedStatementManagedKeys(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 getRegexPatternSetAsync(GetRegexPatternSetRequest request) {
return getRegexPatternSetAsync(request, null);
}
@Override
public java.util.concurrent.Future getRegexPatternSetAsync(final GetRegexPatternSetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetRegexPatternSetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetRegexPatternSetResult call() throws Exception {
GetRegexPatternSetResult result = null;
try {
result = executeGetRegexPatternSet(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 getRuleGroupAsync(GetRuleGroupRequest request) {
return getRuleGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future getRuleGroupAsync(final GetRuleGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetRuleGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetRuleGroupResult call() throws Exception {
GetRuleGroupResult result = null;
try {
result = executeGetRuleGroup(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 getSampledRequestsAsync(GetSampledRequestsRequest request) {
return getSampledRequestsAsync(request, null);
}
@Override
public java.util.concurrent.Future getSampledRequestsAsync(final GetSampledRequestsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetSampledRequestsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetSampledRequestsResult call() throws Exception {
GetSampledRequestsResult result = null;
try {
result = executeGetSampledRequests(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 getWebACLAsync(GetWebACLRequest request) {
return getWebACLAsync(request, null);
}
@Override
public java.util.concurrent.Future getWebACLAsync(final GetWebACLRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetWebACLRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetWebACLResult call() throws Exception {
GetWebACLResult result = null;
try {
result = executeGetWebACL(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 getWebACLForResourceAsync(GetWebACLForResourceRequest request) {
return getWebACLForResourceAsync(request, null);
}
@Override
public java.util.concurrent.Future getWebACLForResourceAsync(final GetWebACLForResourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final GetWebACLForResourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public GetWebACLForResourceResult call() throws Exception {
GetWebACLForResourceResult result = null;
try {
result = executeGetWebACLForResource(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 listAvailableManagedRuleGroupsAsync(ListAvailableManagedRuleGroupsRequest request) {
return listAvailableManagedRuleGroupsAsync(request, null);
}
@Override
public java.util.concurrent.Future listAvailableManagedRuleGroupsAsync(
final ListAvailableManagedRuleGroupsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListAvailableManagedRuleGroupsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListAvailableManagedRuleGroupsResult call() throws Exception {
ListAvailableManagedRuleGroupsResult result = null;
try {
result = executeListAvailableManagedRuleGroups(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 listIPSetsAsync(ListIPSetsRequest request) {
return listIPSetsAsync(request, null);
}
@Override
public java.util.concurrent.Future listIPSetsAsync(final ListIPSetsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListIPSetsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListIPSetsResult call() throws Exception {
ListIPSetsResult result = null;
try {
result = executeListIPSets(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 listLoggingConfigurationsAsync(ListLoggingConfigurationsRequest request) {
return listLoggingConfigurationsAsync(request, null);
}
@Override
public java.util.concurrent.Future listLoggingConfigurationsAsync(final ListLoggingConfigurationsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListLoggingConfigurationsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListLoggingConfigurationsResult call() throws Exception {
ListLoggingConfigurationsResult result = null;
try {
result = executeListLoggingConfigurations(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 listRegexPatternSetsAsync(ListRegexPatternSetsRequest request) {
return listRegexPatternSetsAsync(request, null);
}
@Override
public java.util.concurrent.Future listRegexPatternSetsAsync(final ListRegexPatternSetsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListRegexPatternSetsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListRegexPatternSetsResult call() throws Exception {
ListRegexPatternSetsResult result = null;
try {
result = executeListRegexPatternSets(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 listResourcesForWebACLAsync(ListResourcesForWebACLRequest request) {
return listResourcesForWebACLAsync(request, null);
}
@Override
public java.util.concurrent.Future listResourcesForWebACLAsync(final ListResourcesForWebACLRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListResourcesForWebACLRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListResourcesForWebACLResult call() throws Exception {
ListResourcesForWebACLResult result = null;
try {
result = executeListResourcesForWebACL(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 listRuleGroupsAsync(ListRuleGroupsRequest request) {
return listRuleGroupsAsync(request, null);
}
@Override
public java.util.concurrent.Future listRuleGroupsAsync(final ListRuleGroupsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListRuleGroupsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListRuleGroupsResult call() throws Exception {
ListRuleGroupsResult result = null;
try {
result = executeListRuleGroups(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 listWebACLsAsync(ListWebACLsRequest request) {
return listWebACLsAsync(request, null);
}
@Override
public java.util.concurrent.Future listWebACLsAsync(final ListWebACLsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListWebACLsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListWebACLsResult call() throws Exception {
ListWebACLsResult result = null;
try {
result = executeListWebACLs(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 putLoggingConfigurationAsync(PutLoggingConfigurationRequest request) {
return putLoggingConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future putLoggingConfigurationAsync(final PutLoggingConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final PutLoggingConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public PutLoggingConfigurationResult call() throws Exception {
PutLoggingConfigurationResult result = null;
try {
result = executePutLoggingConfiguration(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 putPermissionPolicyAsync(PutPermissionPolicyRequest request) {
return putPermissionPolicyAsync(request, null);
}
@Override
public java.util.concurrent.Future putPermissionPolicyAsync(final PutPermissionPolicyRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final PutPermissionPolicyRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public PutPermissionPolicyResult call() throws Exception {
PutPermissionPolicyResult result = null;
try {
result = executePutPermissionPolicy(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 updateIPSetAsync(UpdateIPSetRequest request) {
return updateIPSetAsync(request, null);
}
@Override
public java.util.concurrent.Future updateIPSetAsync(final UpdateIPSetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateIPSetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateIPSetResult call() throws Exception {
UpdateIPSetResult result = null;
try {
result = executeUpdateIPSet(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 updateRegexPatternSetAsync(UpdateRegexPatternSetRequest request) {
return updateRegexPatternSetAsync(request, null);
}
@Override
public java.util.concurrent.Future updateRegexPatternSetAsync(final UpdateRegexPatternSetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateRegexPatternSetRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateRegexPatternSetResult call() throws Exception {
UpdateRegexPatternSetResult result = null;
try {
result = executeUpdateRegexPatternSet(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 updateRuleGroupAsync(UpdateRuleGroupRequest request) {
return updateRuleGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future updateRuleGroupAsync(final UpdateRuleGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateRuleGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateRuleGroupResult call() throws Exception {
UpdateRuleGroupResult result = null;
try {
result = executeUpdateRuleGroup(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 updateWebACLAsync(UpdateWebACLRequest request) {
return updateWebACLAsync(request, null);
}
@Override
public java.util.concurrent.Future updateWebACLAsync(final UpdateWebACLRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final UpdateWebACLRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public UpdateWebACLResult call() throws Exception {
UpdateWebACLResult result = null;
try {
result = executeUpdateWebACL(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();
}
}