DatabaseEntry key = new DatabaseEntry();
QueueEntryKey dd = new QueueEntryKey(queueId, 0);
QueueEntryBinding keyBinding = QueueEntryBinding.getInstance();
keyBinding.objectToEntry(dd, key);
DatabaseEntry value = new DatabaseEntry();
LinkedList<Long> messageIds = new LinkedList<Long>();
OperationStatus status = cursor.getSearchKeyRange(key, value, LockMode.DEFAULT);
dd = keyBinding.entryToObject(key);
while ((status == OperationStatus.SUCCESS) && dd.getQueueId().equals(queueId))
{
messageIds.add(dd.getMessageId());
status = cursor.getNext(key, value, LockMode.DEFAULT);
if (status == OperationStatus.SUCCESS)
{
dd = keyBinding.entryToObject(key);
}
}
return messageIds;
}