Example usage for com.amazonaws.services.sqs.model GetQueueUrlRequest getQueueName

List of usage examples for com.amazonaws.services.sqs.model GetQueueUrlRequest getQueueName

Introduction

In this page you can find the example usage for com.amazonaws.services.sqs.model GetQueueUrlRequest getQueueName.

Prototype


public String getQueueName() 

Source Link

Document

The name of the queue whose URL must be fetched.

Usage

From source file:org.flite.mock.amazonaws.sqs.AmazonSQSMock.java

License:Open Source License

public GetQueueUrlResult getQueueUrl(final GetQueueUrlRequest request)
        throws AmazonServiceException, AmazonClientException {
    if (request == null) {
        throw new AmazonClientException("Null GetQueueUrlRequest");
    }/*from   ww  w. j  a  v  a  2s  .c o m*/
    final String queueName = request.getQueueName();
    final String queueUrl = QUEUE_URL_PREFIX + queueName;
    checkURLForException(queueUrl);
    // Per documentation, supposedly throws QueueDoesNotExistException,
    // but in my tests, they actually just throw AmazonServiceException
    if (!allQueues.containsKey(queueUrl)) {
        throw new AmazonServiceException("Queue Not Found: " + queueUrl);
    }
    return new GetQueueUrlResult().withQueueUrl(queueUrl);
}