Package com.amazonaws.services.sns.model

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


        LOG.trace("Topic created with Amazon resource name: {}", configuration.getTopicArn());
       
        if (configuration.getPolicy() != null) {
            LOG.trace("Updating topic [{}] with policy [{}]", configuration.getTopicArn(), configuration.getPolicy());
           
            getSNSClient().setTopicAttributes(new SetTopicAttributesRequest(configuration.getTopicArn(), "Policy", configuration.getPolicy()));
           
            LOG.trace("Topic policy updated");
        }
    }
View Full Code Here


        LOG.trace("Topic created with Amazon resource name: {}", configuration.getTopicArn());
       
        if (configuration.getPolicy() != null) {
            LOG.trace("Updating topic [{}] with policy [{}]", configuration.getTopicArn(), configuration.getPolicy());
           
            getSNSClient().setTopicAttributes(new SetTopicAttributesRequest(configuration.getTopicArn(), "Policy", configuration.getPolicy()));
           
            LOG.trace("Topic policy updated");
        }
    }
View Full Code Here

        LOG.trace("Topic created with Amazon resource name: {}", configuration.getTopicArn());
       
        if (configuration.getPolicy() != null) {
            LOG.trace("Updating topic [{}] with policy [{}]", configuration.getTopicArn(), configuration.getPolicy());
           
            getSNSClient().setTopicAttributes(new SetTopicAttributesRequest(configuration.getTopicArn(), "Policy", configuration.getPolicy()));
           
            LOG.trace("Topic policy updated");
        }
    }
View Full Code Here

        LOG.trace("Topic created with Amazon resource name: {}", configuration.getTopicArn());
       
        if (ObjectHelper.isNotEmpty(configuration.getPolicy())) {
            LOG.trace("Updating topic [{}] with policy [{}]", configuration.getTopicArn(), configuration.getPolicy());
           
            snsClient.setTopicAttributes(new SetTopicAttributesRequest(configuration.getTopicArn(), "Policy", configuration.getPolicy()));
           
            LOG.trace("Topic policy updated");
        }
        // Override the setting Endpoint from url
        if (ObjectHelper.isNotEmpty(configuration.getAmazonSNSEndpoint())) {
View Full Code Here

    simpleHeader(request, out, "Edit Topic Display Name");
   
    if (parameters.containsKey("Edit")) {
   
      try {
        SetTopicAttributesRequest setTopicAttributesRequest = new SetTopicAttributesRequest(topicArn, "DisplayName", displayName);
        sns.setTopicAttributes(setTopicAttributesRequest);
        logger.debug("event=update_display_name topic_arn=" + topicArn + " user_id= " + userId);
      } catch (Exception ex) {
        logger.error("event=update_display_name topic_arn= " + topicArn + " user_id= " + userId, ex);
        throw new ServletException(ex);
View Full Code Here

     
      deliveryPolicy.setDefaultThrottlePolicy(defaultThrottle );
     
      try {

        SetTopicAttributesRequest setTopicAttributesRequest = new SetTopicAttributesRequest(topicArn, "DeliveryPolicy", deliveryPolicy.toString());
        sns.setTopicAttributes(setTopicAttributesRequest);
       
        logger.debug("event=set_delivery_policy topic_arn=" + topicArn + " userId= " + userId);

      } catch (Exception ex) {
View Full Code Here

        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);

      } catch (Exception ex) {
View Full Code Here

      "\"backoffFunction\": \"geometric\""+
      "}," +
      "\"defaultThrottlePolicy\":null" +
      "}}";
     
      cns1.setTopicAttributes(new SetTopicAttributesRequest(topicArn, "DeliveryPolicy", jsonStr2));
      GetTopicAttributesResult results = cns1.getTopicAttributes(new GetTopicAttributesRequest(topicArn));
      assertTrue("Default Effective Delivery Policy missing", results.getAttributes().get("EffectiveDeliveryPolicy") != null);

      String deliveryPolicy = results.getAttributes().get("EffectiveDeliveryPolicy");
      JSONObject dpJson = new JSONObject(deliveryPolicy);
View Full Code Here

   
    try {
     
      String topicArn = this.getTopic(1, USR.USER1);
      String displayName = "My Display Name !@#$%^&*()-+";
      cns1.setTopicAttributes(new SetTopicAttributesRequest(topicArn, "DisplayName", displayName));
      GetTopicAttributesResult results = cns1.getTopicAttributes(new GetTopicAttributesRequest(topicArn));
      assertTrue("Display name is " + results.getAttributes().get("DisplayName") + ", expected: " + displayName, results.getAttributes().get("DisplayName").equals(displayName));

    } catch (Exception ex) {
      logger.error("test failed", ex);
View Full Code Here

          addPermissionRequest.setActionNames(Arrays.asList("SetTopicAttributes", "Publish"));
          addPermissionRequest.setLabel("P1");
          addPermissionRequest.setAWSAccountIds(Arrays.asList(user2.getUserId()));       
          cns1.addPermission(addPermissionRequest);
         
          SetTopicAttributesRequest setTopicAttributesRequest = new SetTopicAttributesRequest();
          setTopicAttributesRequest.setAttributeName("DisplayName");
          setTopicAttributesRequest.setAttributeValue("NewDisplayName");
          setTopicAttributesRequest.setTopicArn(topicArn);
          cns2.setTopicAttributes(setTopicAttributesRequest);
     
          GetTopicAttributesRequest getTopicAttributesRequest = new GetTopicAttributesRequest();
          getTopicAttributesRequest.setTopicArn(topicArn);
          GetTopicAttributesResult result = cns1.getTopicAttributes(getTopicAttributesRequest);
         
          assertTrue("Expected display name NewDisplayName, instead found " + result.getAttributes().get("DisplayName"), result.getAttributes().get("DisplayName").equals("NewDisplayName"));
 
          RemovePermissionRequest removePermissionRequest = new RemovePermissionRequest();
          removePermissionRequest.setTopicArn(topicArn);
          removePermissionRequest.setLabel("P1");
          cns1.removePermission(removePermissionRequest);
         
          logger.info("Now trying to do things without permission");
         
          try {
              setTopicAttributesRequest = new SetTopicAttributesRequest();
              setTopicAttributesRequest.setAttributeName("DisplayName");
              setTopicAttributesRequest.setAttributeValue("NewDisplayName2");
              setTopicAttributesRequest.setTopicArn(topicArn);
              cns2.setTopicAttributes(setTopicAttributesRequest);
              fail("missing expected exception");
          } catch (Exception ex) {
            assertTrue(ex.getMessage().contains("don't have permission"));
          }
View Full Code Here

TOP

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

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.