Package com.amazonaws.services.sns.model

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


        break;
      }
    }
    if (topicArn == null) {
      CreateTopicRequest request = new CreateTopicRequest(topicName);
      CreateTopicResult result = client.createTopic(request);
      topicArn = result.getTopicArn();
      log.debug("Topic created, arn: " + topicArn);
    } else {
      log.debug("Topic already created: " + topicArn);
    }
  }
View Full Code Here


    public void createTopicAndSubscribe(AwsCredential awsCredential, Regions region) {
        MDCBuilder.buildMdcContext(awsCredential);
        AmazonSNSClient amazonSNSClient = awsStackUtil.createSnsClient(region, awsCredential);
        LOGGER.info("Amazon SNS client successfully created.");

        CreateTopicResult createTopicResult = amazonSNSClient.createTopic(CB_TOPIC_NAME);
        LOGGER.info("Amazon SNS topic successfully created. [topic ARN: '{}']", createTopicResult.getTopicArn());

        SnsTopic snsTopic = new SnsTopic();
        snsTopic.setName(CB_TOPIC_NAME);
        snsTopic.setRegion(region);
        snsTopic.setCredential(awsCredential);
        snsTopic.setTopicArn(createTopicResult.getTopicArn());
        snsTopic.setConfirmed(false);
        snsTopicRepository.save(snsTopic);

        subscribeToTopic(amazonSNSClient, createTopicResult.getTopicArn());
    }
View Full Code Here

    @Before
    public void setUp() {
        MockitoAnnotations.initMocks(this);
        credential = AwsConnectorTestUtil.createAwsCredential();
        createTopicResult = new CreateTopicResult();
        createTopicResult.setTopicArn(AwsConnectorTestUtil.DEFAULT_TOPIC_ARN);
        confirmSubscriptionResult = new ConfirmSubscriptionResult();
        confirmSubscriptionResult.setSubscriptionArn(AwsConnectorTestUtil.DEFAULT_TOPIC_ARN);
        snsTopic = ServiceTestUtils.createSnsTopic(credential);
        stack = ServiceTestUtils.createStack(ServiceTestUtils.createTemplate(CloudPlatform.AWS), credential);
View Full Code Here

        break;
      }
    }
    if (topicArn == null) {
      CreateTopicRequest request = new CreateTopicRequest(topicName);
      CreateTopicResult result = client.createTopic(request);
      topicArn = result.getTopicArn();
      log.debug("Topic created, arn: " + topicArn);
    } else {
      log.debug("Topic already created: " + topicArn);
    }
  }
View Full Code Here

        throw new UnsupportedOperationException();
    }

    @Override
    public CreateTopicResult createTopic(CreateTopicRequest createTopicRequest) throws AmazonServiceException, AmazonClientException {
        CreateTopicResult createTopicResult = new CreateTopicResult();
        createTopicResult.setTopicArn(DEFAULT_TOPIC_ARN);
        return createTopicResult;
    }
View Full Code Here

          // create topic
         
          String topicName = "TSTT" + randomGenerator.nextLong();
           
      CreateTopicRequest createTopicRequest = new CreateTopicRequest(topicName);
      CreateTopicResult createTopicResult = sns.createTopic(createTopicRequest);
      String topicArn = createTopicResult.getTopicArn();
     
      // subscribe and confirm cqs endpoint
     
      SubscribeRequest subscribeRequest = new SubscribeRequest();
      String queueArn = getArnForQueueUrl(queueUrl);
View Full Code Here

    if (parameters.containsKey("Create")) {
   
      try {
       
        CreateTopicRequest createTopicRequest = new CreateTopicRequest(topicName);
        CreateTopicResult createTopicResult = sns.createTopic(createTopicRequest);
       
        arn = createTopicResult.getTopicArn();
       
        SetTopicAttributesRequest setTopicAttributesRequest = new SetTopicAttributesRequest(arn, "DisplayName", displayName);
        sns.setTopicAttributes(setTopicAttributesRequest);
       
        logger.debug("event=create topic_name=" + topicName + " topic_arn=" + arn + " user_id=" + userId);
View Full Code Here

     
        // set up topics
       
        CreateTopicRequest createTopicRequest = new CreateTopicRequest(TOPIC_NAME_PREFIX + k);
 
        CreateTopicResult createTopicResult = sns.createTopic(createTopicRequest);
 
        String topicArn = createTopicResult.getTopicArn();
       
        topics.add(topicArn);
       
        // set up subscriptions
       
View Full Code Here

        break;
      }
    }
    if (topicArn == null) {
      CreateTopicRequest request = new CreateTopicRequest(topicName);
      CreateTopicResult result = client.createTopic(request);
      topicArn = result.getTopicArn();
      log.debug("Topic created, arn: " + topicArn);
    } else {
      log.debug("Topic already created: " + topicArn);
    }
  }
View Full Code Here

TOP

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

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.