Examples of QueueEntryBinding


Examples of org.apache.qpid.server.store.berkeleydb.tuple.QueueEntryBinding

        {
            cursor = getDeliveryDb().openCursor(null, null);
            DatabaseEntry key = new DatabaseEntry();
            DatabaseEntry value = new DatabaseEntry();

            QueueEntryBinding keyBinding = QueueEntryBinding.getInstance();
            keyBinding.objectToEntry(new QueueEntryKey(queue.getId(),0l), key);

            if(cursor.getSearchKeyRange(key,value,LockMode.DEFAULT) == OperationStatus.SUCCESS)
            {
                QueueEntryKey entry = keyBinding.entryToObject(key);
                if(entry.getQueueId().equals(queue.getId()))
                {
                    entries.add(entry);
                }
                while (cursor.getNext(key, value, LockMode.DEFAULT) == OperationStatus.SUCCESS)
                {
                    entry = keyBinding.entryToObject(key);
                    if(entry.getQueueId().equals(queue.getId()))
                    {
                        entries.add(entry);
                    }
                    else
View Full Code Here

Examples of org.apache.qpid.server.store.berkeleydb.tuple.QueueEntryBinding

        List<QueueEntryKey> entries = new ArrayList<QueueEntryKey>();
        try
        {
            cursor = getDeliveryDb().openCursor(null, null);
            DatabaseEntry key = new DatabaseEntry();
            QueueEntryBinding keyBinding = QueueEntryBinding.getInstance();

            DatabaseEntry value = new DatabaseEntry();
            while (cursor.getNext(key, value, LockMode.DEFAULT) == OperationStatus.SUCCESS)
            {
                QueueEntryKey entry = keyBinding.entryToObject(key);
                entries.add(entry);
            }
        }
        catch (DatabaseException e)
        {
View Full Code Here

Examples of org.apache.qpid.server.store.berkeleydb.tuple.QueueEntryBinding

    private void enqueueMessage(final Transaction tx, final TransactionLogResource queue,
                                long messageId) throws StoreException
    {

        DatabaseEntry key = new DatabaseEntry();
        QueueEntryBinding keyBinding = QueueEntryBinding.getInstance();
        QueueEntryKey dd = new QueueEntryKey(queue.getId(), messageId);
        keyBinding.objectToEntry(dd, key);
        DatabaseEntry value = new DatabaseEntry();
        ByteBinding.byteToEntry((byte) 0, value);

        try
        {
View Full Code Here

Examples of org.apache.qpid.server.store.berkeleydb.tuple.QueueEntryBinding

    private void dequeueMessage(final Transaction tx, final TransactionLogResource queue,
                                long messageId) throws StoreException
    {

        DatabaseEntry key = new DatabaseEntry();
        QueueEntryBinding keyBinding = QueueEntryBinding.getInstance();
        QueueEntryKey queueEntryKey = new QueueEntryKey(queue.getId(), messageId);
        UUID id = queue.getId();
        keyBinding.objectToEntry(queueEntryKey, key);
        if (getLogger().isDebugEnabled())
        {
            getLogger().debug("Dequeue message id " + messageId + " from queue "
                              + queue.getName() + " with id " + id);
        }
View Full Code Here

Examples of org.apache.qpid.server.store.berkeleydb.tuple.QueueEntryBinding

        {
            cursor = getDeliveryDb().openCursor(null, null);
            DatabaseEntry key = new DatabaseEntry();
            DatabaseEntry value = new DatabaseEntry();

            QueueEntryBinding keyBinding = QueueEntryBinding.getInstance();
            keyBinding.objectToEntry(new QueueEntryKey(queue.getId(),0l), key);

            if(cursor.getSearchKeyRange(key,value,LockMode.DEFAULT) == OperationStatus.SUCCESS)
            {
                QueueEntryKey entry = keyBinding.entryToObject(key);
                if(entry.getQueueId().equals(queue.getId()))
                {
                    entries.add(entry);
                }
                while (cursor.getNext(key, value, LockMode.DEFAULT) == OperationStatus.SUCCESS)
                {
                    entry = keyBinding.entryToObject(key);
                    if(entry.getQueueId().equals(queue.getId()))
                    {
                        entries.add(entry);
                    }
                    else
View Full Code Here

Examples of org.apache.qpid.server.store.berkeleydb.tuple.QueueEntryBinding

        List<QueueEntryKey> entries = new ArrayList<QueueEntryKey>();
        try
        {
            cursor = getDeliveryDb().openCursor(null, null);
            DatabaseEntry key = new DatabaseEntry();
            QueueEntryBinding keyBinding = QueueEntryBinding.getInstance();

            DatabaseEntry value = new DatabaseEntry();
            while (cursor.getNext(key, value, LockMode.DEFAULT) == OperationStatus.SUCCESS)
            {
                QueueEntryKey entry = keyBinding.entryToObject(key);
                entries.add(entry);
            }
        }
        catch (RuntimeException e)
        {
View Full Code Here

Examples of org.apache.qpid.server.store.berkeleydb.tuple.QueueEntryBinding

    private void enqueueMessage(final Transaction tx, final TransactionLogResource queue,
                                long messageId) throws StoreException
    {

        DatabaseEntry key = new DatabaseEntry();
        QueueEntryBinding keyBinding = QueueEntryBinding.getInstance();
        QueueEntryKey dd = new QueueEntryKey(queue.getId(), messageId);
        keyBinding.objectToEntry(dd, key);
        DatabaseEntry value = new DatabaseEntry();
        ByteBinding.byteToEntry((byte) 0, value);

        try
        {
View Full Code Here

Examples of org.apache.qpid.server.store.berkeleydb.tuple.QueueEntryBinding

    private void dequeueMessage(final Transaction tx, final TransactionLogResource queue,
                                long messageId) throws StoreException
    {

        DatabaseEntry key = new DatabaseEntry();
        QueueEntryBinding keyBinding = QueueEntryBinding.getInstance();
        QueueEntryKey queueEntryKey = new QueueEntryKey(queue.getId(), messageId);
        UUID id = queue.getId();
        keyBinding.objectToEntry(queueEntryKey, key);
        if (getLogger().isDebugEnabled())
        {
            getLogger().debug("Dequeue message id " + messageId + " from queue "
                              + queue.getName() + " with id " + id);
        }
View Full Code Here

Examples of org.apache.qpid.server.store.berkeleydb.tuple.QueueEntryBinding

        Cursor cursor = null;
        try
        {
            cursor = _deliveryDb.openCursor(null, null);
            DatabaseEntry key = new DatabaseEntry();
            QueueEntryBinding keyBinding = QueueEntryBinding.getInstance();

            DatabaseEntry value = new DatabaseEntry();
            while (cursor.getNext(key, value, LockMode.RMW) == OperationStatus.SUCCESS)
            {
                QueueEntryKey qek = keyBinding.entryToObject(key);

                entries.add(qek);
            }

            try
            {
                cursor.close();
            }
            finally
            {
                cursor = null;
            }

            for(QueueEntryKey entry : entries)
            {
                UUID queueId = entry.getQueueId();
                long messageId = entry.getMessageId();
                qerh.queueEntry(queueId, messageId);
            }
        }
        catch (DatabaseException e)
        {
            LOGGER.error("Database Error: " + e.getMessage(), e);
            throw e;
        }
        finally
        {
            closeCursorSafely(cursor);
        }

        TransactionLogRecoveryHandler.DtxRecordRecoveryHandler dtxrh = qerh.completeQueueEntryRecovery();

        cursor = null;
        try
        {
            cursor = _xidDb.openCursor(null, null);
            DatabaseEntry key = new DatabaseEntry();
            XidBinding keyBinding = XidBinding.getInstance();
            PreparedTransactionBinding valueBinding = new PreparedTransactionBinding();
            DatabaseEntry value = new DatabaseEntry();

            while (cursor.getNext(key, value, LockMode.RMW) == OperationStatus.SUCCESS)
            {
                Xid xid = keyBinding.entryToObject(key);
                PreparedTransaction preparedTransaction = valueBinding.entryToObject(value);
                dtxrh.dtxRecord(xid.getFormat(),xid.getGlobalId(),xid.getBranchId(),
                                preparedTransaction.getEnqueues(),preparedTransaction.getDequeues());
            }
View Full Code Here

Examples of org.apache.qpid.server.store.berkeleydb.tuple.QueueEntryBinding

    public void enqueueMessage(final com.sleepycat.je.Transaction tx, final TransactionLogResource queue,
                               long messageId) throws AMQStoreException
    {

        DatabaseEntry key = new DatabaseEntry();
        QueueEntryBinding keyBinding = QueueEntryBinding.getInstance();
        QueueEntryKey dd = new QueueEntryKey(queue.getId(), messageId);
        keyBinding.objectToEntry(dd, key);
        DatabaseEntry value = new DatabaseEntry();
        ByteBinding.byteToEntry((byte) 0, value);

        try
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.