Package org.apache.qpid.server.store.berkeleydb.upgrade

Examples of org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6$BindingRecord


            @Override
            public void processEntry(Database sourceDatabase, Database targetDatabase, Transaction transaction,
                    DatabaseEntry key, DatabaseEntry value)
            {
                BindingRecord bindingRecord = bindingTuple.entryToObject(key);

                AMQShortString queueName = bindingRecord.getQueueName();
                AMQShortString exchangeName = bindingRecord.getExchangeName();
                AMQShortString routingKey = bindingRecord.getRoutingKey();
                FieldTable arguments = bindingRecord.getArguments();
                queueBindings.add(new BindingRecord(exchangeName, queueName, routingKey, arguments));
            }
        };
        new DatabaseTemplate(_environment, BINDING_DB_NAME, null).run(databaseOperation);
        return queueBindings;
    }
View Full Code Here


    }

    private void assertBindingRecord(List<BindingRecord> queueBindings, String queueName, String exchangeName,
            String routingKey, String selectorKey)
    {
        BindingRecord record = null;
        for (BindingRecord bindingRecord : queueBindings)
        {
            if (bindingRecord.getQueueName().asString().equals(queueName)
                    && bindingRecord.getExchangeName().asString().equals(exchangeName))
            {
                record = bindingRecord;
                break;
            }
        }
        assertNotNull("Binding is not found for queue " + queueName + " and exchange " + exchangeName, record);
        assertEquals("Unexpected routing key", routingKey, record.getRoutingKey().asString());

        if (selectorKey != null)
        {
            assertEquals("Unexpected selector key for " + queueName, selectorKey,
                    record.getArguments().get(AMQPFilterTypes.JMS_SELECTOR.getValue()));
        }
    }
View Full Code Here

            @Override
            public void processEntry(Database sourceDatabase, Database targetDatabase, Transaction transaction,
                    DatabaseEntry key, DatabaseEntry value)
            {
                BindingRecord bindingRecord = bindingTuple.entryToObject(key);

                AMQShortString queueName = bindingRecord.getQueueName();
                AMQShortString exchangeName = bindingRecord.getExchangeName();
                AMQShortString routingKey = bindingRecord.getRoutingKey();
                FieldTable arguments = bindingRecord.getArguments();
                queueBindings.add(new BindingRecord(exchangeName, queueName, routingKey, arguments));
            }
        };
        new DatabaseTemplate(_environment, BINDING_DB_NAME, null).run(databaseOperation);
        return queueBindings;
    }
View Full Code Here

    }

    private void assertBindingRecord(List<BindingRecord> queueBindings, String queueName, String exchangeName,
            String routingKey, String selectorKey)
    {
        BindingRecord record = null;
        for (BindingRecord bindingRecord : queueBindings)
        {
            if (bindingRecord.getQueueName().asString().equals(queueName)
                    && bindingRecord.getExchangeName().asString().equals(exchangeName))
            {
                record = bindingRecord;
                break;
            }
        }
        assertNotNull("Binding is not found for queue " + queueName + " and exchange " + exchangeName, record);
        assertEquals("Unexpected routing key", routingKey, record.getRoutingKey().asString());

        if (selectorKey != null)
        {
            assertEquals("Unexpected selector key for " + queueName, selectorKey,
                    record.getArguments().get(AMQPFilterTypes.JMS_SELECTOR.getValue()));
        }
    }
View Full Code Here

            @Override
            public void processEntry(Database sourceDatabase, Database targetDatabase, Transaction transaction,
                    DatabaseEntry key, DatabaseEntry value)
            {
                BindingRecord bindingRecord = bindingTuple.entryToObject(key);

                AMQShortString queueName = bindingRecord.getQueueName();
                AMQShortString exchangeName = bindingRecord.getExchangeName();
                AMQShortString routingKey = bindingRecord.getRoutingKey();
                FieldTable arguments = bindingRecord.getArguments();
                queueBindings.add(new BindingRecord(exchangeName, queueName, routingKey, arguments));
            }
        };
        new DatabaseTemplate(_environment, BINDING_DB_NAME, null).run(databaseOperation);
        return queueBindings;
    }
