Search in sources :

Example 1 with SubscribeResult

use of com.amazonaws.services.sns.model.SubscribeResult in project glacier-cli by carlossg.

the class Glacier method setupSNS.

private QueueConfig setupSNS(QueueConfig config, String snsTopicName) {
    CreateTopicRequest request = new CreateTopicRequest().withName(snsTopicName);
    CreateTopicResult result = snsClient.createTopic(request);
    config.snsTopicARN = result.getTopicArn();
    SubscribeRequest request2 = new SubscribeRequest().withTopicArn(config.snsTopicARN).withEndpoint(config.sqsQueueARN).withProtocol("sqs");
    SubscribeResult result2 = snsClient.subscribe(request2);
    config.snsSubscriptionARN = result2.getSubscriptionArn();
    return config;
}
Also used : CreateTopicResult(com.amazonaws.services.sns.model.CreateTopicResult) SubscribeRequest(com.amazonaws.services.sns.model.SubscribeRequest) CreateTopicRequest(com.amazonaws.services.sns.model.CreateTopicRequest) SubscribeResult(com.amazonaws.services.sns.model.SubscribeResult)

Aggregations

CreateTopicRequest (com.amazonaws.services.sns.model.CreateTopicRequest)1 CreateTopicResult (com.amazonaws.services.sns.model.CreateTopicResult)1 SubscribeRequest (com.amazonaws.services.sns.model.SubscribeRequest)1 SubscribeResult (com.amazonaws.services.sns.model.SubscribeResult)1