use of org.apache.qpid.server.store.ConfiguredObjectRecord in project qpid-broker-j by apache.
the class TestBrokerConfiguration method setObjectAttributes.
private boolean setObjectAttributes(ConfiguredObjectRecord entry, Map<String, Object> attributes) {
Map<String, Object> newAttributes = new HashMap<String, Object>(entry.getAttributes());
newAttributes.putAll(attributes);
ConfiguredObjectRecord newEntry = new ConfiguredObjectRecordImpl(entry.getId(), entry.getType(), newAttributes, entry.getParents());
_store.update(false, newEntry);
return true;
}
use of org.apache.qpid.server.store.ConfiguredObjectRecord in project qpid-broker-j by apache.
the class TestBrokerConfiguration method save.
public boolean save(File configFile) {
Map<String, Object> attributes = new HashMap<>();
attributes.put("storePath", configFile.getAbsolutePath());
SystemConfigFactory configFactory = (new PluggableFactoryLoader<>(SystemConfigFactory.class)).get(_storeType);
attributes.put(SystemConfig.STARTUP_LOGGED_TO_SYSTEM_OUT, false);
attributes.put(ConfiguredObject.DESIRED_STATE, State.QUIESCED);
final SystemConfig parentObject = configFactory.newInstance(_taskExecutor, mock(EventLogger.class), null, attributes);
parentObject.open();
DurableConfigurationStore configurationStore = parentObject.getConfigurationStore();
configurationStore.closeConfigurationStore();
final List<ConfiguredObjectRecord> records = getConfiguredObjectRecords();
configurationStore.init(parentObject);
clearStore(configurationStore);
configurationStore.update(true, records.toArray(new ConfiguredObjectRecord[records.size()]));
configurationStore.closeConfigurationStore();
parentObject.close();
return true;
}
use of org.apache.qpid.server.store.ConfiguredObjectRecord in project qpid-broker-j by apache.
the class TestBrokerConfiguration method addObjectConfiguration.
private void addObjectConfiguration(UUID id, String type, Map<String, Object> attributes) {
ConfiguredObjectRecord entry = new ConfiguredObjectRecordImpl(id, type, attributes, Collections.singletonMap(Broker.class.getSimpleName(), findObject(Broker.class, null).getId()));
_store.update(true, entry);
}
Aggregations