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

com.amazonaws.services.waf.AWSWAFAsyncClient Maven / Gradle / Ivy

Go to download

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

There is a newer version: 1.12.780
Show newest version
/*
 * Copyright 2012-2017 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.waf;

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

import javax.annotation.Generated;

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

/**
 * Client for accessing WAF 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 AWS WAF API Reference for using AWS WAF with Amazon CloudFront. The AWS WAF actions and data types * listed in the reference are available for protecting Amazon CloudFront distributions. You can use these actions and * data types via the endpoint waf.amazonaws.com. This guide is for developers who need detailed information * about the AWS WAF API actions, data types, and errors. For detailed information about AWS WAF features and an * overview of how to use the AWS WAF API, see the AWS * WAF Developer Guide. *

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

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

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

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

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

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

* Asynchronous methods are delegated to a fixed-size thread pool containing a number of threads equal to the * maximum number of concurrent connections configured via {@code ClientConfiguration.getMaxConnections()}. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @param clientConfiguration * Client configuration options (ex: max retry limit, proxy settings, etc). * * @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain * @see java.util.concurrent.Executors#newFixedThreadPool(int) * @deprecated use {@link AWSWAFAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSWAFAsyncClientBuilder#withClientConfiguration(ClientConfiguration)} */ @Deprecated public AWSWAFAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) { this(awsCredentialsProvider, clientConfiguration, newFixedThreadPool(clientConfiguration.getMaxConnections())); } /** * Constructs a new asynchronous client to invoke service methods on WAF using the specified AWS account credentials * provider and executor service. Default client settings will be used. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @param executorService * The executor service by which all asynchronous requests will be executed. * @deprecated use {@link AWSWAFAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSWAFAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)} */ @Deprecated public AWSWAFAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ExecutorService executorService) { this(awsCredentialsProvider, configFactory.getConfig(), executorService); } /** * Constructs a new asynchronous client to invoke service methods on WAF using the specified AWS account credentials * provider, executor service, and client configuration options. * * @param awsCredentialsProvider * The AWS credentials provider which will provide credentials to authenticate requests with AWS services. * @param clientConfiguration * Client configuration options (ex: max retry limit, proxy settings, etc). * @param executorService * The executor service by which all asynchronous requests will be executed. * @deprecated use {@link AWSWAFAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and * {@link AWSWAFAsyncClientBuilder#withClientConfiguration(ClientConfiguration)} and * {@link AWSWAFAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)} */ @Deprecated public AWSWAFAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, ExecutorService executorService) { super(awsCredentialsProvider, clientConfiguration); this.executorService = executorService; } public static AWSWAFAsyncClientBuilder asyncBuilder() { return AWSWAFAsyncClientBuilder.standard(); } /** * Constructs a new asynchronous client to invoke service methods on WAF using the specified parameters. * * @param asyncClientParams * Object providing client parameters. */ AWSWAFAsyncClient(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 createByteMatchSetAsync(CreateByteMatchSetRequest request) { return createByteMatchSetAsync(request, null); } @Override public java.util.concurrent.Future createByteMatchSetAsync(final CreateByteMatchSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateByteMatchSetResult call() throws Exception { CreateByteMatchSetResult result; try { result = createByteMatchSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, 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) { return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateIPSetResult call() throws Exception { CreateIPSetResult result; try { result = createIPSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, 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) { return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateRuleResult call() throws Exception { CreateRuleResult result; try { result = createRule(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future createSizeConstraintSetAsync(CreateSizeConstraintSetRequest request) { return createSizeConstraintSetAsync(request, null); } @Override public java.util.concurrent.Future createSizeConstraintSetAsync(final CreateSizeConstraintSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateSizeConstraintSetResult call() throws Exception { CreateSizeConstraintSetResult result; try { result = createSizeConstraintSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future createSqlInjectionMatchSetAsync(CreateSqlInjectionMatchSetRequest request) { return createSqlInjectionMatchSetAsync(request, null); } @Override public java.util.concurrent.Future createSqlInjectionMatchSetAsync(final CreateSqlInjectionMatchSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateSqlInjectionMatchSetResult call() throws Exception { CreateSqlInjectionMatchSetResult result; try { result = createSqlInjectionMatchSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, 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) { return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateWebACLResult call() throws Exception { CreateWebACLResult result; try { result = createWebACL(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future createXssMatchSetAsync(CreateXssMatchSetRequest request) { return createXssMatchSetAsync(request, null); } @Override public java.util.concurrent.Future createXssMatchSetAsync(final CreateXssMatchSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public CreateXssMatchSetResult call() throws Exception { CreateXssMatchSetResult result; try { result = createXssMatchSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future deleteByteMatchSetAsync(DeleteByteMatchSetRequest request) { return deleteByteMatchSetAsync(request, null); } @Override public java.util.concurrent.Future deleteByteMatchSetAsync(final DeleteByteMatchSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteByteMatchSetResult call() throws Exception { DeleteByteMatchSetResult result; try { result = deleteByteMatchSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, 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) { return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteIPSetResult call() throws Exception { DeleteIPSetResult result; try { result = deleteIPSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, 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) { return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteRuleResult call() throws Exception { DeleteRuleResult result; try { result = deleteRule(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future deleteSizeConstraintSetAsync(DeleteSizeConstraintSetRequest request) { return deleteSizeConstraintSetAsync(request, null); } @Override public java.util.concurrent.Future deleteSizeConstraintSetAsync(final DeleteSizeConstraintSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteSizeConstraintSetResult call() throws Exception { DeleteSizeConstraintSetResult result; try { result = deleteSizeConstraintSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future deleteSqlInjectionMatchSetAsync(DeleteSqlInjectionMatchSetRequest request) { return deleteSqlInjectionMatchSetAsync(request, null); } @Override public java.util.concurrent.Future deleteSqlInjectionMatchSetAsync(final DeleteSqlInjectionMatchSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteSqlInjectionMatchSetResult call() throws Exception { DeleteSqlInjectionMatchSetResult result; try { result = deleteSqlInjectionMatchSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, 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) { return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteWebACLResult call() throws Exception { DeleteWebACLResult result; try { result = deleteWebACL(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future deleteXssMatchSetAsync(DeleteXssMatchSetRequest request) { return deleteXssMatchSetAsync(request, null); } @Override public java.util.concurrent.Future deleteXssMatchSetAsync(final DeleteXssMatchSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public DeleteXssMatchSetResult call() throws Exception { DeleteXssMatchSetResult result; try { result = deleteXssMatchSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future getByteMatchSetAsync(GetByteMatchSetRequest request) { return getByteMatchSetAsync(request, null); } @Override public java.util.concurrent.Future getByteMatchSetAsync(final GetByteMatchSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public GetByteMatchSetResult call() throws Exception { GetByteMatchSetResult result; try { result = getByteMatchSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future getChangeTokenAsync(GetChangeTokenRequest request) { return getChangeTokenAsync(request, null); } @Override public java.util.concurrent.Future getChangeTokenAsync(final GetChangeTokenRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public GetChangeTokenResult call() throws Exception { GetChangeTokenResult result; try { result = getChangeToken(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future getChangeTokenStatusAsync(GetChangeTokenStatusRequest request) { return getChangeTokenStatusAsync(request, null); } @Override public java.util.concurrent.Future getChangeTokenStatusAsync(final GetChangeTokenStatusRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public GetChangeTokenStatusResult call() throws Exception { GetChangeTokenStatusResult result; try { result = getChangeTokenStatus(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, 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) { return executorService.submit(new java.util.concurrent.Callable() { @Override public GetIPSetResult call() throws Exception { GetIPSetResult result; try { result = getIPSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, 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) { return executorService.submit(new java.util.concurrent.Callable() { @Override public GetRuleResult call() throws Exception { GetRuleResult result; try { result = getRule(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, 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) { return executorService.submit(new java.util.concurrent.Callable() { @Override public GetSampledRequestsResult call() throws Exception { GetSampledRequestsResult result; try { result = getSampledRequests(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future getSizeConstraintSetAsync(GetSizeConstraintSetRequest request) { return getSizeConstraintSetAsync(request, null); } @Override public java.util.concurrent.Future getSizeConstraintSetAsync(final GetSizeConstraintSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public GetSizeConstraintSetResult call() throws Exception { GetSizeConstraintSetResult result; try { result = getSizeConstraintSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future getSqlInjectionMatchSetAsync(GetSqlInjectionMatchSetRequest request) { return getSqlInjectionMatchSetAsync(request, null); } @Override public java.util.concurrent.Future getSqlInjectionMatchSetAsync(final GetSqlInjectionMatchSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public GetSqlInjectionMatchSetResult call() throws Exception { GetSqlInjectionMatchSetResult result; try { result = getSqlInjectionMatchSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, 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) { return executorService.submit(new java.util.concurrent.Callable() { @Override public GetWebACLResult call() throws Exception { GetWebACLResult result; try { result = getWebACL(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future getXssMatchSetAsync(GetXssMatchSetRequest request) { return getXssMatchSetAsync(request, null); } @Override public java.util.concurrent.Future getXssMatchSetAsync(final GetXssMatchSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public GetXssMatchSetResult call() throws Exception { GetXssMatchSetResult result; try { result = getXssMatchSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future listByteMatchSetsAsync(ListByteMatchSetsRequest request) { return listByteMatchSetsAsync(request, null); } @Override public java.util.concurrent.Future listByteMatchSetsAsync(final ListByteMatchSetsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public ListByteMatchSetsResult call() throws Exception { ListByteMatchSetsResult result; try { result = listByteMatchSets(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, 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) { return executorService.submit(new java.util.concurrent.Callable() { @Override public ListIPSetsResult call() throws Exception { ListIPSetsResult result; try { result = listIPSets(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, 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) { return executorService.submit(new java.util.concurrent.Callable() { @Override public ListRulesResult call() throws Exception { ListRulesResult result; try { result = listRules(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future listSizeConstraintSetsAsync(ListSizeConstraintSetsRequest request) { return listSizeConstraintSetsAsync(request, null); } @Override public java.util.concurrent.Future listSizeConstraintSetsAsync(final ListSizeConstraintSetsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public ListSizeConstraintSetsResult call() throws Exception { ListSizeConstraintSetsResult result; try { result = listSizeConstraintSets(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future listSqlInjectionMatchSetsAsync(ListSqlInjectionMatchSetsRequest request) { return listSqlInjectionMatchSetsAsync(request, null); } @Override public java.util.concurrent.Future listSqlInjectionMatchSetsAsync(final ListSqlInjectionMatchSetsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public ListSqlInjectionMatchSetsResult call() throws Exception { ListSqlInjectionMatchSetsResult result; try { result = listSqlInjectionMatchSets(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, 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) { return executorService.submit(new java.util.concurrent.Callable() { @Override public ListWebACLsResult call() throws Exception { ListWebACLsResult result; try { result = listWebACLs(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future listXssMatchSetsAsync(ListXssMatchSetsRequest request) { return listXssMatchSetsAsync(request, null); } @Override public java.util.concurrent.Future listXssMatchSetsAsync(final ListXssMatchSetsRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public ListXssMatchSetsResult call() throws Exception { ListXssMatchSetsResult result; try { result = listXssMatchSets(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future updateByteMatchSetAsync(UpdateByteMatchSetRequest request) { return updateByteMatchSetAsync(request, null); } @Override public java.util.concurrent.Future updateByteMatchSetAsync(final UpdateByteMatchSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateByteMatchSetResult call() throws Exception { UpdateByteMatchSetResult result; try { result = updateByteMatchSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, 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) { return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateIPSetResult call() throws Exception { UpdateIPSetResult result; try { result = updateIPSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, 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) { return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateRuleResult call() throws Exception { UpdateRuleResult result; try { result = updateRule(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future updateSizeConstraintSetAsync(UpdateSizeConstraintSetRequest request) { return updateSizeConstraintSetAsync(request, null); } @Override public java.util.concurrent.Future updateSizeConstraintSetAsync(final UpdateSizeConstraintSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateSizeConstraintSetResult call() throws Exception { UpdateSizeConstraintSetResult result; try { result = updateSizeConstraintSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future updateSqlInjectionMatchSetAsync(UpdateSqlInjectionMatchSetRequest request) { return updateSqlInjectionMatchSetAsync(request, null); } @Override public java.util.concurrent.Future updateSqlInjectionMatchSetAsync(final UpdateSqlInjectionMatchSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateSqlInjectionMatchSetResult call() throws Exception { UpdateSqlInjectionMatchSetResult result; try { result = updateSqlInjectionMatchSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, 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) { return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateWebACLResult call() throws Exception { UpdateWebACLResult result; try { result = updateWebACL(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, result); } return result; } }); } @Override public java.util.concurrent.Future updateXssMatchSetAsync(UpdateXssMatchSetRequest request) { return updateXssMatchSetAsync(request, null); } @Override public java.util.concurrent.Future updateXssMatchSetAsync(final UpdateXssMatchSetRequest request, final com.amazonaws.handlers.AsyncHandler asyncHandler) { return executorService.submit(new java.util.concurrent.Callable() { @Override public UpdateXssMatchSetResult call() throws Exception { UpdateXssMatchSetResult result; try { result = updateXssMatchSet(request); } catch (Exception ex) { if (asyncHandler != null) { asyncHandler.onError(ex); } throw ex; } if (asyncHandler != null) { asyncHandler.onSuccess(request, 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