use of org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom5To6.UpgradeUUIDBinding 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;
}
Aggregations