Package com.amazonaws.services.sns.model

Examples of com.amazonaws.services.sns.model.SubscribeResult


        queueAttributes = new HashMap<String, String>();
        queueAttributes.put(QueueAttributeName.Policy.toString(), policy.toJson());
        sqs.setQueueAttributes(new SetQueueAttributesRequest(sqsQueueUrl, queueAttributes));

        SubscribeResult subscribeResult =
                sns.subscribe(new SubscribeRequest()
                    .withEndpoint(sqsQueueArn)
                    .withProtocol("sqs")
                    .withTopicArn(snsTopicArn));
        return subscribeResult.getSubscriptionArn();
    }
View Full Code Here


    if (snsUrlSubscriptionArn == null) {

      SubscribeRequest request = new SubscribeRequest(topicArn,
          urlSubscription.getProtocol(),
          urlSubscription.getEndpoint());
      SubscribeResult result = client.subscribe(request);
      snsUrlSubscriptionArn = result.getSubscriptionArn();
      log.info("Subscribed URL to SNS with subscription ARN: "
          + snsUrlSubscriptionArn);
    } else {
      log.info("Already subscribed with ARN: " + snsUrlSubscriptionArn);
    }
View Full Code Here

    }
    if (snsSqsSubscriptionArn == null) {
      SubscribeRequest request = new SubscribeRequest(topicArn,
          sqsSubscription.getProtocol(),
          sqsSubscription.getEndpoint());
      SubscribeResult result = client.subscribe(request);
      snsSqsSubscriptionArn = result.getSubscriptionArn();
      log.info("Subscribed SQS to SNS with subscription ARN: "
          + snsSqsSubscriptionArn);
    } else {
      log.info("Already subscribed with ARN: " + snsSqsSubscriptionArn);
    }
View Full Code Here

        queueAttributes = new HashMap<String, String>();
        queueAttributes.put(QueueAttributeName.Policy.toString(), policy.toJson());
        sqs.setQueueAttributes(new SetQueueAttributesRequest(sqsQueueUrl, queueAttributes));

        SubscribeResult subscribeResult =
                sns.subscribe(new SubscribeRequest()
                    .withEndpoint(sqsQueueArn)
                    .withProtocol("sqs")
                    .withTopicArn(snsTopicArn));
        return subscribeResult.getSubscriptionArn();
    }
View Full Code Here

        underTest.setHostAddress("http://sample.host.com");
        underTest.setUseSslForSns(false);
        given(awsStackUtil.createSnsClient(Regions.DEFAULT_REGION, credential)).willReturn(snsClient);
        given(snsClient.createTopic(anyString())).willReturn(createTopicResult);
        given(snsTopicRepository.save(any(SnsTopic.class))).willReturn(snsTopic);
        given(snsClient.subscribe(anyString(), anyString(), anyString())).willReturn(new SubscribeResult());
        // WHEN
        underTest.createTopicAndSubscribe(credential, Regions.DEFAULT_REGION);
        // THEN
        verify(snsClient, times(1)).subscribe(AwsConnectorTestUtil.DEFAULT_TOPIC_ARN, "http", "http://sample.host.com/sns");
    }
View Full Code Here

        underTest.setHostAddress("https://sample.host.com");
        underTest.setUseSslForSns(true);
        given(awsStackUtil.createSnsClient(Regions.DEFAULT_REGION, credential)).willReturn(snsClient);
        given(snsClient.createTopic(anyString())).willReturn(createTopicResult);
        given(snsTopicRepository.save(any(SnsTopic.class))).willReturn(snsTopic);
        given(snsClient.subscribe(anyString(), anyString(), anyString())).willReturn(new SubscribeResult());
        // WHEN
        underTest.createTopicAndSubscribe(credential, Regions.DEFAULT_REGION);
        // THEN
        verify(snsClient, times(1)).subscribe(AwsConnectorTestUtil.DEFAULT_TOPIC_ARN, "https", "https://sample.host.com/sns");
    }
View Full Code Here

        underTest.setHostAddress("https://sample.host.com");
        underTest.setUseSslForSns(false);
        given(awsStackUtil.createSnsClient(Regions.DEFAULT_REGION, credential)).willReturn(snsClient);
        given(snsClient.createTopic(anyString())).willReturn(createTopicResult);
        given(snsTopicRepository.save(any(SnsTopic.class))).willReturn(snsTopic);
        given(snsClient.subscribe(anyString(), anyString(), anyString())).willReturn(new SubscribeResult());
        // WHEN
        underTest.createTopicAndSubscribe(credential, Regions.DEFAULT_REGION);
        // THEN
        verify(snsClient, times(1)).subscribe(AwsConnectorTestUtil.DEFAULT_TOPIC_ARN, "http", "http://sample.host.com/sns");
    }
View Full Code Here

    if (snsUrlSubscriptionArn == null) {

      SubscribeRequest request = new SubscribeRequest(topicArn,
          urlSubscription.getProtocol().toString(),
          urlSubscription.getEndpoint());
      SubscribeResult result = client.subscribe(request);
      snsUrlSubscriptionArn = result.getSubscriptionArn();
      log.info("Subscribed URL to SNS with subscription ARN: "
          + snsUrlSubscriptionArn);
    } else {
      log.info("Already subscribed with ARN: " + snsUrlSubscriptionArn);
    }
View Full Code Here

    }
    if (snsSqsSubscriptionArn == null) {
      SubscribeRequest request = new SubscribeRequest(topicArn,
          sqsSubscription.getProtocol(),
          sqsSubscription.getEndpoint());
      SubscribeResult result = client.subscribe(request);
      snsSqsSubscriptionArn = result.getSubscriptionArn();
      log.info("Subscribed SQS to SNS with subscription ARN: "
          + snsSqsSubscriptionArn);
    } else {
      log.info("Already subscribed with ARN: " + snsSqsSubscriptionArn);
    }
View Full Code Here

         
          SubscribeRequest redisEndPointSubscribeRequest = new SubscribeRequest();
          redisEndPointSubscribeRequest.setEndpoint(redisEndPointUrl);
          redisEndPointSubscribeRequest.setProtocol("redis");
          redisEndPointSubscribeRequest.setTopicArn(topicArn);
          SubscribeResult subscribeResult = cns1.subscribe(redisEndPointSubscribeRequest);
          logger.info("subscribeResult=" + subscribeResult);
         
          PublishRequest publishRequest = new PublishRequest();
          publishRequest.setMessage(message);
          publishRequest.setTopicArn(topicArn);
View Full Code Here

TOP

Related Classes of com.amazonaws.services.sns.model.SubscribeResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.