public class

AmazonSNSConnector

extends Object
java.lang.Object
   ↳ org.mule.modules.sns.AmazonSNSConnector
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Amazon Simple Notification Service (Amazon SNS) is a web service that makes it easy to set up, operate, and send notifications from the cloud. It provides developers with a highly scalable, flexible, and cost-effective capability to publish messages from an application and immediately deliver them to subscribers or other applications. It is designed to make web-scale computing easier for developers.

Summary

Fields
private String accessKey
private AmazonSNS client
Public Constructors
AmazonSNSConnector()
Public Methods
void addPermission(AddPermissionRequest addPermissionRequest)
Adds a statement to a topic's access control policy, granting access for the specified AWS accounts to the specified actions.
ConfirmSubscriptionResult confirmSubscription(ConfirmSubscriptionRequest confirmSubscriptionRequest)
The ConfirmSubscription action verifies an endpoint owner's intent to receive messages by validating the token sent to the endpoint by an earlier Subscribe action.
void connect(String accessKey, String secretKey)
Login to Amazon SNS
String connectionId()
Connection identifier
CreateTopicResult createTopic(CreateTopicRequest createTopicRequest)
The CreateTopic action creates a topic to which notifications can be published.
void deleteTopic(DeleteTopicRequest deleteTopicRequest)
The DeleteTopic action deletes a topic and all its subscriptions.
void disconnect()
Disconnect
String getAccessKey()
GetSubscriptionAttributesResult getSubscriptionAttributes(GetSubscriptionAttributesRequest getSubscriptionAttributesRequest)
The GetSubscriptionAttribtues action returns all of the properties of a subscription.
GetTopicAttributesResult getTopicAttributes(GetTopicAttributesRequest getTopicAttributesRequest)
The GetTopicAttributes action returns all of the properties of a topic.
boolean isConnected()
Check if the connector's instance is connected
ListSubscriptionsResult listSubscriptions(ListSubscriptionsRequest listSubscriptionsRequest)
The ListSubscriptions action returns a list of the requester's subscriptions.
ListSubscriptionsByTopicResult listSubscriptionsByTopic(ListSubscriptionsByTopicRequest listSubscriptionsByTopicRequest)
The ListSubscriptionsByTopic action returns a list of the subscriptions to a specific topic.
ListTopicsResult listTopics(ListTopicsRequest listTopicsRequest)
The ListTopics action returns a list of the requester's topics.
PublishResult publish(PublishRequest publishRequest)
The Publish action sends a message to all of a topic's subscribed endpoints.
void removePermission(RemovePermissionRequest removePermissionRequest)
The RemovePermission action removes a statement from a topic's access control policy.
void setAccessKey(String accessKey)
void setSubscriptionAttributes(SetSubscriptionAttributesRequest setSubscriptionAttributesRequest)
The SetSubscriptionAttributes action allows a subscription owner to set an attribute of the topic to a new value.
void setTopicAttributes(SetTopicAttributesRequest setTopicAttributesRequest)
The SetTopicAttributes action allows a topic owner to set an attribute of the topic to a new value.
SubscribeResult subscribe(SubscribeRequest subscribeRequest)
The Subscribe action prepares to subscribe an endpoint by sending the endpoint a confirmation message.
void unsubscribe(UnsubscribeRequest unsubscribeRequest)
The Unsubscribe action deletes a subscription.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

private String accessKey

private AmazonSNS client

Public Constructors

public AmazonSNSConnector ()

Public Methods

public void addPermission (AddPermissionRequest addPermissionRequest)

Adds a statement to a topic's access control policy, granting access for the specified AWS accounts to the specified actions.

API reference

Parameters
addPermissionRequest Request object

public ConfirmSubscriptionResult confirmSubscription (ConfirmSubscriptionRequest confirmSubscriptionRequest)

The ConfirmSubscription action 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".

API reference

Parameters
confirmSubscriptionRequest Request object
Returns
  • operation results

