/* * Copyright 2010-2023 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.sns; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import com.amazonaws.AmazonClientException; import com.amazonaws.AmazonServiceException; import com.amazonaws.handlers.AsyncHandler; import com.amazonaws.ClientConfiguration; import com.amazonaws.auth.AWSCredentials; import com.amazonaws.auth.AWSCredentialsProvider; import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; import com.amazonaws.services.sns.model.*; /** * Interface for accessing Amazon Simple Notification Service asynchronously. * Amazon Simple Notification Service *

* Amazon Simple Notification Service (Amazon SNS) is a web service that enables * you to build distributed web-enabled applications. Applications can use * Amazon SNS to easily push real-time notification messages to interested * subscribers over multiple delivery protocols. For more information about this * product see the Amazon SNS product * page. For detailed information about Amazon SNS features and their * associated API calls, see the Amazon SNS Developer * Guide. *

*

* For information on the permissions you need to use this API, see Identity and access management in Amazon SNS in the Amazon SNS * Developer Guide. *

*

* We also provide SDKs that enable you to access Amazon SNS from your preferred * programming language. The SDKs contain functionality that automatically takes * care of tasks such as: cryptographically signing your service requests, * retrying requests, and handling error responses. For a list of available * SDKs, go to Tools for Amazon Web * Services. *

**/ public class AmazonSNSAsyncClient extends AmazonSNSClient implements AmazonSNSAsync { /** * Executor service for executing asynchronous requests. */ private ExecutorService executorService; private static final int DEFAULT_THREAD_POOL_SIZE = 10; /** * Constructs a new asynchronous client to invoke service methods on Amazon * Simple Notification Service. A credentials provider chain will be used * that searches for credentials in this order: * *

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @see DefaultAWSCredentialsProviderChain */ @Deprecated public AmazonSNSAsyncClient() { this(new DefaultAWSCredentialsProviderChain()); } /** * Constructs a new asynchronous client to invoke service methods on Amazon * Simple Notification Service. A credentials provider chain will be used * that searches for credentials in this order: *

*

* All service calls made using this new client object are blocking, and * will not return until the service call completes. * * @param clientConfiguration The client configuration options controlling * how this client connects to Amazon Simple Notification Service * (ex: proxy settings, retry counts, etc.). * @see DefaultAWSCredentialsProviderChain */ @Deprecated public AmazonSNSAsyncClient(ClientConfiguration clientConfiguration) { this(new DefaultAWSCredentialsProviderChain(), clientConfiguration, Executors .newFixedThreadPool(clientConfiguration.getMaxConnections())); } /** * Constructs a new asynchronous client to invoke service methods on Amazon * Simple Notification Service using the specified AWS account credentials. * Default client settings will be used, and a fixed size thread pool will * be created for executing the asynchronous tasks. *

* All calls made using this new client object are non-blocking, and will * immediately return a Java Future object that the caller can later check * to see if the service call has actually completed. * * @param awsCredentials The AWS credentials (access key ID and secret key) * to use when authenticating with AWS services. */ public AmazonSNSAsyncClient(AWSCredentials awsCredentials) { this(awsCredentials, Executors.newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE)); } /** * Constructs a new asynchronous client to invoke service methods on Amazon * Simple Notification Service using the specified AWS account credentials * and executor service. Default client settings will be used. *

* All calls made using this new client object are non-blocking, and will * immediately return a Java Future object that the caller can later check * to see if the service call has actually completed. * * @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 AmazonSNSAsyncClient(AWSCredentials awsCredentials, ExecutorService executorService) { super(awsCredentials); this.executorService = executorService; } /** * Constructs a new asynchronous client to invoke service methods on Amazon * Simple Notification Service using the specified AWS account credentials, * executor service, and client configuration options. *

* All calls made using this new client object are non-blocking, and will * immediately return a Java Future object that the caller can later check * to see if the service call has actually completed. * * @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 AmazonSNSAsyncClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration, ExecutorService executorService) { super(awsCredentials, clientConfiguration); this.executorService = executorService; } /** * Constructs a new asynchronous client to invoke service methods on Amazon * Simple Notification Service using the specified AWS account credentials * provider. Default client settings will be used, and a fixed size thread * pool will be created for executing the asynchronous tasks. *

* All calls made using this new client object are non-blocking, and will * immediately return a Java Future object that the caller can later check * to see if the service call has actually completed. * * @param awsCredentialsProvider The AWS credentials provider which will * provide credentials to authenticate requests with AWS * services. */ public AmazonSNSAsyncClient(AWSCredentialsProvider awsCredentialsProvider) { this(awsCredentialsProvider, Executors.newFixedThreadPool(DEFAULT_THREAD_POOL_SIZE)); } /** * Constructs a new asynchronous client to invoke service methods on Amazon * Simple Notification Service using the specified AWS account credentials * provider and executor service. Default client settings will be used. *

* All calls made using this new client object are non-blocking, and will * immediately return a Java Future object that the caller can later check * to see if the service call has actually completed. * * @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 AmazonSNSAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ExecutorService executorService) { this(awsCredentialsProvider, new ClientConfiguration(), executorService); } /** * Constructs a new asynchronous client to invoke service methods on Amazon * Simple Notification Service using the specified AWS account credentials * provider and client configuration options. *

* All calls made using this new client object are non-blocking, and will * immediately return a Java Future object that the caller can later check * to see if the service call has actually completed. * * @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). */ public AmazonSNSAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) { this(awsCredentialsProvider, clientConfiguration, Executors .newFixedThreadPool(clientConfiguration.getMaxConnections())); } /** * Constructs a new asynchronous client to invoke service methods on Amazon * Simple Notification Service using the specified AWS account credentials * provider, executor service, and client configuration options. *

* All calls made using this new client object are non-blocking, and will * immediately return a Java Future object that the caller can later check * to see if the service call has actually completed. * * @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 AmazonSNSAsyncClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, ExecutorService executorService) { super(awsCredentialsProvider, clientConfiguration); this.executorService = executorService; } /** * Returns the executor service used by this async client to execute * requests. * * @return The executor service used by this async client to execute * requests. */ public ExecutorService getExecutorService() { return executorService; } /** * 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 getExecutorService().shutdown() followed by * getExecutorService().awaitTermination() prior to calling this method. */ @Override public void shutdown() { super.shutdown(); executorService.shutdownNow(); } /** *

* Adds a statement to a topic's access control policy, granting access for * the specified Amazon Web Services accounts to the specified actions. *

* *

* To remove the ability to change topic permissions, you must deny * permissions to the AddPermission, * RemovePermission, and SetTopicAttributes * actions in your IAM policy. *

*
* * @param addPermissionRequest * @return A Java Future object containing the response from the * AddPermission service method, as returned by Amazon Simple * Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future addPermissionAsync(final AddPermissionRequest addPermissionRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { addPermission(addPermissionRequest); return null; } }); } /** *

* Adds a statement to a topic's access control policy, granting access for * the specified Amazon Web Services accounts to the specified actions. *

* *

* To remove the ability to change topic permissions, you must deny * permissions to the AddPermission, * RemovePermission, and SetTopicAttributes * actions in your IAM policy. *

*
* * @param addPermissionRequest * @return A Java Future object containing the response from the * AddPermission service method, as returned by Amazon Simple * Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future addPermissionAsync(final AddPermissionRequest addPermissionRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { Void result = null; try { addPermission(addPermissionRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(addPermissionRequest, result); return result; } }); } /** *

* Accepts a phone number and indicates whether the phone holder has opted * out of receiving SMS messages from your Amazon Web Services account. You * cannot send SMS messages to a number that is opted out. *

*

* To resume sending messages, you can opt in the number by using the * OptInPhoneNumber action. *

* * @param checkIfPhoneNumberIsOptedOutRequest

* The input for the CheckIfPhoneNumberIsOptedOut * action. *

* @return A Java Future object containing the response from the * CheckIfPhoneNumberIsOptedOut service method, as returned by * Amazon Simple Notification Service. * @throws ThrottledException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws InvalidParameterException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future checkIfPhoneNumberIsOptedOutAsync( final CheckIfPhoneNumberIsOptedOutRequest checkIfPhoneNumberIsOptedOutRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public CheckIfPhoneNumberIsOptedOutResult call() throws Exception { return checkIfPhoneNumberIsOptedOut(checkIfPhoneNumberIsOptedOutRequest); } }); } /** *

* Accepts a phone number and indicates whether the phone holder has opted * out of receiving SMS messages from your Amazon Web Services account. You * cannot send SMS messages to a number that is opted out. *

*

* To resume sending messages, you can opt in the number by using the * OptInPhoneNumber action. *

* * @param checkIfPhoneNumberIsOptedOutRequest

* The input for the CheckIfPhoneNumberIsOptedOut * action. *

* @return A Java Future object containing the response from the * CheckIfPhoneNumberIsOptedOut service method, as returned by * Amazon Simple Notification Service. * @throws ThrottledException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws InvalidParameterException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future checkIfPhoneNumberIsOptedOutAsync( final CheckIfPhoneNumberIsOptedOutRequest checkIfPhoneNumberIsOptedOutRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public CheckIfPhoneNumberIsOptedOutResult call() throws Exception { CheckIfPhoneNumberIsOptedOutResult result = null; try { result = checkIfPhoneNumberIsOptedOut(checkIfPhoneNumberIsOptedOutRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(checkIfPhoneNumberIsOptedOutRequest, result); return result; } }); } /** *

* Verifies an endpoint owner's intent to receive messages by validating the * token sent to the endpoint by an earlier Subscribe action. * If the token is valid, the action creates a new subscription and returns * its Amazon Resource Name (ARN). This call requires an AWS signature only * when the AuthenticateOnUnsubscribe flag is set to "true". *

* * @param confirmSubscriptionRequest

* Input for ConfirmSubscription action. *

* @return A Java Future object containing the response from the * ConfirmSubscription service method, as returned by Amazon Simple * Notification Service. * @throws SubscriptionLimitExceededException * @throws InvalidParameterException * @throws NotFoundException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws FilterPolicyLimitExceededException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future confirmSubscriptionAsync( final ConfirmSubscriptionRequest confirmSubscriptionRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ConfirmSubscriptionResult call() throws Exception { return confirmSubscription(confirmSubscriptionRequest); } }); } /** *

* Verifies an endpoint owner's intent to receive messages by validating the * token sent to the endpoint by an earlier Subscribe action. * If the token is valid, the action creates a new subscription and returns * its Amazon Resource Name (ARN). This call requires an AWS signature only * when the AuthenticateOnUnsubscribe flag is set to "true". *

* * @param confirmSubscriptionRequest

* Input for ConfirmSubscription action. *

* @return A Java Future object containing the response from the * ConfirmSubscription service method, as returned by Amazon Simple * Notification Service. * @throws SubscriptionLimitExceededException * @throws InvalidParameterException * @throws NotFoundException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws FilterPolicyLimitExceededException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future confirmSubscriptionAsync( final ConfirmSubscriptionRequest confirmSubscriptionRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ConfirmSubscriptionResult call() throws Exception { ConfirmSubscriptionResult result = null; try { result = confirmSubscription(confirmSubscriptionRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(confirmSubscriptionRequest, result); return result; } }); } /** *

* Creates a platform application object for one of the supported push * notification services, such as APNS and GCM (Firebase Cloud Messaging), * to which devices and mobile apps may register. You must specify * PlatformPrincipal and PlatformCredential * attributes when using the CreatePlatformApplication action. *

*

* PlatformPrincipal and PlatformCredential are * received from the notification service. *

*
    *
  • *

    * For ADM, PlatformPrincipal is * client id and PlatformCredential is * client secret. *

    *
  • *
  • *

    * For Baidu, PlatformPrincipal is * API key and PlatformCredential is * secret key. *

    *
  • *
  • *

    * For APNS and APNS_SANDBOX using certificate * credentials, PlatformPrincipal is * SSL certificate and PlatformCredential is * private key. *

    *
  • *
  • *

    * For APNS and APNS_SANDBOX using token * credentials, PlatformPrincipal is * signing key ID and PlatformCredential is * signing key. *

    *
  • *
  • *

    * For GCM (Firebase Cloud Messaging), there is no * PlatformPrincipal and the PlatformCredential is * API key. *

    *
  • *
  • *

    * For MPNS, PlatformPrincipal is * TLS certificate and PlatformCredential is * private key. *

    *
  • *
  • *

    * For WNS, PlatformPrincipal is * Package Security Identifier and * PlatformCredential is secret key. *

    *
  • *
*

* You can use the returned PlatformApplicationArn as an * attribute for the CreatePlatformEndpoint action. *

* * @param createPlatformApplicationRequest

* Input for CreatePlatformApplication action. *

* @return A Java Future object containing the response from the * CreatePlatformApplication service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future createPlatformApplicationAsync( final CreatePlatformApplicationRequest createPlatformApplicationRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public CreatePlatformApplicationResult call() throws Exception { return createPlatformApplication(createPlatformApplicationRequest); } }); } /** *

* Creates a platform application object for one of the supported push * notification services, such as APNS and GCM (Firebase Cloud Messaging), * to which devices and mobile apps may register. You must specify * PlatformPrincipal and PlatformCredential * attributes when using the CreatePlatformApplication action. *

*

* PlatformPrincipal and PlatformCredential are * received from the notification service. *

*
    *
  • *

    * For ADM, PlatformPrincipal is * client id and PlatformCredential is * client secret. *

    *
  • *
  • *

    * For Baidu, PlatformPrincipal is * API key and PlatformCredential is * secret key. *

    *
  • *
  • *

    * For APNS and APNS_SANDBOX using certificate * credentials, PlatformPrincipal is * SSL certificate and PlatformCredential is * private key. *

    *
  • *
  • *

    * For APNS and APNS_SANDBOX using token * credentials, PlatformPrincipal is * signing key ID and PlatformCredential is * signing key. *

    *
  • *
  • *

    * For GCM (Firebase Cloud Messaging), there is no * PlatformPrincipal and the PlatformCredential is * API key. *

    *
  • *
  • *

    * For MPNS, PlatformPrincipal is * TLS certificate and PlatformCredential is * private key. *

    *
  • *
  • *

    * For WNS, PlatformPrincipal is * Package Security Identifier and * PlatformCredential is secret key. *

    *
  • *
*

* You can use the returned PlatformApplicationArn as an * attribute for the CreatePlatformEndpoint action. *

* * @param createPlatformApplicationRequest

* Input for CreatePlatformApplication action. *

* @return A Java Future object containing the response from the * CreatePlatformApplication service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future createPlatformApplicationAsync( final CreatePlatformApplicationRequest createPlatformApplicationRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public CreatePlatformApplicationResult call() throws Exception { CreatePlatformApplicationResult result = null; try { result = createPlatformApplication(createPlatformApplicationRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(createPlatformApplicationRequest, result); return result; } }); } /** *

* Creates an endpoint for a device and mobile app on one of the supported * push notification services, such as GCM (Firebase Cloud Messaging) and * APNS. CreatePlatformEndpoint requires the * PlatformApplicationArn that is returned from * CreatePlatformApplication. You can use the returned * EndpointArn to send a message to a mobile app or by the * Subscribe action for subscription to a topic. The * CreatePlatformEndpoint action is idempotent, so if the * requester already owns an endpoint with the same device token and * attributes, that endpoint's ARN is returned without creating a new * endpoint. For more information, see Using * Amazon SNS Mobile Push Notifications. *

*

* When using CreatePlatformEndpoint with Baidu, two attributes * must be provided: ChannelId and UserId. The token field must also contain * the ChannelId. For more information, see Creating an Amazon SNS Endpoint for Baidu. *

* * @param createPlatformEndpointRequest

* Input for CreatePlatformEndpoint action. *

* @return A Java Future object containing the response from the * CreatePlatformEndpoint service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future createPlatformEndpointAsync( final CreatePlatformEndpointRequest createPlatformEndpointRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public CreatePlatformEndpointResult call() throws Exception { return createPlatformEndpoint(createPlatformEndpointRequest); } }); } /** *

* Creates an endpoint for a device and mobile app on one of the supported * push notification services, such as GCM (Firebase Cloud Messaging) and * APNS. CreatePlatformEndpoint requires the * PlatformApplicationArn that is returned from * CreatePlatformApplication. You can use the returned * EndpointArn to send a message to a mobile app or by the * Subscribe action for subscription to a topic. The * CreatePlatformEndpoint action is idempotent, so if the * requester already owns an endpoint with the same device token and * attributes, that endpoint's ARN is returned without creating a new * endpoint. For more information, see Using * Amazon SNS Mobile Push Notifications. *

*

* When using CreatePlatformEndpoint with Baidu, two attributes * must be provided: ChannelId and UserId. The token field must also contain * the ChannelId. For more information, see Creating an Amazon SNS Endpoint for Baidu. *

* * @param createPlatformEndpointRequest

* Input for CreatePlatformEndpoint action. *

* @return A Java Future object containing the response from the * CreatePlatformEndpoint service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future createPlatformEndpointAsync( final CreatePlatformEndpointRequest createPlatformEndpointRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public CreatePlatformEndpointResult call() throws Exception { CreatePlatformEndpointResult result = null; try { result = createPlatformEndpoint(createPlatformEndpointRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(createPlatformEndpointRequest, result); return result; } }); } /** *

* Adds a destination phone number to an Amazon Web Services account in the * SMS sandbox and sends a one-time password (OTP) to that phone number. *

*

* When you start using Amazon SNS to send SMS messages, your Amazon Web * Services account is in the SMS sandbox. The SMS sandbox provides a * safe environment for you to try Amazon SNS features without risking your * reputation as an SMS sender. While your Amazon Web Services account is in * the SMS sandbox, you can use all of the features of Amazon SNS. However, * you can send SMS messages only to verified destination phone numbers. For * more information, including how to move out of the sandbox to send * messages without restrictions, see SMS * sandbox in the Amazon SNS Developer Guide. *

* * @param createSMSSandboxPhoneNumberRequest * @return A Java Future object containing the response from the * CreateSMSSandboxPhoneNumber service method, as returned by Amazon * Simple Notification Service. * @throws AuthorizationErrorException * @throws InternalErrorException * @throws InvalidParameterException * @throws OptedOutException * @throws UserErrorException * @throws ThrottledException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future createSMSSandboxPhoneNumberAsync( final CreateSMSSandboxPhoneNumberRequest createSMSSandboxPhoneNumberRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public CreateSMSSandboxPhoneNumberResult call() throws Exception { return createSMSSandboxPhoneNumber(createSMSSandboxPhoneNumberRequest); } }); } /** *

* Adds a destination phone number to an Amazon Web Services account in the * SMS sandbox and sends a one-time password (OTP) to that phone number. *

*

* When you start using Amazon SNS to send SMS messages, your Amazon Web * Services account is in the SMS sandbox. The SMS sandbox provides a * safe environment for you to try Amazon SNS features without risking your * reputation as an SMS sender. While your Amazon Web Services account is in * the SMS sandbox, you can use all of the features of Amazon SNS. However, * you can send SMS messages only to verified destination phone numbers. For * more information, including how to move out of the sandbox to send * messages without restrictions, see SMS * sandbox in the Amazon SNS Developer Guide. *

* * @param createSMSSandboxPhoneNumberRequest * @return A Java Future object containing the response from the * CreateSMSSandboxPhoneNumber service method, as returned by Amazon * Simple Notification Service. * @throws AuthorizationErrorException * @throws InternalErrorException * @throws InvalidParameterException * @throws OptedOutException * @throws UserErrorException * @throws ThrottledException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future createSMSSandboxPhoneNumberAsync( final CreateSMSSandboxPhoneNumberRequest createSMSSandboxPhoneNumberRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public CreateSMSSandboxPhoneNumberResult call() throws Exception { CreateSMSSandboxPhoneNumberResult result = null; try { result = createSMSSandboxPhoneNumber(createSMSSandboxPhoneNumberRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(createSMSSandboxPhoneNumberRequest, result); return result; } }); } /** *

* Creates a topic to which notifications can be published. Users can create * at most 100,000 standard topics (at most 1,000 FIFO topics). For more * information, see Creating an Amazon SNS topic in the Amazon SNS Developer * Guide. This action is idempotent, so if the requester already owns a * topic with the specified name, that topic's ARN is returned without * creating a new topic. *

* * @param createTopicRequest

* Input for CreateTopic action. *

* @return A Java Future object containing the response from the CreateTopic * service method, as returned by Amazon Simple Notification * Service. * @throws InvalidParameterException * @throws TopicLimitExceededException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws InvalidSecurityException * @throws TagLimitExceededException * @throws StaleTagException * @throws TagPolicyException * @throws ConcurrentAccessException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future createTopicAsync(final CreateTopicRequest createTopicRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public CreateTopicResult call() throws Exception { return createTopic(createTopicRequest); } }); } /** *

* Creates a topic to which notifications can be published. Users can create * at most 100,000 standard topics (at most 1,000 FIFO topics). For more * information, see Creating an Amazon SNS topic in the Amazon SNS Developer * Guide. This action is idempotent, so if the requester already owns a * topic with the specified name, that topic's ARN is returned without * creating a new topic. *

* * @param createTopicRequest

* Input for CreateTopic action. *

* @return A Java Future object containing the response from the CreateTopic * service method, as returned by Amazon Simple Notification * Service. * @throws InvalidParameterException * @throws TopicLimitExceededException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws InvalidSecurityException * @throws TagLimitExceededException * @throws StaleTagException * @throws TagPolicyException * @throws ConcurrentAccessException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future createTopicAsync(final CreateTopicRequest createTopicRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public CreateTopicResult call() throws Exception { CreateTopicResult result = null; try { result = createTopic(createTopicRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(createTopicRequest, result); return result; } }); } /** *

* Deletes the endpoint for a device and mobile app from Amazon SNS. This * action is idempotent. For more information, see Using * Amazon SNS Mobile Push Notifications. *

*

* When you delete an endpoint that is also subscribed to a topic, then you * must also unsubscribe the endpoint from the topic. *

* * @param deleteEndpointRequest

* Input for DeleteEndpoint action. *

* @return A Java Future object containing the response from the * DeleteEndpoint service method, as returned by Amazon Simple * Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future deleteEndpointAsync(final DeleteEndpointRequest deleteEndpointRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { deleteEndpoint(deleteEndpointRequest); return null; } }); } /** *

* Deletes the endpoint for a device and mobile app from Amazon SNS. This * action is idempotent. For more information, see Using * Amazon SNS Mobile Push Notifications. *

*

* When you delete an endpoint that is also subscribed to a topic, then you * must also unsubscribe the endpoint from the topic. *

* * @param deleteEndpointRequest

* Input for DeleteEndpoint action. *

* @return A Java Future object containing the response from the * DeleteEndpoint service method, as returned by Amazon Simple * Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future deleteEndpointAsync(final DeleteEndpointRequest deleteEndpointRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { Void result = null; try { deleteEndpoint(deleteEndpointRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(deleteEndpointRequest, result); return result; } }); } /** *

* Deletes a platform application object for one of the supported push * notification services, such as APNS and GCM (Firebase Cloud Messaging). * For more information, see Using * Amazon SNS Mobile Push Notifications. *

* * @param deletePlatformApplicationRequest

* Input for DeletePlatformApplication action. *

* @return A Java Future object containing the response from the * DeletePlatformApplication service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future deletePlatformApplicationAsync( final DeletePlatformApplicationRequest deletePlatformApplicationRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { deletePlatformApplication(deletePlatformApplicationRequest); return null; } }); } /** *

* Deletes a platform application object for one of the supported push * notification services, such as APNS and GCM (Firebase Cloud Messaging). * For more information, see Using * Amazon SNS Mobile Push Notifications. *

* * @param deletePlatformApplicationRequest

* Input for DeletePlatformApplication action. *

* @return A Java Future object containing the response from the * DeletePlatformApplication service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future deletePlatformApplicationAsync( final DeletePlatformApplicationRequest deletePlatformApplicationRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { Void result = null; try { deletePlatformApplication(deletePlatformApplicationRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(deletePlatformApplicationRequest, result); return result; } }); } /** *

* Deletes an Amazon Web Services account's verified or pending phone number * from the SMS sandbox. *

*

* When you start using Amazon SNS to send SMS messages, your Amazon Web * Services account is in the SMS sandbox. The SMS sandbox provides a * safe environment for you to try Amazon SNS features without risking your * reputation as an SMS sender. While your Amazon Web Services account is in * the SMS sandbox, you can use all of the features of Amazon SNS. However, * you can send SMS messages only to verified destination phone numbers. For * more information, including how to move out of the sandbox to send * messages without restrictions, see SMS * sandbox in the Amazon SNS Developer Guide. *

* * @param deleteSMSSandboxPhoneNumberRequest * @return A Java Future object containing the response from the * DeleteSMSSandboxPhoneNumber service method, as returned by Amazon * Simple Notification Service. * @throws AuthorizationErrorException * @throws InternalErrorException * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws UserErrorException * @throws ThrottledException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future deleteSMSSandboxPhoneNumberAsync( final DeleteSMSSandboxPhoneNumberRequest deleteSMSSandboxPhoneNumberRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DeleteSMSSandboxPhoneNumberResult call() throws Exception { return deleteSMSSandboxPhoneNumber(deleteSMSSandboxPhoneNumberRequest); } }); } /** *

* Deletes an Amazon Web Services account's verified or pending phone number * from the SMS sandbox. *

*

* When you start using Amazon SNS to send SMS messages, your Amazon Web * Services account is in the SMS sandbox. The SMS sandbox provides a * safe environment for you to try Amazon SNS features without risking your * reputation as an SMS sender. While your Amazon Web Services account is in * the SMS sandbox, you can use all of the features of Amazon SNS. However, * you can send SMS messages only to verified destination phone numbers. For * more information, including how to move out of the sandbox to send * messages without restrictions, see SMS * sandbox in the Amazon SNS Developer Guide. *

* * @param deleteSMSSandboxPhoneNumberRequest * @return A Java Future object containing the response from the * DeleteSMSSandboxPhoneNumber service method, as returned by Amazon * Simple Notification Service. * @throws AuthorizationErrorException * @throws InternalErrorException * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws UserErrorException * @throws ThrottledException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future deleteSMSSandboxPhoneNumberAsync( final DeleteSMSSandboxPhoneNumberRequest deleteSMSSandboxPhoneNumberRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public DeleteSMSSandboxPhoneNumberResult call() throws Exception { DeleteSMSSandboxPhoneNumberResult result = null; try { result = deleteSMSSandboxPhoneNumber(deleteSMSSandboxPhoneNumberRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(deleteSMSSandboxPhoneNumberRequest, result); return result; } }); } /** *

* Deletes a topic and all its subscriptions. Deleting a topic might prevent * some messages previously sent to the topic from being delivered to * subscribers. This action is idempotent, so deleting a topic that does not * exist does not result in an error. *

* * @param deleteTopicRequest * @return A Java Future object containing the response from the DeleteTopic * service method, as returned by Amazon Simple Notification * Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws StaleTagException * @throws TagPolicyException * @throws ConcurrentAccessException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future deleteTopicAsync(final DeleteTopicRequest deleteTopicRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { deleteTopic(deleteTopicRequest); return null; } }); } /** *

* Deletes a topic and all its subscriptions. Deleting a topic might prevent * some messages previously sent to the topic from being delivered to * subscribers. This action is idempotent, so deleting a topic that does not * exist does not result in an error. *

* * @param deleteTopicRequest * @return A Java Future object containing the response from the DeleteTopic * service method, as returned by Amazon Simple Notification * Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws StaleTagException * @throws TagPolicyException * @throws ConcurrentAccessException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future deleteTopicAsync(final DeleteTopicRequest deleteTopicRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { Void result = null; try { deleteTopic(deleteTopicRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(deleteTopicRequest, result); return result; } }); } /** *

* Retrieves the specified inline DataProtectionPolicy document * that is stored in the specified Amazon SNS topic. *

* * @param getDataProtectionPolicyRequest * @return A Java Future object containing the response from the * GetDataProtectionPolicy service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws NotFoundException * @throws AuthorizationErrorException * @throws InvalidSecurityException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future getDataProtectionPolicyAsync( final GetDataProtectionPolicyRequest getDataProtectionPolicyRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public GetDataProtectionPolicyResult call() throws Exception { return getDataProtectionPolicy(getDataProtectionPolicyRequest); } }); } /** *

* Retrieves the specified inline DataProtectionPolicy document * that is stored in the specified Amazon SNS topic. *

* * @param getDataProtectionPolicyRequest * @return A Java Future object containing the response from the * GetDataProtectionPolicy service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws NotFoundException * @throws AuthorizationErrorException * @throws InvalidSecurityException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future getDataProtectionPolicyAsync( final GetDataProtectionPolicyRequest getDataProtectionPolicyRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public GetDataProtectionPolicyResult call() throws Exception { GetDataProtectionPolicyResult result = null; try { result = getDataProtectionPolicy(getDataProtectionPolicyRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(getDataProtectionPolicyRequest, result); return result; } }); } /** *

* Retrieves the endpoint attributes for a device on one of the supported * push notification services, such as GCM (Firebase Cloud Messaging) and * APNS. For more information, see Using * Amazon SNS Mobile Push Notifications. *

* * @param getEndpointAttributesRequest

* Input for GetEndpointAttributes action. *

* @return A Java Future object containing the response from the * GetEndpointAttributes service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future getEndpointAttributesAsync( final GetEndpointAttributesRequest getEndpointAttributesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public GetEndpointAttributesResult call() throws Exception { return getEndpointAttributes(getEndpointAttributesRequest); } }); } /** *

* Retrieves the endpoint attributes for a device on one of the supported * push notification services, such as GCM (Firebase Cloud Messaging) and * APNS. For more information, see Using * Amazon SNS Mobile Push Notifications. *

* * @param getEndpointAttributesRequest

* Input for GetEndpointAttributes action. *

* @return A Java Future object containing the response from the * GetEndpointAttributes service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future getEndpointAttributesAsync( final GetEndpointAttributesRequest getEndpointAttributesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public GetEndpointAttributesResult call() throws Exception { GetEndpointAttributesResult result = null; try { result = getEndpointAttributes(getEndpointAttributesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(getEndpointAttributesRequest, result); return result; } }); } /** *

* Retrieves the attributes of the platform application object for the * supported push notification services, such as APNS and GCM (Firebase * Cloud Messaging). For more information, see Using * Amazon SNS Mobile Push Notifications. *

* * @param getPlatformApplicationAttributesRequest

* Input for GetPlatformApplicationAttributes action. *

* @return A Java Future object containing the response from the * GetPlatformApplicationAttributes service method, as returned by * Amazon Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future getPlatformApplicationAttributesAsync( final GetPlatformApplicationAttributesRequest getPlatformApplicationAttributesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public GetPlatformApplicationAttributesResult call() throws Exception { return getPlatformApplicationAttributes(getPlatformApplicationAttributesRequest); } }); } /** *

* Retrieves the attributes of the platform application object for the * supported push notification services, such as APNS and GCM (Firebase * Cloud Messaging). For more information, see Using * Amazon SNS Mobile Push Notifications. *

* * @param getPlatformApplicationAttributesRequest

* Input for GetPlatformApplicationAttributes action. *

* @return A Java Future object containing the response from the * GetPlatformApplicationAttributes service method, as returned by * Amazon Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future getPlatformApplicationAttributesAsync( final GetPlatformApplicationAttributesRequest getPlatformApplicationAttributesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public GetPlatformApplicationAttributesResult call() throws Exception { GetPlatformApplicationAttributesResult result = null; try { result = getPlatformApplicationAttributes(getPlatformApplicationAttributesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(getPlatformApplicationAttributesRequest, result); return result; } }); } /** *

* Returns the settings for sending SMS messages from your Amazon Web * Services account. *

*

* These settings are set with the SetSMSAttributes action. *

* * @param getSMSAttributesRequest

* The input for the GetSMSAttributes request. *

* @return A Java Future object containing the response from the * GetSMSAttributes service method, as returned by Amazon Simple * Notification Service. * @throws ThrottledException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws InvalidParameterException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future getSMSAttributesAsync( final GetSMSAttributesRequest getSMSAttributesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public GetSMSAttributesResult call() throws Exception { return getSMSAttributes(getSMSAttributesRequest); } }); } /** *

* Returns the settings for sending SMS messages from your Amazon Web * Services account. *

*

* These settings are set with the SetSMSAttributes action. *

* * @param getSMSAttributesRequest

* The input for the GetSMSAttributes request. *

* @return A Java Future object containing the response from the * GetSMSAttributes service method, as returned by Amazon Simple * Notification Service. * @throws ThrottledException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws InvalidParameterException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future getSMSAttributesAsync( final GetSMSAttributesRequest getSMSAttributesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public GetSMSAttributesResult call() throws Exception { GetSMSAttributesResult result = null; try { result = getSMSAttributes(getSMSAttributesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(getSMSAttributesRequest, result); return result; } }); } /** *

* Retrieves the SMS sandbox status for the calling Amazon Web Services * account in the target Amazon Web Services Region. *

*

* When you start using Amazon SNS to send SMS messages, your Amazon Web * Services account is in the SMS sandbox. The SMS sandbox provides a * safe environment for you to try Amazon SNS features without risking your * reputation as an SMS sender. While your Amazon Web Services account is in * the SMS sandbox, you can use all of the features of Amazon SNS. However, * you can send SMS messages only to verified destination phone numbers. For * more information, including how to move out of the sandbox to send * messages without restrictions, see SMS * sandbox in the Amazon SNS Developer Guide. *

* * @param getSMSSandboxAccountStatusRequest * @return A Java Future object containing the response from the * GetSMSSandboxAccountStatus service method, as returned by Amazon * Simple Notification Service. * @throws AuthorizationErrorException * @throws InternalErrorException * @throws ThrottledException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future getSMSSandboxAccountStatusAsync( final GetSMSSandboxAccountStatusRequest getSMSSandboxAccountStatusRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public GetSMSSandboxAccountStatusResult call() throws Exception { return getSMSSandboxAccountStatus(getSMSSandboxAccountStatusRequest); } }); } /** *

* Retrieves the SMS sandbox status for the calling Amazon Web Services * account in the target Amazon Web Services Region. *

*

* When you start using Amazon SNS to send SMS messages, your Amazon Web * Services account is in the SMS sandbox. The SMS sandbox provides a * safe environment for you to try Amazon SNS features without risking your * reputation as an SMS sender. While your Amazon Web Services account is in * the SMS sandbox, you can use all of the features of Amazon SNS. However, * you can send SMS messages only to verified destination phone numbers. For * more information, including how to move out of the sandbox to send * messages without restrictions, see SMS * sandbox in the Amazon SNS Developer Guide. *

* * @param getSMSSandboxAccountStatusRequest * @return A Java Future object containing the response from the * GetSMSSandboxAccountStatus service method, as returned by Amazon * Simple Notification Service. * @throws AuthorizationErrorException * @throws InternalErrorException * @throws ThrottledException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future getSMSSandboxAccountStatusAsync( final GetSMSSandboxAccountStatusRequest getSMSSandboxAccountStatusRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public GetSMSSandboxAccountStatusResult call() throws Exception { GetSMSSandboxAccountStatusResult result = null; try { result = getSMSSandboxAccountStatus(getSMSSandboxAccountStatusRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(getSMSSandboxAccountStatusRequest, result); return result; } }); } /** *

* Returns all of the properties of a subscription. *

* * @param getSubscriptionAttributesRequest

* Input for GetSubscriptionAttributes. *

* @return A Java Future object containing the response from the * GetSubscriptionAttributes service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws NotFoundException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future getSubscriptionAttributesAsync( final GetSubscriptionAttributesRequest getSubscriptionAttributesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public GetSubscriptionAttributesResult call() throws Exception { return getSubscriptionAttributes(getSubscriptionAttributesRequest); } }); } /** *

* Returns all of the properties of a subscription. *

* * @param getSubscriptionAttributesRequest

* Input for GetSubscriptionAttributes. *

* @return A Java Future object containing the response from the * GetSubscriptionAttributes service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws NotFoundException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future getSubscriptionAttributesAsync( final GetSubscriptionAttributesRequest getSubscriptionAttributesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public GetSubscriptionAttributesResult call() throws Exception { GetSubscriptionAttributesResult result = null; try { result = getSubscriptionAttributes(getSubscriptionAttributesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(getSubscriptionAttributesRequest, result); return result; } }); } /** *

* Returns all of the properties of a topic. Topic properties returned might * differ based on the authorization of the user. *

* * @param getTopicAttributesRequest

* Input for GetTopicAttributes action. *

* @return A Java Future object containing the response from the * GetTopicAttributes service method, as returned by Amazon Simple * Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws NotFoundException * @throws AuthorizationErrorException * @throws InvalidSecurityException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future getTopicAttributesAsync( final GetTopicAttributesRequest getTopicAttributesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public GetTopicAttributesResult call() throws Exception { return getTopicAttributes(getTopicAttributesRequest); } }); } /** *

* Returns all of the properties of a topic. Topic properties returned might * differ based on the authorization of the user. *

* * @param getTopicAttributesRequest

* Input for GetTopicAttributes action. *

* @return A Java Future object containing the response from the * GetTopicAttributes service method, as returned by Amazon Simple * Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws NotFoundException * @throws AuthorizationErrorException * @throws InvalidSecurityException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future getTopicAttributesAsync( final GetTopicAttributesRequest getTopicAttributesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public GetTopicAttributesResult call() throws Exception { GetTopicAttributesResult result = null; try { result = getTopicAttributes(getTopicAttributesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(getTopicAttributesRequest, result); return result; } }); } /** *

* Lists the endpoints and endpoint attributes for devices in a supported * push notification service, such as GCM (Firebase Cloud Messaging) and * APNS. The results for ListEndpointsByPlatformApplication are * paginated and return a limited list of endpoints, up to 100. If * additional records are available after the first page results, then a * NextToken string will be returned. To receive the next page, you call * ListEndpointsByPlatformApplication again using the NextToken * string received from the previous call. When there are no more records to * return, NextToken will be null. For more information, see Using * Amazon SNS Mobile Push Notifications. *

*

* This action is throttled at 30 transactions per second (TPS). *

* * @param listEndpointsByPlatformApplicationRequest

* Input for ListEndpointsByPlatformApplication action. *

* @return A Java Future object containing the response from the * ListEndpointsByPlatformApplication service method, as returned by * Amazon Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listEndpointsByPlatformApplicationAsync( final ListEndpointsByPlatformApplicationRequest listEndpointsByPlatformApplicationRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListEndpointsByPlatformApplicationResult call() throws Exception { return listEndpointsByPlatformApplication(listEndpointsByPlatformApplicationRequest); } }); } /** *

* Lists the endpoints and endpoint attributes for devices in a supported * push notification service, such as GCM (Firebase Cloud Messaging) and * APNS. The results for ListEndpointsByPlatformApplication are * paginated and return a limited list of endpoints, up to 100. If * additional records are available after the first page results, then a * NextToken string will be returned. To receive the next page, you call * ListEndpointsByPlatformApplication again using the NextToken * string received from the previous call. When there are no more records to * return, NextToken will be null. For more information, see Using * Amazon SNS Mobile Push Notifications. *

*

* This action is throttled at 30 transactions per second (TPS). *

* * @param listEndpointsByPlatformApplicationRequest

* Input for ListEndpointsByPlatformApplication action. *

* @return A Java Future object containing the response from the * ListEndpointsByPlatformApplication service method, as returned by * Amazon Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listEndpointsByPlatformApplicationAsync( final ListEndpointsByPlatformApplicationRequest listEndpointsByPlatformApplicationRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListEndpointsByPlatformApplicationResult call() throws Exception { ListEndpointsByPlatformApplicationResult result = null; try { result = listEndpointsByPlatformApplication(listEndpointsByPlatformApplicationRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(listEndpointsByPlatformApplicationRequest, result); return result; } }); } /** *

* Lists the calling Amazon Web Services account's dedicated origination * numbers and their metadata. For more information about origination * numbers, see Origination numbers in the Amazon SNS Developer Guide. *

* * @param listOriginationNumbersRequest * @return A Java Future object containing the response from the * ListOriginationNumbers service method, as returned by Amazon * Simple Notification Service. * @throws InternalErrorException * @throws AuthorizationErrorException * @throws ThrottledException * @throws InvalidParameterException * @throws ValidationException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listOriginationNumbersAsync( final ListOriginationNumbersRequest listOriginationNumbersRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListOriginationNumbersResult call() throws Exception { return listOriginationNumbers(listOriginationNumbersRequest); } }); } /** *

* Lists the calling Amazon Web Services account's dedicated origination * numbers and their metadata. For more information about origination * numbers, see Origination numbers in the Amazon SNS Developer Guide. *

* * @param listOriginationNumbersRequest * @return A Java Future object containing the response from the * ListOriginationNumbers service method, as returned by Amazon * Simple Notification Service. * @throws InternalErrorException * @throws AuthorizationErrorException * @throws ThrottledException * @throws InvalidParameterException * @throws ValidationException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listOriginationNumbersAsync( final ListOriginationNumbersRequest listOriginationNumbersRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListOriginationNumbersResult call() throws Exception { ListOriginationNumbersResult result = null; try { result = listOriginationNumbers(listOriginationNumbersRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(listOriginationNumbersRequest, result); return result; } }); } /** *

* Returns a list of phone numbers that are opted out, meaning you cannot * send SMS messages to them. *

*

* The results for ListPhoneNumbersOptedOut are paginated, and * each page returns up to 100 phone numbers. If additional phone numbers * are available after the first page of results, then a * NextToken string will be returned. To receive the next page, * you call ListPhoneNumbersOptedOut again using the * NextToken string received from the previous call. When there * are no more records to return, NextToken will be null. *

* * @param listPhoneNumbersOptedOutRequest

* The input for the ListPhoneNumbersOptedOut * action. *

* @return A Java Future object containing the response from the * ListPhoneNumbersOptedOut service method, as returned by Amazon * Simple Notification Service. * @throws ThrottledException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws InvalidParameterException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listPhoneNumbersOptedOutAsync( final ListPhoneNumbersOptedOutRequest listPhoneNumbersOptedOutRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListPhoneNumbersOptedOutResult call() throws Exception { return listPhoneNumbersOptedOut(listPhoneNumbersOptedOutRequest); } }); } /** *

* Returns a list of phone numbers that are opted out, meaning you cannot * send SMS messages to them. *

*

* The results for ListPhoneNumbersOptedOut are paginated, and * each page returns up to 100 phone numbers. If additional phone numbers * are available after the first page of results, then a * NextToken string will be returned. To receive the next page, * you call ListPhoneNumbersOptedOut again using the * NextToken string received from the previous call. When there * are no more records to return, NextToken will be null. *

* * @param listPhoneNumbersOptedOutRequest

* The input for the ListPhoneNumbersOptedOut * action. *

* @return A Java Future object containing the response from the * ListPhoneNumbersOptedOut service method, as returned by Amazon * Simple Notification Service. * @throws ThrottledException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws InvalidParameterException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listPhoneNumbersOptedOutAsync( final ListPhoneNumbersOptedOutRequest listPhoneNumbersOptedOutRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListPhoneNumbersOptedOutResult call() throws Exception { ListPhoneNumbersOptedOutResult result = null; try { result = listPhoneNumbersOptedOut(listPhoneNumbersOptedOutRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(listPhoneNumbersOptedOutRequest, result); return result; } }); } /** *

* Lists the platform application objects for the supported push * notification services, such as APNS and GCM (Firebase Cloud Messaging). * The results for ListPlatformApplications are paginated and * return a limited list of applications, up to 100. If additional records * are available after the first page results, then a NextToken string will * be returned. To receive the next page, you call * ListPlatformApplications using the NextToken string received * from the previous call. When there are no more records to return, * NextToken will be null. For more information, see Using * Amazon SNS Mobile Push Notifications. *

*

* This action is throttled at 15 transactions per second (TPS). *

* * @param listPlatformApplicationsRequest

* Input for ListPlatformApplications action. *

* @return A Java Future object containing the response from the * ListPlatformApplications service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listPlatformApplicationsAsync( final ListPlatformApplicationsRequest listPlatformApplicationsRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListPlatformApplicationsResult call() throws Exception { return listPlatformApplications(listPlatformApplicationsRequest); } }); } /** *

* Lists the platform application objects for the supported push * notification services, such as APNS and GCM (Firebase Cloud Messaging). * The results for ListPlatformApplications are paginated and * return a limited list of applications, up to 100. If additional records * are available after the first page results, then a NextToken string will * be returned. To receive the next page, you call * ListPlatformApplications using the NextToken string received * from the previous call. When there are no more records to return, * NextToken will be null. For more information, see Using * Amazon SNS Mobile Push Notifications. *

*

* This action is throttled at 15 transactions per second (TPS). *

* * @param listPlatformApplicationsRequest

* Input for ListPlatformApplications action. *

* @return A Java Future object containing the response from the * ListPlatformApplications service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listPlatformApplicationsAsync( final ListPlatformApplicationsRequest listPlatformApplicationsRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListPlatformApplicationsResult call() throws Exception { ListPlatformApplicationsResult result = null; try { result = listPlatformApplications(listPlatformApplicationsRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(listPlatformApplicationsRequest, result); return result; } }); } /** *

* Lists the calling Amazon Web Services account's current verified and * pending destination phone numbers in the SMS sandbox. *

*

* When you start using Amazon SNS to send SMS messages, your Amazon Web * Services account is in the SMS sandbox. The SMS sandbox provides a * safe environment for you to try Amazon SNS features without risking your * reputation as an SMS sender. While your Amazon Web Services account is in * the SMS sandbox, you can use all of the features of Amazon SNS. However, * you can send SMS messages only to verified destination phone numbers. For * more information, including how to move out of the sandbox to send * messages without restrictions, see SMS * sandbox in the Amazon SNS Developer Guide. *

* * @param listSMSSandboxPhoneNumbersRequest * @return A Java Future object containing the response from the * ListSMSSandboxPhoneNumbers service method, as returned by Amazon * Simple Notification Service. * @throws AuthorizationErrorException * @throws InternalErrorException * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws ThrottledException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listSMSSandboxPhoneNumbersAsync( final ListSMSSandboxPhoneNumbersRequest listSMSSandboxPhoneNumbersRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListSMSSandboxPhoneNumbersResult call() throws Exception { return listSMSSandboxPhoneNumbers(listSMSSandboxPhoneNumbersRequest); } }); } /** *

* Lists the calling Amazon Web Services account's current verified and * pending destination phone numbers in the SMS sandbox. *

*

* When you start using Amazon SNS to send SMS messages, your Amazon Web * Services account is in the SMS sandbox. The SMS sandbox provides a * safe environment for you to try Amazon SNS features without risking your * reputation as an SMS sender. While your Amazon Web Services account is in * the SMS sandbox, you can use all of the features of Amazon SNS. However, * you can send SMS messages only to verified destination phone numbers. For * more information, including how to move out of the sandbox to send * messages without restrictions, see SMS * sandbox in the Amazon SNS Developer Guide. *

* * @param listSMSSandboxPhoneNumbersRequest * @return A Java Future object containing the response from the * ListSMSSandboxPhoneNumbers service method, as returned by Amazon * Simple Notification Service. * @throws AuthorizationErrorException * @throws InternalErrorException * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws ThrottledException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listSMSSandboxPhoneNumbersAsync( final ListSMSSandboxPhoneNumbersRequest listSMSSandboxPhoneNumbersRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListSMSSandboxPhoneNumbersResult call() throws Exception { ListSMSSandboxPhoneNumbersResult result = null; try { result = listSMSSandboxPhoneNumbers(listSMSSandboxPhoneNumbersRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(listSMSSandboxPhoneNumbersRequest, result); return result; } }); } /** *

* Returns a list of the requester's subscriptions. Each call returns a * limited list of subscriptions, up to 100. If there are more * subscriptions, a NextToken is also returned. Use the * NextToken parameter in a new ListSubscriptions * call to get further results. *

*

* This action is throttled at 30 transactions per second (TPS). *

* * @param listSubscriptionsRequest

* Input for ListSubscriptions action. *

* @return A Java Future object containing the response from the * ListSubscriptions service method, as returned by Amazon Simple * Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listSubscriptionsAsync( final ListSubscriptionsRequest listSubscriptionsRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListSubscriptionsResult call() throws Exception { return listSubscriptions(listSubscriptionsRequest); } }); } /** *

* Returns a list of the requester's subscriptions. Each call returns a * limited list of subscriptions, up to 100. If there are more * subscriptions, a NextToken is also returned. Use the * NextToken parameter in a new ListSubscriptions * call to get further results. *

*

* This action is throttled at 30 transactions per second (TPS). *

* * @param listSubscriptionsRequest

* Input for ListSubscriptions action. *

* @return A Java Future object containing the response from the * ListSubscriptions service method, as returned by Amazon Simple * Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listSubscriptionsAsync( final ListSubscriptionsRequest listSubscriptionsRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListSubscriptionsResult call() throws Exception { ListSubscriptionsResult result = null; try { result = listSubscriptions(listSubscriptionsRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(listSubscriptionsRequest, result); return result; } }); } /** *

* Returns a list of the subscriptions to a specific topic. Each call * returns a limited list of subscriptions, up to 100. If there are more * subscriptions, a NextToken is also returned. Use the * NextToken parameter in a new * ListSubscriptionsByTopic call to get further results. *

*

* This action is throttled at 30 transactions per second (TPS). *

* * @param listSubscriptionsByTopicRequest

* Input for ListSubscriptionsByTopic action. *

* @return A Java Future object containing the response from the * ListSubscriptionsByTopic service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws NotFoundException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listSubscriptionsByTopicAsync( final ListSubscriptionsByTopicRequest listSubscriptionsByTopicRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListSubscriptionsByTopicResult call() throws Exception { return listSubscriptionsByTopic(listSubscriptionsByTopicRequest); } }); } /** *

* Returns a list of the subscriptions to a specific topic. Each call * returns a limited list of subscriptions, up to 100. If there are more * subscriptions, a NextToken is also returned. Use the * NextToken parameter in a new * ListSubscriptionsByTopic call to get further results. *

*

* This action is throttled at 30 transactions per second (TPS). *

* * @param listSubscriptionsByTopicRequest

* Input for ListSubscriptionsByTopic action. *

* @return A Java Future object containing the response from the * ListSubscriptionsByTopic service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws NotFoundException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listSubscriptionsByTopicAsync( final ListSubscriptionsByTopicRequest listSubscriptionsByTopicRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListSubscriptionsByTopicResult call() throws Exception { ListSubscriptionsByTopicResult result = null; try { result = listSubscriptionsByTopic(listSubscriptionsByTopicRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(listSubscriptionsByTopicRequest, result); return result; } }); } /** *

* List all tags added to the specified Amazon SNS topic. For an overview, * see Amazon SNS * Tags in the Amazon Simple Notification Service Developer * Guide. *

* * @param listTagsForResourceRequest * @return A Java Future object containing the response from the * ListTagsForResource service method, as returned by Amazon Simple * Notification Service. * @throws ResourceNotFoundException * @throws TagPolicyException * @throws InvalidParameterException * @throws AuthorizationErrorException * @throws ConcurrentAccessException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listTagsForResourceAsync( final ListTagsForResourceRequest listTagsForResourceRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListTagsForResourceResult call() throws Exception { return listTagsForResource(listTagsForResourceRequest); } }); } /** *

* List all tags added to the specified Amazon SNS topic. For an overview, * see Amazon SNS * Tags in the Amazon Simple Notification Service Developer * Guide. *

* * @param listTagsForResourceRequest * @return A Java Future object containing the response from the * ListTagsForResource service method, as returned by Amazon Simple * Notification Service. * @throws ResourceNotFoundException * @throws TagPolicyException * @throws InvalidParameterException * @throws AuthorizationErrorException * @throws ConcurrentAccessException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listTagsForResourceAsync( final ListTagsForResourceRequest listTagsForResourceRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListTagsForResourceResult call() throws Exception { ListTagsForResourceResult result = null; try { result = listTagsForResource(listTagsForResourceRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(listTagsForResourceRequest, result); return result; } }); } /** *

* Returns a list of the requester's topics. Each call returns a limited * list of topics, up to 100. If there are more topics, a * NextToken is also returned. Use the NextToken * parameter in a new ListTopics call to get further results. *

*

* This action is throttled at 30 transactions per second (TPS). *

* * @param listTopicsRequest * @return A Java Future object containing the response from the ListTopics * service method, as returned by Amazon Simple Notification * Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listTopicsAsync(final ListTopicsRequest listTopicsRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListTopicsResult call() throws Exception { return listTopics(listTopicsRequest); } }); } /** *

* Returns a list of the requester's topics. Each call returns a limited * list of topics, up to 100. If there are more topics, a * NextToken is also returned. Use the NextToken * parameter in a new ListTopics call to get further results. *

*

* This action is throttled at 30 transactions per second (TPS). *

* * @param listTopicsRequest * @return A Java Future object containing the response from the ListTopics * service method, as returned by Amazon Simple Notification * Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future listTopicsAsync(final ListTopicsRequest listTopicsRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public ListTopicsResult call() throws Exception { ListTopicsResult result = null; try { result = listTopics(listTopicsRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(listTopicsRequest, result); return result; } }); } /** *

* Use this request to opt in a phone number that is opted out, which * enables you to resume sending SMS messages to the number. *

*

* You can opt in a phone number only once every 30 days. *

* * @param optInPhoneNumberRequest

* Input for the OptInPhoneNumber action. *

* @return A Java Future object containing the response from the * OptInPhoneNumber service method, as returned by Amazon Simple * Notification Service. * @throws ThrottledException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws InvalidParameterException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future optInPhoneNumberAsync( final OptInPhoneNumberRequest optInPhoneNumberRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public OptInPhoneNumberResult call() throws Exception { return optInPhoneNumber(optInPhoneNumberRequest); } }); } /** *

* Use this request to opt in a phone number that is opted out, which * enables you to resume sending SMS messages to the number. *

*

* You can opt in a phone number only once every 30 days. *

* * @param optInPhoneNumberRequest

* Input for the OptInPhoneNumber action. *

* @return A Java Future object containing the response from the * OptInPhoneNumber service method, as returned by Amazon Simple * Notification Service. * @throws ThrottledException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws InvalidParameterException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future optInPhoneNumberAsync( final OptInPhoneNumberRequest optInPhoneNumberRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public OptInPhoneNumberResult call() throws Exception { OptInPhoneNumberResult result = null; try { result = optInPhoneNumber(optInPhoneNumberRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(optInPhoneNumberRequest, result); return result; } }); } /** *

* Sends a message to an Amazon SNS topic, a text message (SMS message) * directly to a phone number, or a message to a mobile platform endpoint * (when you specify the TargetArn). *

*

* If you send a message to a topic, Amazon SNS delivers the message to each * endpoint that is subscribed to the topic. The format of the message * depends on the notification protocol for each subscribed endpoint. *

*

* When a messageId is returned, the message is saved and * Amazon SNS immediately delivers it to subscribers. *

*

* To use the Publish action for publishing a message to a * mobile endpoint, such as an app on a Kindle device or mobile phone, you * must specify the EndpointArn for the TargetArn parameter. The EndpointArn * is returned when making a call with the * CreatePlatformEndpoint action. *

*

* For more information about formatting messages, see Send Custom Platform-Specific Payloads in Messages to Mobile * Devices. *

* *

* You can publish messages only to topics and endpoints in the same Amazon * Web Services Region. *

*
* * @param publishRequest

* Input for Publish action. *

* @return A Java Future object containing the response from the Publish * service method, as returned by Amazon Simple Notification * Service. * @throws InvalidParameterException * @throws InvalidParameterValueException * @throws InternalErrorException * @throws NotFoundException * @throws EndpointDisabledException * @throws PlatformApplicationDisabledException * @throws AuthorizationErrorException * @throws KMSDisabledException * @throws KMSInvalidStateException * @throws KMSNotFoundException * @throws KMSOptInRequiredException * @throws KMSThrottlingException * @throws KMSAccessDeniedException * @throws InvalidSecurityException * @throws ValidationException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future publishAsync(final PublishRequest publishRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public PublishResult call() throws Exception { return publish(publishRequest); } }); } /** *

* Sends a message to an Amazon SNS topic, a text message (SMS message) * directly to a phone number, or a message to a mobile platform endpoint * (when you specify the TargetArn). *

*

* If you send a message to a topic, Amazon SNS delivers the message to each * endpoint that is subscribed to the topic. The format of the message * depends on the notification protocol for each subscribed endpoint. *

*

* When a messageId is returned, the message is saved and * Amazon SNS immediately delivers it to subscribers. *

*

* To use the Publish action for publishing a message to a * mobile endpoint, such as an app on a Kindle device or mobile phone, you * must specify the EndpointArn for the TargetArn parameter. The EndpointArn * is returned when making a call with the * CreatePlatformEndpoint action. *

*

* For more information about formatting messages, see Send Custom Platform-Specific Payloads in Messages to Mobile * Devices. *

* *

* You can publish messages only to topics and endpoints in the same Amazon * Web Services Region. *

*
* * @param publishRequest

* Input for Publish action. *

* @return A Java Future object containing the response from the Publish * service method, as returned by Amazon Simple Notification * Service. * @throws InvalidParameterException * @throws InvalidParameterValueException * @throws InternalErrorException * @throws NotFoundException * @throws EndpointDisabledException * @throws PlatformApplicationDisabledException * @throws AuthorizationErrorException * @throws KMSDisabledException * @throws KMSInvalidStateException * @throws KMSNotFoundException * @throws KMSOptInRequiredException * @throws KMSThrottlingException * @throws KMSAccessDeniedException * @throws InvalidSecurityException * @throws ValidationException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future publishAsync(final PublishRequest publishRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public PublishResult call() throws Exception { PublishResult result = null; try { result = publish(publishRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(publishRequest, result); return result; } }); } /** *

* Publishes up to ten messages to the specified topic. This is a batch * version of Publish. For FIFO topics, multiple messages * within a single batch are published in the order they are sent, and * messages are deduplicated within the batch and across batches for 5 * minutes. *

*

* The result of publishing each message is reported individually in the * response. Because the batch request can result in a combination of * successful and unsuccessful actions, you should check for batch errors * even when the call returns an HTTP status code of 200. *

*

* The maximum allowed individual message size and the maximum total payload * size (the sum of the individual lengths of all of the batched messages) * are both 256 KB (262,144 bytes). *

*

* Some actions take lists of parameters. These lists are specified using * the param.n notation. Values of n are integers * starting from 1. For example, a parameter list with two elements looks * like this: *

*

* &AttributeName.1=first *

*

* &AttributeName.2=second *

*

* If you send a batch message to a topic, Amazon SNS publishes the batch * message to each endpoint that is subscribed to the topic. The format of * the batch message depends on the notification protocol for each * subscribed endpoint. *

*

* When a messageId is returned, the batch message is saved and * Amazon SNS immediately delivers the message to subscribers. *

* * @param publishBatchRequest * @return A Java Future object containing the response from the * PublishBatch service method, as returned by Amazon Simple * Notification Service. * @throws InvalidParameterException * @throws InvalidParameterValueException * @throws InternalErrorException * @throws NotFoundException * @throws EndpointDisabledException * @throws PlatformApplicationDisabledException * @throws AuthorizationErrorException * @throws BatchEntryIdsNotDistinctException * @throws BatchRequestTooLongException * @throws EmptyBatchRequestException * @throws InvalidBatchEntryIdException * @throws TooManyEntriesInBatchRequestException * @throws KMSDisabledException * @throws KMSInvalidStateException * @throws KMSNotFoundException * @throws KMSOptInRequiredException * @throws KMSThrottlingException * @throws KMSAccessDeniedException * @throws InvalidSecurityException * @throws ValidationException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future publishBatchAsync( final PublishBatchRequest publishBatchRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public PublishBatchResult call() throws Exception { return publishBatch(publishBatchRequest); } }); } /** *

* Publishes up to ten messages to the specified topic. This is a batch * version of Publish. For FIFO topics, multiple messages * within a single batch are published in the order they are sent, and * messages are deduplicated within the batch and across batches for 5 * minutes. *

*

* The result of publishing each message is reported individually in the * response. Because the batch request can result in a combination of * successful and unsuccessful actions, you should check for batch errors * even when the call returns an HTTP status code of 200. *

*

* The maximum allowed individual message size and the maximum total payload * size (the sum of the individual lengths of all of the batched messages) * are both 256 KB (262,144 bytes). *

*

* Some actions take lists of parameters. These lists are specified using * the param.n notation. Values of n are integers * starting from 1. For example, a parameter list with two elements looks * like this: *

*

* &AttributeName.1=first *

*

* &AttributeName.2=second *

*

* If you send a batch message to a topic, Amazon SNS publishes the batch * message to each endpoint that is subscribed to the topic. The format of * the batch message depends on the notification protocol for each * subscribed endpoint. *

*

* When a messageId is returned, the batch message is saved and * Amazon SNS immediately delivers the message to subscribers. *

* * @param publishBatchRequest * @return A Java Future object containing the response from the * PublishBatch service method, as returned by Amazon Simple * Notification Service. * @throws InvalidParameterException * @throws InvalidParameterValueException * @throws InternalErrorException * @throws NotFoundException * @throws EndpointDisabledException * @throws PlatformApplicationDisabledException * @throws AuthorizationErrorException * @throws BatchEntryIdsNotDistinctException * @throws BatchRequestTooLongException * @throws EmptyBatchRequestException * @throws InvalidBatchEntryIdException * @throws TooManyEntriesInBatchRequestException * @throws KMSDisabledException * @throws KMSInvalidStateException * @throws KMSNotFoundException * @throws KMSOptInRequiredException * @throws KMSThrottlingException * @throws KMSAccessDeniedException * @throws InvalidSecurityException * @throws ValidationException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future publishBatchAsync( final PublishBatchRequest publishBatchRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public PublishBatchResult call() throws Exception { PublishBatchResult result = null; try { result = publishBatch(publishBatchRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(publishBatchRequest, result); return result; } }); } /** *

* Adds or updates an inline policy document that is stored in the specified * Amazon SNS topic. *

* * @param putDataProtectionPolicyRequest * @return A Java Future object containing the response from the * PutDataProtectionPolicy service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws NotFoundException * @throws AuthorizationErrorException * @throws InvalidSecurityException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future putDataProtectionPolicyAsync( final PutDataProtectionPolicyRequest putDataProtectionPolicyRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { putDataProtectionPolicy(putDataProtectionPolicyRequest); return null; } }); } /** *

* Adds or updates an inline policy document that is stored in the specified * Amazon SNS topic. *

* * @param putDataProtectionPolicyRequest * @return A Java Future object containing the response from the * PutDataProtectionPolicy service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws NotFoundException * @throws AuthorizationErrorException * @throws InvalidSecurityException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future putDataProtectionPolicyAsync( final PutDataProtectionPolicyRequest putDataProtectionPolicyRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { Void result = null; try { putDataProtectionPolicy(putDataProtectionPolicyRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(putDataProtectionPolicyRequest, result); return result; } }); } /** *

* Removes a statement from a topic's access control policy. *

* *

* To remove the ability to change topic permissions, you must deny * permissions to the AddPermission, * RemovePermission, and SetTopicAttributes * actions in your IAM policy. *

*
* * @param removePermissionRequest

* Input for RemovePermission action. *

* @return A Java Future object containing the response from the * RemovePermission service method, as returned by Amazon Simple * Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future removePermissionAsync(final RemovePermissionRequest removePermissionRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { removePermission(removePermissionRequest); return null; } }); } /** *

* Removes a statement from a topic's access control policy. *

* *

* To remove the ability to change topic permissions, you must deny * permissions to the AddPermission, * RemovePermission, and SetTopicAttributes * actions in your IAM policy. *

*
* * @param removePermissionRequest

* Input for RemovePermission action. *

* @return A Java Future object containing the response from the * RemovePermission service method, as returned by Amazon Simple * Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future removePermissionAsync( final RemovePermissionRequest removePermissionRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { Void result = null; try { removePermission(removePermissionRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(removePermissionRequest, result); return result; } }); } /** *

* Sets the attributes for an endpoint for a device on one of the supported * push notification services, such as GCM (Firebase Cloud Messaging) and * APNS. For more information, see Using * Amazon SNS Mobile Push Notifications. *

* * @param setEndpointAttributesRequest

* Input for SetEndpointAttributes action. *

* @return A Java Future object containing the response from the * SetEndpointAttributes service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future setEndpointAttributesAsync( final SetEndpointAttributesRequest setEndpointAttributesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { setEndpointAttributes(setEndpointAttributesRequest); return null; } }); } /** *

* Sets the attributes for an endpoint for a device on one of the supported * push notification services, such as GCM (Firebase Cloud Messaging) and * APNS. For more information, see Using * Amazon SNS Mobile Push Notifications. *

* * @param setEndpointAttributesRequest

* Input for SetEndpointAttributes action. *

* @return A Java Future object containing the response from the * SetEndpointAttributes service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future setEndpointAttributesAsync( final SetEndpointAttributesRequest setEndpointAttributesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { Void result = null; try { setEndpointAttributes(setEndpointAttributesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(setEndpointAttributesRequest, result); return result; } }); } /** *

* Sets the attributes of the platform application object for the supported * push notification services, such as APNS and GCM (Firebase Cloud * Messaging). For more information, see Using * Amazon SNS Mobile Push Notifications. For information on configuring * attributes for message delivery status, see Using Amazon SNS Application Attributes for Message Delivery Status. *

* * @param setPlatformApplicationAttributesRequest

* Input for SetPlatformApplicationAttributes action. *

* @return A Java Future object containing the response from the * SetPlatformApplicationAttributes service method, as returned by * Amazon Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future setPlatformApplicationAttributesAsync( final SetPlatformApplicationAttributesRequest setPlatformApplicationAttributesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { setPlatformApplicationAttributes(setPlatformApplicationAttributesRequest); return null; } }); } /** *

* Sets the attributes of the platform application object for the supported * push notification services, such as APNS and GCM (Firebase Cloud * Messaging). For more information, see Using * Amazon SNS Mobile Push Notifications. For information on configuring * attributes for message delivery status, see Using Amazon SNS Application Attributes for Message Delivery Status. *

* * @param setPlatformApplicationAttributesRequest

* Input for SetPlatformApplicationAttributes action. *

* @return A Java Future object containing the response from the * SetPlatformApplicationAttributes service method, as returned by * Amazon Simple Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future setPlatformApplicationAttributesAsync( final SetPlatformApplicationAttributesRequest setPlatformApplicationAttributesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { Void result = null; try { setPlatformApplicationAttributes(setPlatformApplicationAttributesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(setPlatformApplicationAttributesRequest, result); return result; } }); } /** *

* Use this request to set the default settings for sending SMS messages and * receiving daily SMS usage reports. *

*

* You can override some of these settings for a single message when you use * the Publish action with the * MessageAttributes.entry.N parameter. For more information, * see Publishing to a mobile phone in the Amazon SNS Developer * Guide. *

* *

* To use this operation, you must grant the Amazon SNS service principal ( * sns.amazonaws.com) permission to perform the * s3:ListBucket action. *

*
* * @param setSMSAttributesRequest

* The input for the SetSMSAttributes action. *

* @return A Java Future object containing the response from the * SetSMSAttributes service method, as returned by Amazon Simple * Notification Service. * @throws InvalidParameterException * @throws ThrottledException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future setSMSAttributesAsync( final SetSMSAttributesRequest setSMSAttributesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public SetSMSAttributesResult call() throws Exception { return setSMSAttributes(setSMSAttributesRequest); } }); } /** *

* Use this request to set the default settings for sending SMS messages and * receiving daily SMS usage reports. *

*

* You can override some of these settings for a single message when you use * the Publish action with the * MessageAttributes.entry.N parameter. For more information, * see Publishing to a mobile phone in the Amazon SNS Developer * Guide. *

* *

* To use this operation, you must grant the Amazon SNS service principal ( * sns.amazonaws.com) permission to perform the * s3:ListBucket action. *

*
* * @param setSMSAttributesRequest

* The input for the SetSMSAttributes action. *

* @return A Java Future object containing the response from the * SetSMSAttributes service method, as returned by Amazon Simple * Notification Service. * @throws InvalidParameterException * @throws ThrottledException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future setSMSAttributesAsync( final SetSMSAttributesRequest setSMSAttributesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public SetSMSAttributesResult call() throws Exception { SetSMSAttributesResult result = null; try { result = setSMSAttributes(setSMSAttributesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(setSMSAttributesRequest, result); return result; } }); } /** *

* Allows a subscription owner to set an attribute of the subscription to a * new value. *

* * @param setSubscriptionAttributesRequest

* Input for SetSubscriptionAttributes action. *

* @return A Java Future object containing the response from the * SetSubscriptionAttributes service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws FilterPolicyLimitExceededException * @throws InternalErrorException * @throws NotFoundException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future setSubscriptionAttributesAsync( final SetSubscriptionAttributesRequest setSubscriptionAttributesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { setSubscriptionAttributes(setSubscriptionAttributesRequest); return null; } }); } /** *

* Allows a subscription owner to set an attribute of the subscription to a * new value. *

* * @param setSubscriptionAttributesRequest

* Input for SetSubscriptionAttributes action. *

* @return A Java Future object containing the response from the * SetSubscriptionAttributes service method, as returned by Amazon * Simple Notification Service. * @throws InvalidParameterException * @throws FilterPolicyLimitExceededException * @throws InternalErrorException * @throws NotFoundException * @throws AuthorizationErrorException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future setSubscriptionAttributesAsync( final SetSubscriptionAttributesRequest setSubscriptionAttributesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { Void result = null; try { setSubscriptionAttributes(setSubscriptionAttributesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(setSubscriptionAttributesRequest, result); return result; } }); } /** *

* Allows a topic owner to set an attribute of the topic to a new value. *

* *

* To remove the ability to change topic permissions, you must deny * permissions to the AddPermission, * RemovePermission, and SetTopicAttributes * actions in your IAM policy. *

*
* * @param setTopicAttributesRequest

* Input for SetTopicAttributes action. *

* @return A Java Future object containing the response from the * SetTopicAttributes service method, as returned by Amazon Simple * Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws NotFoundException * @throws AuthorizationErrorException * @throws InvalidSecurityException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future setTopicAttributesAsync( final SetTopicAttributesRequest setTopicAttributesRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { setTopicAttributes(setTopicAttributesRequest); return null; } }); } /** *

* Allows a topic owner to set an attribute of the topic to a new value. *

* *

* To remove the ability to change topic permissions, you must deny * permissions to the AddPermission, * RemovePermission, and SetTopicAttributes * actions in your IAM policy. *

*
* * @param setTopicAttributesRequest

* Input for SetTopicAttributes action. *

* @return A Java Future object containing the response from the * SetTopicAttributes service method, as returned by Amazon Simple * Notification Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws NotFoundException * @throws AuthorizationErrorException * @throws InvalidSecurityException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future setTopicAttributesAsync( final SetTopicAttributesRequest setTopicAttributesRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { Void result = null; try { setTopicAttributes(setTopicAttributesRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(setTopicAttributesRequest, result); return result; } }); } /** *

* Subscribes an endpoint to an Amazon SNS topic. If the endpoint type is * HTTP/S or email, or if the endpoint and the topic are not in the same * Amazon Web Services account, the endpoint owner must run the * ConfirmSubscription action to confirm the subscription. *

*

* You call the ConfirmSubscription action with the token from * the subscription response. Confirmation tokens are valid for three days. *

*

* This action is throttled at 100 transactions per second (TPS). *

* * @param subscribeRequest

* Input for Subscribe action. *

* @return A Java Future object containing the response from the Subscribe * service method, as returned by Amazon Simple Notification * Service. * @throws SubscriptionLimitExceededException * @throws FilterPolicyLimitExceededException * @throws InvalidParameterException * @throws InternalErrorException * @throws NotFoundException * @throws AuthorizationErrorException * @throws InvalidSecurityException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future subscribeAsync(final SubscribeRequest subscribeRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public SubscribeResult call() throws Exception { return subscribe(subscribeRequest); } }); } /** *

* Subscribes an endpoint to an Amazon SNS topic. If the endpoint type is * HTTP/S or email, or if the endpoint and the topic are not in the same * Amazon Web Services account, the endpoint owner must run the * ConfirmSubscription action to confirm the subscription. *

*

* You call the ConfirmSubscription action with the token from * the subscription response. Confirmation tokens are valid for three days. *

*

* This action is throttled at 100 transactions per second (TPS). *

* * @param subscribeRequest

* Input for Subscribe action. *

* @return A Java Future object containing the response from the Subscribe * service method, as returned by Amazon Simple Notification * Service. * @throws SubscriptionLimitExceededException * @throws FilterPolicyLimitExceededException * @throws InvalidParameterException * @throws InternalErrorException * @throws NotFoundException * @throws AuthorizationErrorException * @throws InvalidSecurityException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future subscribeAsync(final SubscribeRequest subscribeRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public SubscribeResult call() throws Exception { SubscribeResult result = null; try { result = subscribe(subscribeRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(subscribeRequest, result); return result; } }); } /** *

* Add tags to the specified Amazon SNS topic. For an overview, see Amazon SNS * Tags in the Amazon SNS Developer Guide. *

*

* When you use topic tags, keep the following guidelines in mind: *

*
    *
  • *

    * Adding more than 50 tags to a topic isn't recommended. *

    *
  • *
  • *

    * Tags don't have any semantic meaning. Amazon SNS interprets tags as * character strings. *

    *
  • *
  • *

    * Tags are case-sensitive. *

    *
  • *
  • *

    * A new tag with a key identical to that of an existing tag overwrites the * existing tag. *

    *
  • *
  • *

    * Tagging actions are limited to 10 TPS per Amazon Web Services account, * per Amazon Web Services Region. If your application requires a higher * throughput, file a technical support request. *

    *
  • *
* * @param tagResourceRequest * @return A Java Future object containing the response from the TagResource * service method, as returned by Amazon Simple Notification * Service. * @throws ResourceNotFoundException * @throws TagLimitExceededException * @throws StaleTagException * @throws TagPolicyException * @throws InvalidParameterException * @throws AuthorizationErrorException * @throws ConcurrentAccessException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future tagResourceAsync(final TagResourceRequest tagResourceRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public TagResourceResult call() throws Exception { return tagResource(tagResourceRequest); } }); } /** *

* Add tags to the specified Amazon SNS topic. For an overview, see Amazon SNS * Tags in the Amazon SNS Developer Guide. *

*

* When you use topic tags, keep the following guidelines in mind: *

*
    *
  • *

    * Adding more than 50 tags to a topic isn't recommended. *

    *
  • *
  • *

    * Tags don't have any semantic meaning. Amazon SNS interprets tags as * character strings. *

    *
  • *
  • *

    * Tags are case-sensitive. *

    *
  • *
  • *

    * A new tag with a key identical to that of an existing tag overwrites the * existing tag. *

    *
  • *
  • *

    * Tagging actions are limited to 10 TPS per Amazon Web Services account, * per Amazon Web Services Region. If your application requires a higher * throughput, file a technical support request. *

    *
  • *
* * @param tagResourceRequest * @return A Java Future object containing the response from the TagResource * service method, as returned by Amazon Simple Notification * Service. * @throws ResourceNotFoundException * @throws TagLimitExceededException * @throws StaleTagException * @throws TagPolicyException * @throws InvalidParameterException * @throws AuthorizationErrorException * @throws ConcurrentAccessException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future tagResourceAsync(final TagResourceRequest tagResourceRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public TagResourceResult call() throws Exception { TagResourceResult result = null; try { result = tagResource(tagResourceRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(tagResourceRequest, result); return result; } }); } /** *

* Deletes a subscription. If the subscription requires authentication for * deletion, only the owner of the subscription or the topic's owner can * unsubscribe, and an Amazon Web Services signature is required. If the * Unsubscribe call does not require authentication and the * requester is not the subscription owner, a final cancellation message is * delivered to the endpoint, so that the endpoint owner can easily * resubscribe to the topic if the Unsubscribe request was * unintended. *

* *

* Amazon SQS queue subscriptions require authentication for deletion. Only * the owner of the subscription, or the owner of the topic can unsubscribe * using the required Amazon Web Services signature. *

*
*

* This action is throttled at 100 transactions per second (TPS). *

* * @param unsubscribeRequest

* Input for Unsubscribe action. *

* @return A Java Future object containing the response from the Unsubscribe * service method, as returned by Amazon Simple Notification * Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws InvalidSecurityException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future unsubscribeAsync(final UnsubscribeRequest unsubscribeRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { unsubscribe(unsubscribeRequest); return null; } }); } /** *

* Deletes a subscription. If the subscription requires authentication for * deletion, only the owner of the subscription or the topic's owner can * unsubscribe, and an Amazon Web Services signature is required. If the * Unsubscribe call does not require authentication and the * requester is not the subscription owner, a final cancellation message is * delivered to the endpoint, so that the endpoint owner can easily * resubscribe to the topic if the Unsubscribe request was * unintended. *

* *

* Amazon SQS queue subscriptions require authentication for deletion. Only * the owner of the subscription, or the owner of the topic can unsubscribe * using the required Amazon Web Services signature. *

*
*

* This action is throttled at 100 transactions per second (TPS). *

* * @param unsubscribeRequest

* Input for Unsubscribe action. *

* @return A Java Future object containing the response from the Unsubscribe * service method, as returned by Amazon Simple Notification * Service. * @throws InvalidParameterException * @throws InternalErrorException * @throws AuthorizationErrorException * @throws NotFoundException * @throws InvalidSecurityException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future unsubscribeAsync(final UnsubscribeRequest unsubscribeRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public Void call() throws Exception { Void result = null; try { unsubscribe(unsubscribeRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(unsubscribeRequest, result); return result; } }); } /** *

* Remove tags from the specified Amazon SNS topic. For an overview, see Amazon SNS * Tags in the Amazon SNS Developer Guide. *

* * @param untagResourceRequest * @return A Java Future object containing the response from the * UntagResource service method, as returned by Amazon Simple * Notification Service. * @throws ResourceNotFoundException * @throws TagLimitExceededException * @throws StaleTagException * @throws TagPolicyException * @throws InvalidParameterException * @throws AuthorizationErrorException * @throws ConcurrentAccessException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future untagResourceAsync( final UntagResourceRequest untagResourceRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public UntagResourceResult call() throws Exception { return untagResource(untagResourceRequest); } }); } /** *

* Remove tags from the specified Amazon SNS topic. For an overview, see Amazon SNS * Tags in the Amazon SNS Developer Guide. *

* * @param untagResourceRequest * @return A Java Future object containing the response from the * UntagResource service method, as returned by Amazon Simple * Notification Service. * @throws ResourceNotFoundException * @throws TagLimitExceededException * @throws StaleTagException * @throws TagPolicyException * @throws InvalidParameterException * @throws AuthorizationErrorException * @throws ConcurrentAccessException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future untagResourceAsync( final UntagResourceRequest untagResourceRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public UntagResourceResult call() throws Exception { UntagResourceResult result = null; try { result = untagResource(untagResourceRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(untagResourceRequest, result); return result; } }); } /** *

* Verifies a destination phone number with a one-time password (OTP) for * the calling Amazon Web Services account. *

*

* When you start using Amazon SNS to send SMS messages, your Amazon Web * Services account is in the SMS sandbox. The SMS sandbox provides a * safe environment for you to try Amazon SNS features without risking your * reputation as an SMS sender. While your Amazon Web Services account is in * the SMS sandbox, you can use all of the features of Amazon SNS. However, * you can send SMS messages only to verified destination phone numbers. For * more information, including how to move out of the sandbox to send * messages without restrictions, see SMS * sandbox in the Amazon SNS Developer Guide. *

* * @param verifySMSSandboxPhoneNumberRequest * @return A Java Future object containing the response from the * VerifySMSSandboxPhoneNumber service method, as returned by Amazon * Simple Notification Service. * @throws AuthorizationErrorException * @throws InternalErrorException * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws VerificationException * @throws ThrottledException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future verifySMSSandboxPhoneNumberAsync( final VerifySMSSandboxPhoneNumberRequest verifySMSSandboxPhoneNumberRequest) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public VerifySMSSandboxPhoneNumberResult call() throws Exception { return verifySMSSandboxPhoneNumber(verifySMSSandboxPhoneNumberRequest); } }); } /** *

* Verifies a destination phone number with a one-time password (OTP) for * the calling Amazon Web Services account. *

*

* When you start using Amazon SNS to send SMS messages, your Amazon Web * Services account is in the SMS sandbox. The SMS sandbox provides a * safe environment for you to try Amazon SNS features without risking your * reputation as an SMS sender. While your Amazon Web Services account is in * the SMS sandbox, you can use all of the features of Amazon SNS. However, * you can send SMS messages only to verified destination phone numbers. For * more information, including how to move out of the sandbox to send * messages without restrictions, see SMS * sandbox in the Amazon SNS Developer Guide. *

* * @param verifySMSSandboxPhoneNumberRequest * @return A Java Future object containing the response from the * VerifySMSSandboxPhoneNumber service method, as returned by Amazon * Simple Notification Service. * @throws AuthorizationErrorException * @throws InternalErrorException * @throws InvalidParameterException * @throws ResourceNotFoundException * @throws VerificationException * @throws ThrottledException * @throws AmazonClientException If any internal errors are encountered * inside the client while attempting to make the request or * handle the response. For example if a network connection is * not available. * @throws AmazonServiceException If an error response is returned by Amazon * Simple Notification Service indicating either a problem with * the data in the request, or a server side issue. */ public Future verifySMSSandboxPhoneNumberAsync( final VerifySMSSandboxPhoneNumberRequest verifySMSSandboxPhoneNumberRequest, final AsyncHandler asyncHandler) throws AmazonServiceException, AmazonClientException { return executorService.submit(new Callable() { public VerifySMSSandboxPhoneNumberResult call() throws Exception { VerifySMSSandboxPhoneNumberResult result = null; try { result = verifySMSSandboxPhoneNumber(verifySMSSandboxPhoneNumberRequest); } catch (Exception ex) { asyncHandler.onError(ex); throw ex; } asyncHandler.onSuccess(verifySMSSandboxPhoneNumberRequest, result); return result; } }); } }