com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceAsyncClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-ses 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.simpleemail;
import com.amazonaws.services.simpleemail.model.*;
import com.amazonaws.annotation.ThreadSafe;
/**
* Interface for accessing Amazon SES 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 Simple Email Service
*
* This is the API Reference for Amazon Simple Email Service (Amazon SES). This
* documentation is intended to be used in conjunction with the Amazon SES Developer Guide.
*
* For a list of Amazon SES endpoints to use in service requests, see Regions
* and Amazon SES in the Amazon SES Developer Guide.
*/
@ThreadSafe
public class AmazonSimpleEmailServiceAsyncClient extends
AmazonSimpleEmailServiceClient implements AmazonSimpleEmailServiceAsync {
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
* SES. 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 AmazonSimpleEmailServiceAsyncClient() {
this(new com.amazonaws.auth.DefaultAWSCredentialsProviderChain());
}
/**
* Constructs a new asynchronous client to invoke service methods on Amazon
* SES. 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 SES (ex: proxy settings, retry counts, etc).
*
* @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
* @see java.util.concurrent.Executors#newFixedThreadPool(int)
*/
public AmazonSimpleEmailServiceAsyncClient(
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 Amazon
* SES 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 AmazonSimpleEmailServiceAsyncClient(
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 Amazon
* SES 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 AmazonSimpleEmailServiceAsyncClient(
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 Amazon
* SES 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 AmazonSimpleEmailServiceAsyncClient(
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 Amazon
* SES 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 AmazonSimpleEmailServiceAsyncClient(
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 Amazon
* SES 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 AmazonSimpleEmailServiceAsyncClient(
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 Amazon
* SES 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 AmazonSimpleEmailServiceAsyncClient(
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 Amazon
* SES 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 AmazonSimpleEmailServiceAsyncClient(
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 cloneReceiptRuleSetAsync(
CloneReceiptRuleSetRequest request) {
return cloneReceiptRuleSetAsync(request, null);
}
@Override
public java.util.concurrent.Future cloneReceiptRuleSetAsync(
final CloneReceiptRuleSetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public CloneReceiptRuleSetResult call() throws Exception {
CloneReceiptRuleSetResult result;
try {
result = cloneReceiptRuleSet(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 createReceiptFilterAsync(
CreateReceiptFilterRequest request) {
return createReceiptFilterAsync(request, null);
}
@Override
public java.util.concurrent.Future createReceiptFilterAsync(
final CreateReceiptFilterRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public CreateReceiptFilterResult call() throws Exception {
CreateReceiptFilterResult result;
try {
result = createReceiptFilter(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 createReceiptRuleAsync(
CreateReceiptRuleRequest request) {
return createReceiptRuleAsync(request, null);
}
@Override
public java.util.concurrent.Future createReceiptRuleAsync(
final CreateReceiptRuleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public CreateReceiptRuleResult call() throws Exception {
CreateReceiptRuleResult result;
try {
result = createReceiptRule(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 createReceiptRuleSetAsync(
CreateReceiptRuleSetRequest request) {
return createReceiptRuleSetAsync(request, null);
}
@Override
public java.util.concurrent.Future createReceiptRuleSetAsync(
final CreateReceiptRuleSetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public CreateReceiptRuleSetResult call() throws Exception {
CreateReceiptRuleSetResult result;
try {
result = createReceiptRuleSet(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 deleteIdentityAsync(
DeleteIdentityRequest request) {
return deleteIdentityAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteIdentityAsync(
final DeleteIdentityRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public DeleteIdentityResult call() throws Exception {
DeleteIdentityResult result;
try {
result = deleteIdentity(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 deleteIdentityPolicyAsync(
DeleteIdentityPolicyRequest request) {
return deleteIdentityPolicyAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteIdentityPolicyAsync(
final DeleteIdentityPolicyRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public DeleteIdentityPolicyResult call() throws Exception {
DeleteIdentityPolicyResult result;
try {
result = deleteIdentityPolicy(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 deleteReceiptFilterAsync(
DeleteReceiptFilterRequest request) {
return deleteReceiptFilterAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteReceiptFilterAsync(
final DeleteReceiptFilterRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public DeleteReceiptFilterResult call() throws Exception {
DeleteReceiptFilterResult result;
try {
result = deleteReceiptFilter(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 deleteReceiptRuleAsync(
DeleteReceiptRuleRequest request) {
return deleteReceiptRuleAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteReceiptRuleAsync(
final DeleteReceiptRuleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public DeleteReceiptRuleResult call() throws Exception {
DeleteReceiptRuleResult result;
try {
result = deleteReceiptRule(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 deleteReceiptRuleSetAsync(
DeleteReceiptRuleSetRequest request) {
return deleteReceiptRuleSetAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteReceiptRuleSetAsync(
final DeleteReceiptRuleSetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public DeleteReceiptRuleSetResult call() throws Exception {
DeleteReceiptRuleSetResult result;
try {
result = deleteReceiptRuleSet(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 deleteVerifiedEmailAddressAsync(
DeleteVerifiedEmailAddressRequest request) {
return deleteVerifiedEmailAddressAsync(request, null);
}
@Override
public java.util.concurrent.Future deleteVerifiedEmailAddressAsync(
final DeleteVerifiedEmailAddressRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public Void call() throws Exception {
Void result;
try {
deleteVerifiedEmailAddress(request);
result = null;
} 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 describeActiveReceiptRuleSetAsync(
DescribeActiveReceiptRuleSetRequest request) {
return describeActiveReceiptRuleSetAsync(request, null);
}
@Override
public java.util.concurrent.Future describeActiveReceiptRuleSetAsync(
final DescribeActiveReceiptRuleSetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public DescribeActiveReceiptRuleSetResult call()
throws Exception {
DescribeActiveReceiptRuleSetResult result;
try {
result = describeActiveReceiptRuleSet(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 describeReceiptRuleAsync(
DescribeReceiptRuleRequest request) {
return describeReceiptRuleAsync(request, null);
}
@Override
public java.util.concurrent.Future describeReceiptRuleAsync(
final DescribeReceiptRuleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public DescribeReceiptRuleResult call() throws Exception {
DescribeReceiptRuleResult result;
try {
result = describeReceiptRule(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 describeReceiptRuleSetAsync(
DescribeReceiptRuleSetRequest request) {
return describeReceiptRuleSetAsync(request, null);
}
@Override
public java.util.concurrent.Future describeReceiptRuleSetAsync(
final DescribeReceiptRuleSetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public DescribeReceiptRuleSetResult call() throws Exception {
DescribeReceiptRuleSetResult result;
try {
result = describeReceiptRuleSet(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 getIdentityDkimAttributesAsync(
GetIdentityDkimAttributesRequest request) {
return getIdentityDkimAttributesAsync(request, null);
}
@Override
public java.util.concurrent.Future getIdentityDkimAttributesAsync(
final GetIdentityDkimAttributesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public GetIdentityDkimAttributesResult call()
throws Exception {
GetIdentityDkimAttributesResult result;
try {
result = getIdentityDkimAttributes(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 getIdentityMailFromDomainAttributesAsync(
GetIdentityMailFromDomainAttributesRequest request) {
return getIdentityMailFromDomainAttributesAsync(request, null);
}
@Override
public java.util.concurrent.Future getIdentityMailFromDomainAttributesAsync(
final GetIdentityMailFromDomainAttributesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public GetIdentityMailFromDomainAttributesResult call()
throws Exception {
GetIdentityMailFromDomainAttributesResult result;
try {
result = getIdentityMailFromDomainAttributes(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 getIdentityNotificationAttributesAsync(
GetIdentityNotificationAttributesRequest request) {
return getIdentityNotificationAttributesAsync(request, null);
}
@Override
public java.util.concurrent.Future getIdentityNotificationAttributesAsync(
final GetIdentityNotificationAttributesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public GetIdentityNotificationAttributesResult call()
throws Exception {
GetIdentityNotificationAttributesResult result;
try {
result = getIdentityNotificationAttributes(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 getIdentityPoliciesAsync(
GetIdentityPoliciesRequest request) {
return getIdentityPoliciesAsync(request, null);
}
@Override
public java.util.concurrent.Future getIdentityPoliciesAsync(
final GetIdentityPoliciesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public GetIdentityPoliciesResult call() throws Exception {
GetIdentityPoliciesResult result;
try {
result = getIdentityPolicies(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 getIdentityVerificationAttributesAsync(
GetIdentityVerificationAttributesRequest request) {
return getIdentityVerificationAttributesAsync(request, null);
}
@Override
public java.util.concurrent.Future getIdentityVerificationAttributesAsync(
final GetIdentityVerificationAttributesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public GetIdentityVerificationAttributesResult call()
throws Exception {
GetIdentityVerificationAttributesResult result;
try {
result = getIdentityVerificationAttributes(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 getSendQuotaAsync(
GetSendQuotaRequest request) {
return getSendQuotaAsync(request, null);
}
@Override
public java.util.concurrent.Future getSendQuotaAsync(
final GetSendQuotaRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public GetSendQuotaResult call() throws Exception {
GetSendQuotaResult result;
try {
result = getSendQuota(request);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(request, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the GetSendQuota operation.
*
* @see #getSendQuotaAsync(GetSendQuotaRequest)
*/
@Override
public java.util.concurrent.Future getSendQuotaAsync() {
return getSendQuotaAsync(new GetSendQuotaRequest());
}
/**
* Simplified method form for invoking the GetSendQuota operation with an
* AsyncHandler.
*
* @see #getSendQuotaAsync(GetSendQuotaRequest,
* com.amazonaws.handlers.AsyncHandler)
*/
public java.util.concurrent.Future getSendQuotaAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return getSendQuotaAsync(new GetSendQuotaRequest(), asyncHandler);
}
@Override
public java.util.concurrent.Future getSendStatisticsAsync(
GetSendStatisticsRequest request) {
return getSendStatisticsAsync(request, null);
}
@Override
public java.util.concurrent.Future getSendStatisticsAsync(
final GetSendStatisticsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public GetSendStatisticsResult call() throws Exception {
GetSendStatisticsResult result;
try {
result = getSendStatistics(request);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(request, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the GetSendStatistics operation.
*
* @see #getSendStatisticsAsync(GetSendStatisticsRequest)
*/
@Override
public java.util.concurrent.Future getSendStatisticsAsync() {
return getSendStatisticsAsync(new GetSendStatisticsRequest());
}
/**
* Simplified method form for invoking the GetSendStatistics operation with
* an AsyncHandler.
*
* @see #getSendStatisticsAsync(GetSendStatisticsRequest,
* com.amazonaws.handlers.AsyncHandler)
*/
public java.util.concurrent.Future getSendStatisticsAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return getSendStatisticsAsync(new GetSendStatisticsRequest(),
asyncHandler);
}
@Override
public java.util.concurrent.Future listIdentitiesAsync(
ListIdentitiesRequest request) {
return listIdentitiesAsync(request, null);
}
@Override
public java.util.concurrent.Future listIdentitiesAsync(
final ListIdentitiesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public ListIdentitiesResult call() throws Exception {
ListIdentitiesResult result;
try {
result = listIdentities(request);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(request, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the ListIdentities operation.
*
* @see #listIdentitiesAsync(ListIdentitiesRequest)
*/
@Override
public java.util.concurrent.Future listIdentitiesAsync() {
return listIdentitiesAsync(new ListIdentitiesRequest());
}
/**
* Simplified method form for invoking the ListIdentities operation with an
* AsyncHandler.
*
* @see #listIdentitiesAsync(ListIdentitiesRequest,
* com.amazonaws.handlers.AsyncHandler)
*/
public java.util.concurrent.Future listIdentitiesAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return listIdentitiesAsync(new ListIdentitiesRequest(), asyncHandler);
}
@Override
public java.util.concurrent.Future listIdentityPoliciesAsync(
ListIdentityPoliciesRequest request) {
return listIdentityPoliciesAsync(request, null);
}
@Override
public java.util.concurrent.Future listIdentityPoliciesAsync(
final ListIdentityPoliciesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public ListIdentityPoliciesResult call() throws Exception {
ListIdentityPoliciesResult result;
try {
result = listIdentityPolicies(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 listReceiptFiltersAsync(
ListReceiptFiltersRequest request) {
return listReceiptFiltersAsync(request, null);
}
@Override
public java.util.concurrent.Future listReceiptFiltersAsync(
final ListReceiptFiltersRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public ListReceiptFiltersResult call() throws Exception {
ListReceiptFiltersResult result;
try {
result = listReceiptFilters(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 listReceiptRuleSetsAsync(
ListReceiptRuleSetsRequest request) {
return listReceiptRuleSetsAsync(request, null);
}
@Override
public java.util.concurrent.Future listReceiptRuleSetsAsync(
final ListReceiptRuleSetsRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public ListReceiptRuleSetsResult call() throws Exception {
ListReceiptRuleSetsResult result;
try {
result = listReceiptRuleSets(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 listVerifiedEmailAddressesAsync(
ListVerifiedEmailAddressesRequest request) {
return listVerifiedEmailAddressesAsync(request, null);
}
@Override
public java.util.concurrent.Future listVerifiedEmailAddressesAsync(
final ListVerifiedEmailAddressesRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public ListVerifiedEmailAddressesResult call()
throws Exception {
ListVerifiedEmailAddressesResult result;
try {
result = listVerifiedEmailAddresses(request);
} catch (Exception ex) {
if (asyncHandler != null) {
asyncHandler.onError(ex);
}
throw ex;
}
if (asyncHandler != null) {
asyncHandler.onSuccess(request, result);
}
return result;
}
});
}
/**
* Simplified method form for invoking the ListVerifiedEmailAddresses
* operation.
*
* @see #listVerifiedEmailAddressesAsync(ListVerifiedEmailAddressesRequest)
*/
@Override
public java.util.concurrent.Future listVerifiedEmailAddressesAsync() {
return listVerifiedEmailAddressesAsync(new ListVerifiedEmailAddressesRequest());
}
/**
* Simplified method form for invoking the ListVerifiedEmailAddresses
* operation with an AsyncHandler.
*
* @see #listVerifiedEmailAddressesAsync(ListVerifiedEmailAddressesRequest,
* com.amazonaws.handlers.AsyncHandler)
*/
public java.util.concurrent.Future listVerifiedEmailAddressesAsync(
com.amazonaws.handlers.AsyncHandler asyncHandler) {
return listVerifiedEmailAddressesAsync(
new ListVerifiedEmailAddressesRequest(), asyncHandler);
}
@Override
public java.util.concurrent.Future putIdentityPolicyAsync(
PutIdentityPolicyRequest request) {
return putIdentityPolicyAsync(request, null);
}
@Override
public java.util.concurrent.Future putIdentityPolicyAsync(
final PutIdentityPolicyRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public PutIdentityPolicyResult call() throws Exception {
PutIdentityPolicyResult result;
try {
result = putIdentityPolicy(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 reorderReceiptRuleSetAsync(
ReorderReceiptRuleSetRequest request) {
return reorderReceiptRuleSetAsync(request, null);
}
@Override
public java.util.concurrent.Future reorderReceiptRuleSetAsync(
final ReorderReceiptRuleSetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public ReorderReceiptRuleSetResult call() throws Exception {
ReorderReceiptRuleSetResult result;
try {
result = reorderReceiptRuleSet(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 sendBounceAsync(
SendBounceRequest request) {
return sendBounceAsync(request, null);
}
@Override
public java.util.concurrent.Future sendBounceAsync(
final SendBounceRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public SendBounceResult call() throws Exception {
SendBounceResult result;
try {
result = sendBounce(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 sendEmailAsync(
SendEmailRequest request) {
return sendEmailAsync(request, null);
}
@Override
public java.util.concurrent.Future sendEmailAsync(
final SendEmailRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public SendEmailResult call() throws Exception {
SendEmailResult result;
try {
result = sendEmail(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 sendRawEmailAsync(
SendRawEmailRequest request) {
return sendRawEmailAsync(request, null);
}
@Override
public java.util.concurrent.Future sendRawEmailAsync(
final SendRawEmailRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public SendRawEmailResult call() throws Exception {
SendRawEmailResult result;
try {
result = sendRawEmail(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 setActiveReceiptRuleSetAsync(
SetActiveReceiptRuleSetRequest request) {
return setActiveReceiptRuleSetAsync(request, null);
}
@Override
public java.util.concurrent.Future setActiveReceiptRuleSetAsync(
final SetActiveReceiptRuleSetRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public SetActiveReceiptRuleSetResult call()
throws Exception {
SetActiveReceiptRuleSetResult result;
try {
result = setActiveReceiptRuleSet(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 setIdentityDkimEnabledAsync(
SetIdentityDkimEnabledRequest request) {
return setIdentityDkimEnabledAsync(request, null);
}
@Override
public java.util.concurrent.Future setIdentityDkimEnabledAsync(
final SetIdentityDkimEnabledRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public SetIdentityDkimEnabledResult call() throws Exception {
SetIdentityDkimEnabledResult result;
try {
result = setIdentityDkimEnabled(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 setIdentityFeedbackForwardingEnabledAsync(
SetIdentityFeedbackForwardingEnabledRequest request) {
return setIdentityFeedbackForwardingEnabledAsync(request, null);
}
@Override
public java.util.concurrent.Future setIdentityFeedbackForwardingEnabledAsync(
final SetIdentityFeedbackForwardingEnabledRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public SetIdentityFeedbackForwardingEnabledResult call()
throws Exception {
SetIdentityFeedbackForwardingEnabledResult result;
try {
result = setIdentityFeedbackForwardingEnabled(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 setIdentityMailFromDomainAsync(
SetIdentityMailFromDomainRequest request) {
return setIdentityMailFromDomainAsync(request, null);
}
@Override
public java.util.concurrent.Future setIdentityMailFromDomainAsync(
final SetIdentityMailFromDomainRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public SetIdentityMailFromDomainResult call()
throws Exception {
SetIdentityMailFromDomainResult result;
try {
result = setIdentityMailFromDomain(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 setIdentityNotificationTopicAsync(
SetIdentityNotificationTopicRequest request) {
return setIdentityNotificationTopicAsync(request, null);
}
@Override
public java.util.concurrent.Future setIdentityNotificationTopicAsync(
final SetIdentityNotificationTopicRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public SetIdentityNotificationTopicResult call()
throws Exception {
SetIdentityNotificationTopicResult result;
try {
result = setIdentityNotificationTopic(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 setReceiptRulePositionAsync(
SetReceiptRulePositionRequest request) {
return setReceiptRulePositionAsync(request, null);
}
@Override
public java.util.concurrent.Future setReceiptRulePositionAsync(
final SetReceiptRulePositionRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public SetReceiptRulePositionResult call() throws Exception {
SetReceiptRulePositionResult result;
try {
result = setReceiptRulePosition(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 updateReceiptRuleAsync(
UpdateReceiptRuleRequest request) {
return updateReceiptRuleAsync(request, null);
}
@Override
public java.util.concurrent.Future updateReceiptRuleAsync(
final UpdateReceiptRuleRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public UpdateReceiptRuleResult call() throws Exception {
UpdateReceiptRuleResult result;
try {
result = updateReceiptRule(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 verifyDomainDkimAsync(
VerifyDomainDkimRequest request) {
return verifyDomainDkimAsync(request, null);
}
@Override
public java.util.concurrent.Future verifyDomainDkimAsync(
final VerifyDomainDkimRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public VerifyDomainDkimResult call() throws Exception {
VerifyDomainDkimResult result;
try {
result = verifyDomainDkim(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 verifyDomainIdentityAsync(
VerifyDomainIdentityRequest request) {
return verifyDomainIdentityAsync(request, null);
}
@Override
public java.util.concurrent.Future verifyDomainIdentityAsync(
final VerifyDomainIdentityRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public VerifyDomainIdentityResult call() throws Exception {
VerifyDomainIdentityResult result;
try {
result = verifyDomainIdentity(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 verifyEmailAddressAsync(
VerifyEmailAddressRequest request) {
return verifyEmailAddressAsync(request, null);
}
@Override
public java.util.concurrent.Future verifyEmailAddressAsync(
final VerifyEmailAddressRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public Void call() throws Exception {
Void result;
try {
verifyEmailAddress(request);
result = null;
} 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 verifyEmailIdentityAsync(
VerifyEmailIdentityRequest request) {
return verifyEmailIdentityAsync(request, null);
}
@Override
public java.util.concurrent.Future verifyEmailIdentityAsync(
final VerifyEmailIdentityRequest request,
final com.amazonaws.handlers.AsyncHandler asyncHandler) {
return executorService
.submit(new java.util.concurrent.Callable() {
@Override
public VerifyEmailIdentityResult call() throws Exception {
VerifyEmailIdentityResult result;
try {
result = verifyEmailIdentity(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();
}
}