use of org.apache.qpid.server.store.berkeleydb.upgrade.UpgradeFrom4To5.BindingTuple in project qpid-broker-j by apache.
the class UpgradeFrom4to5Test method loadBindings.
private List<BindingRecord> loadBindings() {
final BindingTuple bindingTuple = new BindingTuple();
final List<BindingRecord> queueBindings = new ArrayList<BindingRecord>();
CursorOperation databaseOperation = new CursorOperation() {
@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;
}
Aggregations