com.amazonaws.services.elasticache.AmazonElastiCacheAsyncClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-elasticache Show documentation
/*
* Copyright 2014-2019 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.elasticache;
import static java.util.concurrent.Executors.newFixedThreadPool;
import javax.annotation.Generated;
import com.amazonaws.services.elasticache.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 Amazon ElastiCache asynchronously. Each asynchronous method will return a Java Future object
* representing the asynchronous operation; overloads which accept an {@code AsyncHandler} can be used to receive
* notification when an asynchronous operation completes.
*
* Amazon ElastiCache
*
* Amazon ElastiCache is a web service that makes it easier to set up, operate, and scale a distributed cache in the
* cloud.
*
*
* With ElastiCache, customers get all of the benefits of a high-performance, in-memory cache with less of the
* administrative burden involved in launching and managing a distributed cache. The service makes setup, scaling, and
* cluster failure handling much simpler than in a self-managed cache deployment.
*
*
* In addition, through integration with Amazon CloudWatch, customers get enhanced visibility into the key performance
* statistics associated with their cache and can receive alarms if a part of their cache runs hot.
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AmazonElastiCacheAsyncClient extends AmazonElastiCacheClient implements AmazonElastiCacheAsync {
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 Amazon ElastiCache. 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 AmazonElastiCacheAsyncClientBuilder#defaultClient()}
*/
@Deprecated
public AmazonElastiCacheAsyncClient() {
this(DefaultAWSCredentialsProviderChain.getInstance());
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon ElastiCache. 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 Amazon ElastiCache (ex: proxy
* settings, retry counts, etc).
*
* @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
* @deprecated use {@link AmazonElastiCacheAsyncClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AmazonElastiCacheAsyncClient(ClientConfiguration clientConfiguration) {
this(DefaultAWSCredentialsProviderChain.getInstance(), clientConfiguration, newFixedThreadPool(clientConfiguration.getMaxConnections()));
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon ElastiCache 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 AmazonElastiCacheAsyncClientBuilder#withCredentials(AWSCredentialsProvider)}
*/
@Deprecated
public AmazonElastiCacheAsyncClient(AWSCredentials awsCredentials) {
this(awsCredentials, newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE));
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon ElastiCache 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 AmazonElastiCacheAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonElastiCacheAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AmazonElastiCacheAsyncClient(AWSCredentials awsCredentials, ExecutorService executorService) {
this(awsCredentials, configFactory.getConfig(), executorService);
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon ElastiCache 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 AmazonElastiCacheAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonElastiCacheAsyncClientBuilder#withClientConfiguration(ClientConfiguration)} and
* {@link AmazonElastiCacheAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AmazonElastiCacheAsyncClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration, ExecutorService executorService) {
super(awsCredentials, clientConfiguration);
this.executorService = executorService;
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon ElastiCache 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 AmazonElastiCacheAsyncClientBuilder#withCredentials(AWSCredentialsProvider)}
*/
@Deprecated
public AmazonElastiCacheAsyncClient(AWSCredentialsProvider awsCredentialsProvider) {
this(awsCredentialsProvider, newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE));
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon ElastiCache 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 AmazonElastiCacheAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonElastiCacheAsyncClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AmazonElastiCacheAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) {
this(awsCredentialsProvider, clientConfiguration, newFixedThreadPool(clientConfiguration.getMaxConnections()));
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon ElastiCache 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 AmazonElastiCacheAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonElastiCacheAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AmazonElastiCacheAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ExecutorService executorService) {
this(awsCredentialsProvider, configFactory.getConfig(), executorService);
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon ElastiCache 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 AmazonElastiCacheAsyncClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonElastiCacheAsyncClientBuilder#withClientConfiguration(ClientConfiguration)} and
* {@link AmazonElastiCacheAsyncClientBuilder#withExecutorFactory(com.amazonaws.client.builder.ExecutorFactory)}
*/
@Deprecated
public AmazonElastiCacheAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, ExecutorService executorService) {
super(awsCredentialsProvider, clientConfiguration);
this.executorService = executorService;
}
public static AmazonElastiCacheAsyncClientBuilder asyncBuilder() {
return AmazonElastiCacheAsyncClientBuilder.standard();
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon ElastiCache using the specified
* parameters.
*
* @param asyncClientParams
* Object providing client parameters.
*/
AmazonElastiCacheAsyncClient(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 addTagsToResourceAsync(AddTagsToResourceRequest request) {
return addTagsToResourceAsync(request, null);
}
@Override
public java.util.concurrent.Future addTagsToResourceAsync(final AddTagsToResourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AddTagsToResourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public AddTagsToResourceResult call() throws Exception {
AddTagsToResourceResult result = null;
try {
result = executeAddTagsToResource(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 authorizeCacheSecurityGroupIngressAsync(AuthorizeCacheSecurityGroupIngressRequest request) {
return authorizeCacheSecurityGroupIngressAsync(request, null);
}
@Override
public java.util.concurrent.Future authorizeCacheSecurityGroupIngressAsync(final AuthorizeCacheSecurityGroupIngressRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final AuthorizeCacheSecurityGroupIngressRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CacheSecurityGroup call() throws Exception {
CacheSecurityGroup result = null;
try {
result = executeAuthorizeCacheSecurityGroupIngress(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 copySnapshotAsync(CopySnapshotRequest request) {
return copySnapshotAsync(request, null);
}
@Override
public java.util.concurrent.Future copySnapshotAsync(final CopySnapshotRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CopySnapshotRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public Snapshot call() throws Exception {
Snapshot result = null;
try {
result = executeCopySnapshot(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 createCacheClusterAsync(CreateCacheClusterRequest request) {
return createCacheClusterAsync(request, null);
}
@Override
public java.util.concurrent.Future createCacheClusterAsync(final CreateCacheClusterRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateCacheClusterRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CacheCluster call() throws Exception {
CacheCluster result = null;
try {
result = executeCreateCacheCluster(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 createCacheParameterGroupAsync(CreateCacheParameterGroupRequest request) {
return createCacheParameterGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future createCacheParameterGroupAsync(final CreateCacheParameterGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateCacheParameterGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CacheParameterGroup call() throws Exception {
CacheParameterGroup result = null;
try {
result = executeCreateCacheParameterGroup(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 createCacheSecurityGroupAsync(CreateCacheSecurityGroupRequest request) {
return createCacheSecurityGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future createCacheSecurityGroupAsync(final CreateCacheSecurityGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateCacheSecurityGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CacheSecurityGroup call() throws Exception {
CacheSecurityGroup result = null;
try {
result = executeCreateCacheSecurityGroup(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 createCacheSubnetGroupAsync(CreateCacheSubnetGroupRequest request) {
return createCacheSubnetGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future createCacheSubnetGroupAsync(final CreateCacheSubnetGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateCacheSubnetGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CacheSubnetGroup call() throws Exception {
CacheSubnetGroup result = null;
try {
result = executeCreateCacheSubnetGroup(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 createReplicationGroupAsync(CreateReplicationGroupRequest request) {
return createReplicationGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future createReplicationGroupAsync(final CreateReplicationGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateReplicationGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ReplicationGroup call() throws Exception {
ReplicationGroup result = null;
try {
result = executeCreateReplicationGroup(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 createSnapshotAsync(CreateSnapshotRequest request) {
return createSnapshotAsync(request, null);
}
@Override
public java.util.concurrent.Future createSnapshotAsync(final CreateSnapshotRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final CreateSnapshotRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public Snapshot call() throws Exception {
Snapshot result = null;
try {
result = executeCreateSnapshot(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 decreaseReplicaCountAsync(DecreaseReplicaCountRequest request) {
return decreaseReplicaCountAsync(request, null);
}
@Override
public java.util.concurrent.Future decreaseReplicaCountAsync(final DecreaseReplicaCountRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DecreaseReplicaCountRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ReplicationGroup call() throws Exception {
ReplicationGroup result = null;
try {
result = executeDecreaseReplicaCount(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 deleteCacheClusterAsync(DeleteCacheClusterRequest request) {
return deleteCacheClusterAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteCacheClusterAsync(final DeleteCacheClusterRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteCacheClusterRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CacheCluster call() throws Exception {
CacheCluster result = null;
try {
result = executeDeleteCacheCluster(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 deleteCacheParameterGroupAsync(DeleteCacheParameterGroupRequest request) {
return deleteCacheParameterGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteCacheParameterGroupAsync(final DeleteCacheParameterGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteCacheParameterGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteCacheParameterGroupResult call() throws Exception {
DeleteCacheParameterGroupResult result = null;
try {
result = executeDeleteCacheParameterGroup(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 deleteCacheSecurityGroupAsync(DeleteCacheSecurityGroupRequest request) {
return deleteCacheSecurityGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteCacheSecurityGroupAsync(final DeleteCacheSecurityGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteCacheSecurityGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteCacheSecurityGroupResult call() throws Exception {
DeleteCacheSecurityGroupResult result = null;
try {
result = executeDeleteCacheSecurityGroup(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 deleteCacheSubnetGroupAsync(DeleteCacheSubnetGroupRequest request) {
return deleteCacheSubnetGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteCacheSubnetGroupAsync(final DeleteCacheSubnetGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteCacheSubnetGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DeleteCacheSubnetGroupResult call() throws Exception {
DeleteCacheSubnetGroupResult result = null;
try {
result = executeDeleteCacheSubnetGroup(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 deleteReplicationGroupAsync(DeleteReplicationGroupRequest request) {
return deleteReplicationGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteReplicationGroupAsync(final DeleteReplicationGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteReplicationGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ReplicationGroup call() throws Exception {
ReplicationGroup result = null;
try {
result = executeDeleteReplicationGroup(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 deleteSnapshotAsync(DeleteSnapshotRequest request) {
return deleteSnapshotAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteSnapshotAsync(final DeleteSnapshotRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DeleteSnapshotRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public Snapshot call() throws Exception {
Snapshot result = null;
try {
result = executeDeleteSnapshot(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 describeCacheClustersAsync(DescribeCacheClustersRequest request) {
return describeCacheClustersAsync(request, null);
}
@Override
public java.util.concurrent.Future describeCacheClustersAsync(final DescribeCacheClustersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeCacheClustersRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeCacheClustersResult call() throws Exception {
DescribeCacheClustersResult result = null;
try {
result = executeDescribeCacheClusters(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the DescribeCacheClusters operation.
*
* @see #describeCacheClustersAsync(DescribeCacheClustersRequest)
*/
@Override
public java.util.concurrent.Future describeCacheClustersAsync() {
return describeCacheClustersAsync(new DescribeCacheClustersRequest());
}
/**
* Simplified method form for invoking the DescribeCacheClusters operation with an AsyncHandler.
*
* @see #describeCacheClustersAsync(DescribeCacheClustersRequest, com.amazonaws.handlers.AsyncHandler)
*/
@Override
public java.util.concurrent.Future describeCacheClustersAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return describeCacheClustersAsync(new DescribeCacheClustersRequest(), asyncHandler);
}
@Override
public java.util.concurrent.Future describeCacheEngineVersionsAsync(DescribeCacheEngineVersionsRequest request) {
return describeCacheEngineVersionsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeCacheEngineVersionsAsync(final DescribeCacheEngineVersionsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeCacheEngineVersionsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeCacheEngineVersionsResult call() throws Exception {
DescribeCacheEngineVersionsResult result = null;
try {
result = executeDescribeCacheEngineVersions(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the DescribeCacheEngineVersions operation.
*
* @see #describeCacheEngineVersionsAsync(DescribeCacheEngineVersionsRequest)
*/
@Override
public java.util.concurrent.Future describeCacheEngineVersionsAsync() {
return describeCacheEngineVersionsAsync(new DescribeCacheEngineVersionsRequest());
}
/**
* Simplified method form for invoking the DescribeCacheEngineVersions operation with an AsyncHandler.
*
* @see #describeCacheEngineVersionsAsync(DescribeCacheEngineVersionsRequest, com.amazonaws.handlers.AsyncHandler)
*/
@Override
public java.util.concurrent.Future describeCacheEngineVersionsAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return describeCacheEngineVersionsAsync(new DescribeCacheEngineVersionsRequest(), asyncHandler);
}
@Override
public java.util.concurrent.Future describeCacheParameterGroupsAsync(DescribeCacheParameterGroupsRequest request) {
return describeCacheParameterGroupsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeCacheParameterGroupsAsync(final DescribeCacheParameterGroupsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeCacheParameterGroupsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeCacheParameterGroupsResult call() throws Exception {
DescribeCacheParameterGroupsResult result = null;
try {
result = executeDescribeCacheParameterGroups(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the DescribeCacheParameterGroups operation.
*
* @see #describeCacheParameterGroupsAsync(DescribeCacheParameterGroupsRequest)
*/
@Override
public java.util.concurrent.Future describeCacheParameterGroupsAsync() {
return describeCacheParameterGroupsAsync(new DescribeCacheParameterGroupsRequest());
}
/**
* Simplified method form for invoking the DescribeCacheParameterGroups operation with an AsyncHandler.
*
* @see #describeCacheParameterGroupsAsync(DescribeCacheParameterGroupsRequest, com.amazonaws.handlers.AsyncHandler)
*/
@Override
public java.util.concurrent.Future describeCacheParameterGroupsAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return describeCacheParameterGroupsAsync(new DescribeCacheParameterGroupsRequest(), asyncHandler);
}
@Override
public java.util.concurrent.Future describeCacheParametersAsync(DescribeCacheParametersRequest request) {
return describeCacheParametersAsync(request, null);
}
@Override
public java.util.concurrent.Future describeCacheParametersAsync(final DescribeCacheParametersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeCacheParametersRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeCacheParametersResult call() throws Exception {
DescribeCacheParametersResult result = null;
try {
result = executeDescribeCacheParameters(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 describeCacheSecurityGroupsAsync(DescribeCacheSecurityGroupsRequest request) {
return describeCacheSecurityGroupsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeCacheSecurityGroupsAsync(final DescribeCacheSecurityGroupsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeCacheSecurityGroupsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeCacheSecurityGroupsResult call() throws Exception {
DescribeCacheSecurityGroupsResult result = null;
try {
result = executeDescribeCacheSecurityGroups(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the DescribeCacheSecurityGroups operation.
*
* @see #describeCacheSecurityGroupsAsync(DescribeCacheSecurityGroupsRequest)
*/
@Override
public java.util.concurrent.Future describeCacheSecurityGroupsAsync() {
return describeCacheSecurityGroupsAsync(new DescribeCacheSecurityGroupsRequest());
}
/**
* Simplified method form for invoking the DescribeCacheSecurityGroups operation with an AsyncHandler.
*
* @see #describeCacheSecurityGroupsAsync(DescribeCacheSecurityGroupsRequest, com.amazonaws.handlers.AsyncHandler)
*/
@Override
public java.util.concurrent.Future describeCacheSecurityGroupsAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return describeCacheSecurityGroupsAsync(new DescribeCacheSecurityGroupsRequest(), asyncHandler);
}
@Override
public java.util.concurrent.Future describeCacheSubnetGroupsAsync(DescribeCacheSubnetGroupsRequest request) {
return describeCacheSubnetGroupsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeCacheSubnetGroupsAsync(final DescribeCacheSubnetGroupsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeCacheSubnetGroupsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeCacheSubnetGroupsResult call() throws Exception {
DescribeCacheSubnetGroupsResult result = null;
try {
result = executeDescribeCacheSubnetGroups(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the DescribeCacheSubnetGroups operation.
*
* @see #describeCacheSubnetGroupsAsync(DescribeCacheSubnetGroupsRequest)
*/
@Override
public java.util.concurrent.Future describeCacheSubnetGroupsAsync() {
return describeCacheSubnetGroupsAsync(new DescribeCacheSubnetGroupsRequest());
}
/**
* Simplified method form for invoking the DescribeCacheSubnetGroups operation with an AsyncHandler.
*
* @see #describeCacheSubnetGroupsAsync(DescribeCacheSubnetGroupsRequest, com.amazonaws.handlers.AsyncHandler)
*/
@Override
public java.util.concurrent.Future describeCacheSubnetGroupsAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return describeCacheSubnetGroupsAsync(new DescribeCacheSubnetGroupsRequest(), asyncHandler);
}
@Override
public java.util.concurrent.Future describeEngineDefaultParametersAsync(DescribeEngineDefaultParametersRequest request) {
return describeEngineDefaultParametersAsync(request, null);
}
@Override
public java.util.concurrent.Future describeEngineDefaultParametersAsync(final DescribeEngineDefaultParametersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeEngineDefaultParametersRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public EngineDefaults call() throws Exception {
EngineDefaults result = null;
try {
result = executeDescribeEngineDefaultParameters(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 describeEventsAsync(DescribeEventsRequest request) {
return describeEventsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeEventsAsync(final DescribeEventsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeEventsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeEventsResult call() throws Exception {
DescribeEventsResult result = null;
try {
result = executeDescribeEvents(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the DescribeEvents operation.
*
* @see #describeEventsAsync(DescribeEventsRequest)
*/
@Override
public java.util.concurrent.Future describeEventsAsync() {
return describeEventsAsync(new DescribeEventsRequest());
}
/**
* Simplified method form for invoking the DescribeEvents operation with an AsyncHandler.
*
* @see #describeEventsAsync(DescribeEventsRequest, com.amazonaws.handlers.AsyncHandler)
*/
@Override
public java.util.concurrent.Future describeEventsAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return describeEventsAsync(new DescribeEventsRequest(), asyncHandler);
}
@Override
public java.util.concurrent.Future describeReplicationGroupsAsync(DescribeReplicationGroupsRequest request) {
return describeReplicationGroupsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeReplicationGroupsAsync(final DescribeReplicationGroupsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeReplicationGroupsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeReplicationGroupsResult call() throws Exception {
DescribeReplicationGroupsResult result = null;
try {
result = executeDescribeReplicationGroups(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the DescribeReplicationGroups operation.
*
* @see #describeReplicationGroupsAsync(DescribeReplicationGroupsRequest)
*/
@Override
public java.util.concurrent.Future describeReplicationGroupsAsync() {
return describeReplicationGroupsAsync(new DescribeReplicationGroupsRequest());
}
/**
* Simplified method form for invoking the DescribeReplicationGroups operation with an AsyncHandler.
*
* @see #describeReplicationGroupsAsync(DescribeReplicationGroupsRequest, com.amazonaws.handlers.AsyncHandler)
*/
@Override
public java.util.concurrent.Future describeReplicationGroupsAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return describeReplicationGroupsAsync(new DescribeReplicationGroupsRequest(), asyncHandler);
}
@Override
public java.util.concurrent.Future describeReservedCacheNodesAsync(DescribeReservedCacheNodesRequest request) {
return describeReservedCacheNodesAsync(request, null);
}
@Override
public java.util.concurrent.Future describeReservedCacheNodesAsync(final DescribeReservedCacheNodesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeReservedCacheNodesRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeReservedCacheNodesResult call() throws Exception {
DescribeReservedCacheNodesResult result = null;
try {
result = executeDescribeReservedCacheNodes(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the DescribeReservedCacheNodes operation.
*
* @see #describeReservedCacheNodesAsync(DescribeReservedCacheNodesRequest)
*/
@Override
public java.util.concurrent.Future describeReservedCacheNodesAsync() {
return describeReservedCacheNodesAsync(new DescribeReservedCacheNodesRequest());
}
/**
* Simplified method form for invoking the DescribeReservedCacheNodes operation with an AsyncHandler.
*
* @see #describeReservedCacheNodesAsync(DescribeReservedCacheNodesRequest, com.amazonaws.handlers.AsyncHandler)
*/
@Override
public java.util.concurrent.Future describeReservedCacheNodesAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return describeReservedCacheNodesAsync(new DescribeReservedCacheNodesRequest(), asyncHandler);
}
@Override
public java.util.concurrent.Future describeReservedCacheNodesOfferingsAsync(
DescribeReservedCacheNodesOfferingsRequest request) {
return describeReservedCacheNodesOfferingsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeReservedCacheNodesOfferingsAsync(
final DescribeReservedCacheNodesOfferingsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeReservedCacheNodesOfferingsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeReservedCacheNodesOfferingsResult call() throws Exception {
DescribeReservedCacheNodesOfferingsResult result = null;
try {
result = executeDescribeReservedCacheNodesOfferings(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the DescribeReservedCacheNodesOfferings operation.
*
* @see #describeReservedCacheNodesOfferingsAsync(DescribeReservedCacheNodesOfferingsRequest)
*/
@Override
public java.util.concurrent.Future describeReservedCacheNodesOfferingsAsync() {
return describeReservedCacheNodesOfferingsAsync(new DescribeReservedCacheNodesOfferingsRequest());
}
/**
* Simplified method form for invoking the DescribeReservedCacheNodesOfferings operation with an AsyncHandler.
*
* @see #describeReservedCacheNodesOfferingsAsync(DescribeReservedCacheNodesOfferingsRequest,
* com.amazonaws.handlers.AsyncHandler)
*/
@Override
public java.util.concurrent.Future describeReservedCacheNodesOfferingsAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return describeReservedCacheNodesOfferingsAsync(new DescribeReservedCacheNodesOfferingsRequest(), asyncHandler);
}
@Override
public java.util.concurrent.Future describeSnapshotsAsync(DescribeSnapshotsRequest request) {
return describeSnapshotsAsync(request, null);
}
@Override
public java.util.concurrent.Future describeSnapshotsAsync(final DescribeSnapshotsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final DescribeSnapshotsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public DescribeSnapshotsResult call() throws Exception {
DescribeSnapshotsResult result = null;
try {
result = executeDescribeSnapshots(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the DescribeSnapshots operation.
*
* @see #describeSnapshotsAsync(DescribeSnapshotsRequest)
*/
@Override
public java.util.concurrent.Future describeSnapshotsAsync() {
return describeSnapshotsAsync(new DescribeSnapshotsRequest());
}
/**
* Simplified method form for invoking the DescribeSnapshots operation with an AsyncHandler.
*
* @see #describeSnapshotsAsync(DescribeSnapshotsRequest, com.amazonaws.handlers.AsyncHandler)
*/
@Override
public java.util.concurrent.Future describeSnapshotsAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return describeSnapshotsAsync(new DescribeSnapshotsRequest(), asyncHandler);
}
@Override
public java.util.concurrent.Future increaseReplicaCountAsync(IncreaseReplicaCountRequest request) {
return increaseReplicaCountAsync(request, null);
}
@Override
public java.util.concurrent.Future increaseReplicaCountAsync(final IncreaseReplicaCountRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final IncreaseReplicaCountRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ReplicationGroup call() throws Exception {
ReplicationGroup result = null;
try {
result = executeIncreaseReplicaCount(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 listAllowedNodeTypeModificationsAsync(
ListAllowedNodeTypeModificationsRequest request) {
return listAllowedNodeTypeModificationsAsync(request, null);
}
@Override
public java.util.concurrent.Future listAllowedNodeTypeModificationsAsync(
final ListAllowedNodeTypeModificationsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ListAllowedNodeTypeModificationsRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ListAllowedNodeTypeModificationsResult call() throws Exception {
ListAllowedNodeTypeModificationsResult result = null;
try {
result = executeListAllowedNodeTypeModifications(finalRequest);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(finalRequest, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the ListAllowedNodeTypeModifications operation.
*
* @see #listAllowedNodeTypeModificationsAsync(ListAllowedNodeTypeModificationsRequest)
*/
@Override
public java.util.concurrent.Future listAllowedNodeTypeModificationsAsync() {
return listAllowedNodeTypeModificationsAsync(new ListAllowedNodeTypeModificationsRequest());
}
/**
* Simplified method form for invoking the ListAllowedNodeTypeModifications operation with an AsyncHandler.
*
* @see #listAllowedNodeTypeModificationsAsync(ListAllowedNodeTypeModificationsRequest,
* com.amazonaws.handlers.AsyncHandler)
*/
@Override
public java.util.concurrent.Future listAllowedNodeTypeModificationsAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return listAllowedNodeTypeModificationsAsync(new ListAllowedNodeTypeModificationsRequest(), asyncHandler);
}
@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 modifyCacheClusterAsync(ModifyCacheClusterRequest request) {
return modifyCacheClusterAsync(request, null);
}
@Override
public java.util.concurrent.Future modifyCacheClusterAsync(final ModifyCacheClusterRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ModifyCacheClusterRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CacheCluster call() throws Exception {
CacheCluster result = null;
try {
result = executeModifyCacheCluster(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 modifyCacheParameterGroupAsync(ModifyCacheParameterGroupRequest request) {
return modifyCacheParameterGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future modifyCacheParameterGroupAsync(final ModifyCacheParameterGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ModifyCacheParameterGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ModifyCacheParameterGroupResult call() throws Exception {
ModifyCacheParameterGroupResult result = null;
try {
result = executeModifyCacheParameterGroup(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 modifyCacheSubnetGroupAsync(ModifyCacheSubnetGroupRequest request) {
return modifyCacheSubnetGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future modifyCacheSubnetGroupAsync(final ModifyCacheSubnetGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ModifyCacheSubnetGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CacheSubnetGroup call() throws Exception {
CacheSubnetGroup result = null;
try {
result = executeModifyCacheSubnetGroup(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 modifyReplicationGroupAsync(ModifyReplicationGroupRequest request) {
return modifyReplicationGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future modifyReplicationGroupAsync(final ModifyReplicationGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ModifyReplicationGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ReplicationGroup call() throws Exception {
ReplicationGroup result = null;
try {
result = executeModifyReplicationGroup(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 modifyReplicationGroupShardConfigurationAsync(ModifyReplicationGroupShardConfigurationRequest request) {
return modifyReplicationGroupShardConfigurationAsync(request, null);
}
@Override
public java.util.concurrent.Future modifyReplicationGroupShardConfigurationAsync(
final ModifyReplicationGroupShardConfigurationRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ModifyReplicationGroupShardConfigurationRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ReplicationGroup call() throws Exception {
ReplicationGroup result = null;
try {
result = executeModifyReplicationGroupShardConfiguration(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 purchaseReservedCacheNodesOfferingAsync(PurchaseReservedCacheNodesOfferingRequest request) {
return purchaseReservedCacheNodesOfferingAsync(request, null);
}
@Override
public java.util.concurrent.Future purchaseReservedCacheNodesOfferingAsync(final PurchaseReservedCacheNodesOfferingRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final PurchaseReservedCacheNodesOfferingRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ReservedCacheNode call() throws Exception {
ReservedCacheNode result = null;
try {
result = executePurchaseReservedCacheNodesOffering(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 rebootCacheClusterAsync(RebootCacheClusterRequest request) {
return rebootCacheClusterAsync(request, null);
}
@Override
public java.util.concurrent.Future rebootCacheClusterAsync(final RebootCacheClusterRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final RebootCacheClusterRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CacheCluster call() throws Exception {
CacheCluster result = null;
try {
result = executeRebootCacheCluster(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 removeTagsFromResourceAsync(RemoveTagsFromResourceRequest request) {
return removeTagsFromResourceAsync(request, null);
}
@Override
public java.util.concurrent.Future removeTagsFromResourceAsync(final RemoveTagsFromResourceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final RemoveTagsFromResourceRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public RemoveTagsFromResourceResult call() throws Exception {
RemoveTagsFromResourceResult result = null;
try {
result = executeRemoveTagsFromResource(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 resetCacheParameterGroupAsync(ResetCacheParameterGroupRequest request) {
return resetCacheParameterGroupAsync(request, null);
}
@Override
public java.util.concurrent.Future resetCacheParameterGroupAsync(final ResetCacheParameterGroupRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final ResetCacheParameterGroupRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ResetCacheParameterGroupResult call() throws Exception {
ResetCacheParameterGroupResult result = null;
try {
result = executeResetCacheParameterGroup(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 revokeCacheSecurityGroupIngressAsync(RevokeCacheSecurityGroupIngressRequest request) {
return revokeCacheSecurityGroupIngressAsync(request, null);
}
@Override
public java.util.concurrent.Future revokeCacheSecurityGroupIngressAsync(final RevokeCacheSecurityGroupIngressRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final RevokeCacheSecurityGroupIngressRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public CacheSecurityGroup call() throws Exception {
CacheSecurityGroup result = null;
try {
result = executeRevokeCacheSecurityGroupIngress(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 testFailoverAsync(TestFailoverRequest request) {
return testFailoverAsync(request, null);
}
@Override
public java.util.concurrent.Future testFailoverAsync(final TestFailoverRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
final TestFailoverRequest finalRequest = beforeClientExecution(request);
return executorService.submit(new java.util.concurrent.Callable() {
@Override
public ReplicationGroup call() throws Exception {
ReplicationGroup result = null;
try {
result = executeTestFailover(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();
}
}