Search in sources :

Example 1 with ConfiguredObjectBinding

use of org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.ConfiguredObjectBinding in project qpid-broker-j by apache.

the class UpgradeFrom5To6Test method loadConfiguredObjects.

private Map<UUID, UpgradeConfiguredObjectRecord> loadConfiguredObjects() {
    final Map<UUID, UpgradeConfiguredObjectRecord> configuredObjectsRecords = new HashMap<UUID, UpgradeConfiguredObjectRecord>();
    final ConfiguredObjectBinding binding = new ConfiguredObjectBinding();
    final UpgradeUUIDBinding uuidBinding = new UpgradeUUIDBinding();
    CursorOperation configuredObjectsCursor = new CursorOperation() {

        @Override
        public void processEntry(Database sourceDatabase, Database targetDatabase, Transaction transaction, DatabaseEntry key, DatabaseEntry value) {
            UUID id = uuidBinding.entryToObject(key);
            UpgradeConfiguredObjectRecord object = binding.entryToObject(value);
            configuredObjectsRecords.put(id, object);
        }
    };
    new DatabaseTemplate(_environment, CONFIGURED_OBJECTS_DB_NAME, null).run(configuredObjectsCursor);
    return configuredObjectsRecords;
}
Also used : UpgradeUUIDBinding(org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.UpgradeUUIDBinding) ConfiguredObjectBinding(org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.ConfiguredObjectBinding) NewPreparedTransaction(org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.NewPreparedTransaction) OldPreparedTransaction(org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.OldPreparedTransaction) Transaction(com.sleepycat.je.Transaction) UpgradeConfiguredObjectRecord(org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.UpgradeConfiguredObjectRecord) HashMap(java.util.HashMap) Database(com.sleepycat.je.Database) DatabaseEntry(com.sleepycat.je.DatabaseEntry) UUID(java.util.UUID)

Aggregations

Database (com.sleepycat.je.Database)1 DatabaseEntry (com.sleepycat.je.DatabaseEntry)1 Transaction (com.sleepycat.je.Transaction)1 HashMap (java.util.HashMap)1 UUID (java.util.UUID)1 ConfiguredObjectBinding (org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.ConfiguredObjectBinding)1 NewPreparedTransaction (org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.NewPreparedTransaction)1 OldPreparedTransaction (org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.OldPreparedTransaction)1 UpgradeConfiguredObjectRecord (org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.UpgradeConfiguredObjectRecord)1 UpgradeUUIDBinding (org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.UpgradeUUIDBinding)1