Example usage for com.amazonaws.auth.policy Statement getActions

List of usage examples for com.amazonaws.auth.policy Statement getActions

Introduction

In this page you can find the example usage for com.amazonaws.auth.policy Statement getActions.

Prototype

public List<Action> getActions() 

Source Link

Document

Returns the list of actions to which this policy statement applies.

Usage

From source file:com.netflix.conductor.contribs.queue.sqs.SQSObservableQueue.java

License:Apache License

private String getPolicy(List<String> accountIds) {
    Policy policy = new Policy("ReloadedWorkerAccessPolicy");
    Statement stmt = new Statement(Effect.Allow);
    Action action = SQSActions.SendMessage;
    stmt.getActions().add(action);
    stmt.setResources(new LinkedList<>());
    for (String accountId : accountIds) {
        Principal principal = new Principal(accountId);
        stmt.getPrincipals().add(principal);
    }/*from ww w.ja  v a  2 s. co  m*/
    stmt.getResources().add(new Resource(getQueueARN()));
    policy.getStatements().add(stmt);
    return policy.toJson();
}