Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright 2010-2015, Inc. or its affiliates. All Rights Reserved.
  * Licensed under the Apache License, Version 2.0 (the "License").
  * You may not use this file except in compliance with the License.
  * A copy of the License is located at
 * or in the "license" file accompanying this file. This file is distributed
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
package com.amazonaws.auth.policy.resources;
AWS access control policy resource that identifies an Amazon SQS queue.

This is an older style of referencing an Amazon SQS queue. You can also use the queue's Amazon Resource Name (ARN), which you can obtain by calling and requesting the "QueueArn" attribute.

public class SQSQueueResource extends Resource {

Constructs a new SQS queue resource for an access control policy. A policy statement using this resource will allow or deny actions on the specified queue.

accountId The AWS account ID of the queue owner.
queueName The name of the Amazon SQS queue.
    public SQSQueueResource(String accountIdString queueName) {
        super("/" + formatAccountId(accountId) + "/" + queueName);
    private static String formatAccountId(String accountId) {
        if (accountId == null) {
            throw new IllegalArgumentException("Account ID cannot be null");
        return accountId.trim().replaceAll("-""");
New to GrepCode? Check out our FAQ X