public void connect (String accessKey, String secretKey)

Login to Amazon SNS

Parameters
accessKey The access key provided by Amazon
secretKey The secrete key provided by Amazon
Throws
ConnectionException

public String connectionId ()

Connection identifier

public CreateTopicResult createTopic (CreateTopicRequest createTopicRequest)

The CreateTopic action creates a topic to which notifications can be published. Users can create at most 100 topics

API reference

Parameters
createTopicRequest Request object
Returns
  • operation results

public void deleteTopic (DeleteTopicRequest deleteTopicRequest)

The DeleteTopic action 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.

API reference

Parameters
deleteTopicRequest Request object

public void disconnect ()

Disconnect

public String getAccessKey ()

public GetSubscriptionAttributesResult getSubscriptionAttributes (GetSubscriptionAttributesRequest getSubscriptionAttributesRequest)

The GetSubscriptionAttribtues action returns all of the properties of a subscription.

API reference

Parameters
getSubscriptionAttributesRequest Request object
Returns
  • operation results

public GetTopicAttributesResult getTopicAttributes (GetTopicAttributesRequest getTopicAttributesRequest)

The GetTopicAttributes action returns all of the properties of a topic. Topic properties returned might differ based on the authorization of the user.

API reference

Parameters
getTopicAttributesRequest Request object
Returns
  • operation results

public boolean isConnected ()

Check if the connector's instance is connected

public ListSubscriptionsResult listSubscriptions (ListSubscriptionsRequest listSubscriptionsRequest)

The ListSubscriptions action 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.

API reference

Parameters
listSubscriptionsRequest Request object
Returns
  • operation results

public ListSubscriptionsByTopicResult listSubscriptionsByTopic (ListSubscriptionsByTopicRequest listSubscriptionsByTopicRequest)

The ListSubscriptionsByTopic action 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.

API reference

Parameters
listSubscriptionsByTopicRequest Request object
Returns
  • operation results

public ListTopicsResult listTopics (ListTopicsRequest listTopicsRequest)

The ListTopics action 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.

API reference

Parameters
listTopicsRequest Request object
Returns
  • operation results

public PublishResult publish (PublishRequest publishRequest)

The Publish action sends a message to all of a topic's subscribed endpoints. When a messageId is returned, the message has been saved and Amazon SNS will attempt to deliver it to the topic's subscribers shortly. The format of the outgoing message to each subscribed endpoint depends on the notification protocol selected.

API reference

Parameters
publishRequest Request object
Returns
  • operation results

public void removePermission (RemovePermissionRequest removePermissionRequest)

The RemovePermission action removes a statement from a topic's access control policy.

API reference

Parameters
removePermissionRequest Request object

public void setAccessKey (String accessKey)

Parameters
accessKey

public void setSubscriptionAttributes (SetSubscriptionAttributesRequest setSubscriptionAttributesRequest)

The SetSubscriptionAttributes action allows a subscription owner to set an attribute of the topic to a new value.

API reference

Parameters
setSubscriptionAttributesRequest Request object

public void setTopicAttributes (SetTopicAttributesRequest setTopicAttributesRequest)

The SetTopicAttributes action allows a topic owner to set an attribute of the topic to a new value.

API reference

Parameters
setTopicAttributesRequest Request object

public SubscribeResult subscribe (SubscribeRequest subscribeRequest)

The Subscribe action prepares to subscribe an endpoint by sending the endpoint a confirmation message. To actually create a subscription, the endpoint owner must call the ConfirmSubscription action with the token from the confirmation message. Confirmation tokens are valid for three days.

API reference

Parameters
subscribeRequest Request object
Returns
  • operation results

public void unsubscribe (UnsubscribeRequest unsubscribeRequest)

The Unsubscribe action deletes a subscription. If the subscription requires authentication for deletion, only the owner of the subscription or the its topic's owner can unsubscribe, and an AWS 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.

API reference

Parameters
unsubscribeRequest Request object