Package com.amazonaws.services.sqs.model

Examples of com.amazonaws.services.sqs.model.GetQueueAttributesRequest


      String queueName = "glacier-archive-transfer-" + System.currentTimeMillis();
      String topicName = "glacier-archive-transfer-" + System.currentTimeMillis();

        queueUrl = sqs.createQueue(new CreateQueueRequest(queueName)).getQueueUrl();
        topicArn = sns.createTopic(new CreateTopicRequest(topicName)).getTopicArn();
        String queueARN = sqs.getQueueAttributes(new GetQueueAttributesRequest(queueUrl).withAttributeNames("QueueArn")).getAttributes().get("QueueArn");

        Policy sqsPolicy =
            new Policy().withStatements(
                    new Statement(Effect.Allow)
                    .withPrincipals(Principal.AllUsers)
View Full Code Here


      String queueName = "glacier-archive-transfer-" + System.currentTimeMillis();
      String topicName = "glacier-archive-transfer-" + System.currentTimeMillis();
     
        queueUrl = sqs.createQueue(new CreateQueueRequest(queueName)).getQueueUrl();
        topicArn = sns.createTopic(new CreateTopicRequest(topicName)).getTopicArn();
        String queueARN = sqs.getQueueAttributes(new GetQueueAttributesRequest(queueUrl).withAttributeNames("QueueArn")).getAttributes().get("QueueArn");
       
        Policy sqsPolicy =
            new Policy().withStatements(
                    new Statement(Effect.Allow)
                    .withPrincipals(Principal.AllUsers)
View Full Code Here

     * @return The subscription ARN as returned by Amazon SNS when the queue is
     *         successfully subscribed to the topic.
     */
    public static String subscribeQueue(AmazonSNS sns, AmazonSQS sqs, String snsTopicArn, String sqsQueueUrl)
                throws AmazonClientException, AmazonServiceException {
        Map<String, String> queueAttributes = sqs.getQueueAttributes(new GetQueueAttributesRequest(sqsQueueUrl)
                .withAttributeNames(QueueAttributeName.QueueArn.toString())).getAttributes();
        String sqsQueueArn = queueAttributes.get(QueueAttributeName.QueueArn.toString());

        Policy policy = new Policy().withStatements(
                new Statement(Effect.Allow)
View Full Code Here

          deleteMessage(new DeleteMessageRequest(queueUrl, receiptHandle));
    }

    @Override
    public GetQueueAttributesResult getQueueAttributes(String queueUrl, List<String> attributeNames) {
         return getQueueAttributes(new GetQueueAttributesRequest(queueUrl, attributeNames));
    }
View Full Code Here

                return;
        }

        synchronized (taskSpawnSyncPoint) {
            if (visibilityTimeoutNanos == -1) {
                GetQueueAttributesRequest request = new GetQueueAttributesRequest().
                        withQueueUrl(qUrl).
                        withAttributeNames("VisibilityTimeout");
                ResultConverter.appendUserAgent(request, AmazonSQSBufferedAsyncClient.USER_AGENT);
                long visibilityTimeoutSeconds = Long.parseLong(sqsClient.getQueueAttributes( request ).getAttributes().get("VisibilityTimeout"));
                visibilityTimeoutNanos = TimeUnit.NANOSECONDS.convert(visibilityTimeoutSeconds, TimeUnit.SECONDS);
View Full Code Here

     * @return The subscription ARN as returned by Amazon SNS when the queue is
     *         successfully subscribed to the topic.
     */
    public static String subscribeQueue(AmazonSNS sns, AmazonSQS sqs, String snsTopicArn, String sqsQueueUrl)
                throws AmazonClientException, AmazonServiceException {
        Map<String, String> queueAttributes = sqs.getQueueAttributes(new GetQueueAttributesRequest(sqsQueueUrl)
                .withAttributeNames(QueueAttributeName.QueueArn.toString())).getAttributes();
        String sqsQueueArn = queueAttributes.get(QueueAttributeName.QueueArn.toString());

        Policy policy = new Policy().withStatements(
                new Statement(Effect.Allow)
View Full Code Here

                return;
        }

        synchronized (taskSpawnSyncPoint) {
            if (visibilityTimeoutNanos == -1) {
                GetQueueAttributesRequest request = new GetQueueAttributesRequest().
                        withQueueUrl(qUrl).
                        withAttributeNames("VisibilityTimeout");
                ResultConverter.appendUserAgent(request, AmazonSQSBufferedAsyncClient.USER_AGENT);
                long visibilityTimeoutSeconds = Long.parseLong(sqsClient.getQueueAttributes( request ).getAttributes().get("VisibilityTimeout"));
                visibilityTimeoutNanos = TimeUnit.NANOSECONDS.convert(visibilityTimeoutSeconds, TimeUnit.SECONDS);
View Full Code Here

      String queueName = "glacier-archive-transfer-" + System.currentTimeMillis();
      String topicName = "glacier-archive-transfer-" + System.currentTimeMillis();

        queueUrl = sqs.createQueue(new CreateQueueRequest(queueName)).getQueueUrl();
        topicArn = sns.createTopic(new CreateTopicRequest(topicName)).getTopicArn();
        String queueARN = sqs.getQueueAttributes(new GetQueueAttributesRequest(queueUrl).withAttributeNames("QueueArn")).getAttributes().get("QueueArn");

        Policy sqsPolicy =
            new Policy().withStatements(
                    new Statement(Effect.Allow)
                    .withPrincipals(Principal.AllUsers)
View Full Code Here

    resolveQueueArn();
  }

  private void resolveQueueArn() {
    GetQueueAttributesRequest request = new GetQueueAttributesRequest(
        queueUrl);
    GetQueueAttributesResult result = sqsClient.getQueueAttributes(request
        .withAttributeNames(Collections.singletonList(QUEUE_ARN_KEY)));
    queueArn = result.getAttributes().get(QUEUE_ARN_KEY);
  }
View Full Code Here

  public void addSnsPublishPolicy(String topicName, String topicArn) {

    String publishPolicyKey = String.format("SNS-%s-SQS-%s", topicName,
        queueName);
    String policyId = null;
    GetQueueAttributesRequest getAttrRequest = new GetQueueAttributesRequest(
        queueUrl);
    getAttrRequest.setAttributeNames(Collections.singletonList("Policy"));
    GetQueueAttributesResult result = sqsClient
        .getQueueAttributes(getAttrRequest);
    Map<String, String> attributes = result.getAttributes();
    String policyStr = attributes.get("Policy");
    log.debug("Policy:" + policyStr);
View Full Code Here

TOP

Related Classes of com.amazonaws.services.sqs.model.GetQueueAttributesRequest

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.