View Full Code Here

    }

    private void assertBindingRecord(List<BindingRecord> queueBindings, String queueName, String exchangeName,
            String routingKey, String selectorKey)
    {
        BindingRecord record = null;
        for (BindingRecord bindingRecord : queueBindings)
        {
            if (bindingRecord.getQueueName().asString().equals(queueName)
                    && bindingRecord.getExchangeName().asString().equals(exchangeName))
            {
                record = bindingRecord;
                break;
            }
        }
        assertNotNull("Binding is not found for queue " + queueName + " and exchange " + exchangeName, record);
        assertEquals("Unexpected routing key", routingKey, record.getRoutingKey().asString());

        if (selectorKey != null)
        {
            assertEquals("Unexpected selector key for " + queueName, selectorKey,
                    record.getArguments().get(AMQPFilterTypes.JMS_SELECTOR.getValue()));
        }
    }
View Full Code Here

            @Override
            public void processEntry(Database sourceDatabase, Database targetDatabase, Transaction transaction,
                    DatabaseEntry key, DatabaseEntry value)
            {
                CompoundKeyBinding binding = new CompoundKeyBinding();
                CompoundKey originalCompoundKey = binding.entryToObject(key);
                int corruptedOffset = originalCompoundKey.getOffset() + 2;
                CompoundKey corruptedCompoundKey = new CompoundKey(originalCompoundKey.getMessageId(), corruptedOffset);
                DatabaseEntry newKey = new DatabaseEntry();
                binding.objectToEntry(corruptedCompoundKey, newKey);

                _logger.info("Deliberately corrupted message id " + originalCompoundKey.getMessageId()
                        + ", changed offset from " + originalCompoundKey.getOffset() + " to "
                        + corruptedCompoundKey.getOffset());

                deleteCurrent();
                sourceDatabase.put(transaction, newKey, value);

                abort();
View Full Code Here

            @Override
            public void processEntry(Database sourceDatabase, Database targetDatabase, Transaction transaction,
                    DatabaseEntry key, DatabaseEntry value)
            {
                CompoundKeyBinding binding = new CompoundKeyBinding();
                CompoundKey originalCompoundKey = binding.entryToObject(key);
                int corruptedOffset = originalCompoundKey.getOffset() + 2;
                CompoundKey corruptedCompoundKey = new CompoundKey(originalCompoundKey.getMessageId(), corruptedOffset);
                DatabaseEntry newKey = new DatabaseEntry();
                binding.objectToEntry(corruptedCompoundKey, newKey);

                _logger.info("Deliberately corrupted message id " + originalCompoundKey.getMessageId()
                        + ", changed offset from " + originalCompoundKey.getOffset() + " to "
                        + corruptedCompoundKey.getOffset());

                deleteCurrent();
                sourceDatabase.put(transaction, newKey, value);

                abort();
View Full Code Here

            @Override
            public void processEntry(Database sourceDatabase, Database targetDatabase, Transaction transaction,
                    DatabaseEntry key, DatabaseEntry value)
            {
                CompoundKeyBinding binding = new CompoundKeyBinding();
                CompoundKey originalCompoundKey = binding.entryToObject(key);
                int corruptedOffset = originalCompoundKey.getOffset() + 2;
                CompoundKey corruptedCompoundKey = new CompoundKey(originalCompoundKey.getMessageId(), corruptedOffset);
                DatabaseEntry newKey = new DatabaseEntry();
                binding.objectToEntry(corruptedCompoundKey, newKey);

                _logger.info("Deliberately corrupted message id " + originalCompoundKey.getMessageId()
                        + ", changed offset from " + originalCompoundKey.getOffset() + " to "
                        + corruptedCompoundKey.getOffset());

                deleteCurrent();
                sourceDatabase.put(transaction, newKey, value);

                abort();
View Full Code Here

            @Override
            public void processEntry(Database sourceDatabase, Database targetDatabase, Transaction transaction,
                    DatabaseEntry key, DatabaseEntry value)
            {
                CompoundKeyBinding binding = new CompoundKeyBinding();
                CompoundKey originalCompoundKey = binding.entryToObject(key);
                int corruptedOffset = originalCompoundKey.getOffset() + 2;
                CompoundKey corruptedCompoundKey = new CompoundKey(originalCompoundKey.getMessageId(), corruptedOffset);
                DatabaseEntry newKey = new DatabaseEntry();
                binding.objectToEntry(corruptedCompoundKey, newKey);

                _logger.info("Deliberately corrupted message id " + originalCompoundKey.getMessageId()
                        + ", changed offset from " + originalCompoundKey.getOffset() + " to "
                        + corruptedCompoundKey.getOffset());

                deleteCurrent();
                sourceDatabase.put(transaction, newKey, value);

                abort();
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6$BindingRecord

Copyright © 2018 www.massapicom. 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.