List of usage examples for com.amazonaws.services.sqs.model ReceiptHandleIsInvalidException ReceiptHandleIsInvalidException
public ReceiptHandleIsInvalidException(String message)
From source file:org.flite.mock.amazonaws.sqs.AmazonSQSMock.java
License:Open Source License
public void deleteMessage(final DeleteMessageRequest request) throws AmazonServiceException, AmazonClientException { if (request == null) { throw new AmazonClientException("Null DeleteMessageRequest"); }/*from ww w . j a v a2 s .c om*/ final String queueUrl = request.getQueueUrl(); checkURLForException(queueUrl); checkStringForExceptionMarker(request.getReceiptHandle()); // Ignoring the documented exception: InvalidIdFormatException if (!allQueues.containsKey(queueUrl)) { throw new AmazonServiceException("Queue Not Found: " + queueUrl); } if (!retrievedMessages.containsKey(queueUrl)) { throw new AmazonServiceException("Queue Not Found: " + queueUrl); } if (!retrievedMessages.get(queueUrl).containsKey(request.getReceiptHandle())) { throw new ReceiptHandleIsInvalidException("Reciept Handle Not Found: " + request.getReceiptHandle()); } retrievedMessages.get(queueUrl).remove(request.getReceiptHandle()); }