com.amazonaws.services.waf.AWSWAFAsyncClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-waf Show documentation
/*
* Copyright 2010-2016 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 com.amazonaws.services.waf.model.*;
import com.amazonaws.annotation.ThreadSafe;
/**
* Interface 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. 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
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)
*/
public AWSWAFAsyncClient() {
this(new com.amazonaws.auth.DefaultAWSCredentialsProviderChain());
}
/**
* 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)
*/
public AWSWAFAsyncClient(
com.amazonaws.ClientConfiguration clientConfiguration) {
this(new com.amazonaws.auth.DefaultAWSCredentialsProviderChain(),
clientConfiguration, java.util.concurrent.Executors
.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)
*/
public AWSWAFAsyncClient(com.amazonaws.auth.AWSCredentials awsCredentials) {
this(awsCredentials, java.util.concurrent.Executors
.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.
*/
public AWSWAFAsyncClient(com.amazonaws.auth.AWSCredentials awsCredentials,
java.util.concurrent.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.
*/
public AWSWAFAsyncClient(com.amazonaws.auth.AWSCredentials awsCredentials,
com.amazonaws.ClientConfiguration clientConfiguration,
java.util.concurrent.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)
*/
public AWSWAFAsyncClient(
com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider) {
this(awsCredentialsProvider, java.util.concurrent.Executors
.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)
*/
public AWSWAFAsyncClient(
com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider,
com.amazonaws.ClientConfiguration clientConfiguration) {
this(awsCredentialsProvider, clientConfiguration,
java.util.concurrent.Executors
.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.
*/
public AWSWAFAsyncClient(
com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider,
java.util.concurrent.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.
*/
public AWSWAFAsyncClient(
com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider,
com.amazonaws.ClientConfiguration clientConfiguration,
java.util.concurrent.ExecutorService executorService) {
super(awsCredentialsProvider, clientConfiguration);
this.executorService = executorService;
}
/**
* 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 java.util.concurrent.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();
}
}