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

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

Introduction

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

Prototype


public String getQueueName() 

Source Link

Document

The name of the new queue.

Usage

From source file:org.apache.camel.component.aws.sqs.AmazonSQSClientMock.java

License:Apache License

@Override
public CreateQueueResult createQueue(CreateQueueRequest createQueueRequest)
        throws AmazonServiceException, AmazonClientException {
    String queueName = "https://queue.amazonaws.com/541925086079/" + createQueueRequest.getQueueName();
    queues.put(queueName, createQueueRequest);
    CreateQueueResult result = new CreateQueueResult();
    result.setQueueUrl(queueName);/*from   ww  w  .j  a v  a 2 s  .c om*/
    return result;
}

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

License:Open Source License

public CreateQueueResult createQueue(final CreateQueueRequest request)
        throws AmazonServiceException, AmazonClientException {
    if (request == null) {
        throw new AmazonClientException("Null CreateQueueRequest");
    }//  www  .  j  av a 2  s .  co  m
    final String queueName = request.getQueueName();
    if (StringUtils.isBlank(queueName) || queueName.length() > 80) {
        throw new AmazonServiceException("Invalid queue name: " + queueName);
    }
    final String queueUrl = QUEUE_URL_PREFIX + queueName;
    checkURLForException(queueUrl);
    // Per documentation, throws QueueNameExistsException, but in my testing, they actually
    // just quietly return the CreateQueueResult
    // (Also note: we are ignoring the documented exception: QueueDeletedRecentlyException)
    if (!allQueues.containsKey(queueUrl)) {
        allQueues.put(queueUrl, Collections.synchronizedList(new ArrayList<Message>()));
        retrievedMessages.put(queueUrl, new ConcurrentHashMap<String, Message>());
    }
    return new CreateQueueResult().withQueueUrl(queueUrl);
}