Package com.amazonaws.auth.policy

Examples of com.amazonaws.auth.policy.Resource


        Policy sqsPolicy =
            new Policy().withStatements(
                    new Statement(Effect.Allow)
                    .withPrincipals(Principal.AllUsers)
                    .withActions(SQSActions.SendMessage)
                    .withResources(new Resource(queueARN))
                    .withConditions(ConditionFactory.newSourceArnCondition(topicArn)));
        sqs.setQueueAttributes(new SetQueueAttributesRequest(queueUrl, newAttributes("Policy", sqsPolicy.toJson())));

        sns.subscribe(new SubscribeRequest(topicArn, "sqs", queueARN));
    }
View Full Code Here


        }

        List<Resource> resources = new LinkedList<Resource>();
        String resourceId = jStatement.optString(JsonDocumentFields.RESOURCE);
        if (resourceId != null && resourceId.length() > 0) {
            resources.add(new Resource(resourceId));
            statement.setResources(resources);
            return;
        }

        JSONArray jResources = jStatement.getJSONArray(JsonDocumentFields.RESOURCE);
        for (int index = 0 ; index < jResources.length() ; index++) {
            resources.add(new Resource(jResources.getString(index)));
        }
        statement.setResources(resources);
    }
View Full Code Here

    if (policyId == null || !policyId.equals(publishPolicyKey)) {
      Statement statement = new Statement(Effect.Allow);
      statement
          .withActions(SQSActions.SendMessage)
          .withPrincipals(Principal.AllUsers)
          .withResources(new Resource(queueArn))
          .withConditions(
              new ArnCondition(ArnComparisonType.ArnEquals,
                  ConditionFactory.SOURCE_ARN_CONDITION_KEY,
                  topicArn));
      Policy policy = new Policy();
View Full Code Here

        Policy sqsPolicy =
            new Policy().withStatements(
                    new Statement(Effect.Allow)
                    .withPrincipals(Principal.AllUsers)
                    .withActions(SQSActions.SendMessage)
                    .withResources(new Resource(queueARN))
                    .withConditions(ConditionFactory.newSourceArnCondition(topicArn)));
        sqs.setQueueAttributes(new SetQueueAttributesRequest(queueUrl, newAttributes("Policy", sqsPolicy.toJson())));

        sns.subscribe(new SubscribeRequest(topicArn, "sqs", queueARN));
    }
View Full Code Here

        }

        List<Resource> resources = new LinkedList<Resource>();
        String resourceId = jStatement.optString(JsonDocumentFields.RESOURCE);
        if (resourceId != null && resourceId.length() > 0) {
            resources.add(new Resource(resourceId));
            statement.setResources(resources);
            return;
        }

        JSONArray jResources = jStatement.getJSONArray(JsonDocumentFields.RESOURCE);
        for (int index = 0 ; index < jResources.length() ; index++) {
            resources.add(new Resource(jResources.getString(index)));
        }
        statement.setResources(resources);
    }
View Full Code Here

        }

        List<Resource> resources = new LinkedList<Resource>();
        String resourceId = jStatement.optString(JsonDocumentFields.RESOURCE);
        if (resourceId != null && resourceId.length() > 0) {
            resources.add(new Resource(resourceId));
            statement.setResources(resources);
            return;
        }

        JSONArray jResources = jStatement.getJSONArray(JsonDocumentFields.RESOURCE);
        for (int index = 0 ; index < jResources.length() ; index++) {
            resources.add(new Resource(jResources.getString(index)));
        }
        statement.setResources(resources);
    }
View Full Code Here

    if (policyId == null || !policyId.equals(publishPolicyKey)) {
      Statement statement = new Statement(Effect.Allow);
      statement
          .withActions(SQSActions.SendMessage)
          .withPrincipals(Principal.AllUsers)
          .withResources(new Resource(queueArn))
          .withConditions(
              new ArnCondition(ArnComparisonType.ArnEquals,
                  ConditionFactory.SOURCE_ARN_CONDITION_KEY,
                  topicArn));
      Policy policy = new Policy();
View Full Code Here

        Policy sqsPolicy =
            new Policy().withStatements(
                    new Statement(Effect.Allow)
                    .withPrincipals(Principal.AllUsers)
                    .withActions(SQSActions.SendMessage)
                    .withResources(new Resource(queueARN))
                    .withConditions(ConditionFactory.newSourceArnCondition(topicArn)));
        sqs.setQueueAttributes(new SetQueueAttributesRequest(queueUrl, newAttributes("Policy", sqsPolicy.toJson())));

        sns.subscribe(new SubscribeRequest(topicArn, "sqs", queueARN));
    }
View Full Code Here

        }

        List<Resource> resources = new LinkedList<Resource>();
        String resourceId = jStatement.optString(JsonDocumentFields.RESOURCE);
        if (resourceId != null && resourceId.length() > 0) {
            resources.add(new Resource(resourceId));
            statement.setResources(resources);
            return;
        }

        JSONArray jResources = jStatement.getJSONArray(JsonDocumentFields.RESOURCE);
        for (int index = 0 ; index < jResources.length() ; index++) {
            resources.add(new Resource(jResources.getString(index)));
        }
        statement.setResources(resources);
    }
View Full Code Here

TOP

Related Classes of com.amazonaws.auth.policy.Resource

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.