use of org.apache.qpid.server.store.ConfiguredObjectRecordImpl in project qpid-broker-j by apache.
the class ConfiguredObjectBindingTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
_configuredObjectBinding = ConfiguredObjectBinding.getInstance();
_object = new ConfiguredObjectRecordImpl(UUIDGenerator.generateRandomUUID(), DUMMY_TYPE_STRING, DUMMY_ATTRIBUTES_MAP);
}
use of org.apache.qpid.server.store.ConfiguredObjectRecordImpl in project qpid-broker-j by apache.
the class AbstractVirtualHostNode method enrichWithAuditInformation.
private void enrichWithAuditInformation(final Collection<ConfiguredObjectRecord> records) {
List<ConfiguredObjectRecord> replacements = new ArrayList<>(records.size());
for (ConfiguredObjectRecord record : records) {
replacements.add(new ConfiguredObjectRecordImpl(record.getId(), record.getType(), enrichAttributesWithAuditInformation(record.getAttributes()), record.getParents()));
}
records.clear();
records.addAll(replacements);
}
use of org.apache.qpid.server.store.ConfiguredObjectRecordImpl in project qpid-broker-j by apache.
the class ManagementModeStoreHandlerTest method testSavePort.
public void testSavePort() {
_systemConfigAttributes.put(SystemConfig.MANAGEMENT_MODE_HTTP_PORT_OVERRIDE, 1000);
_handler = createManagementModeStoreHandler();
_handler.init(_systemConfig);
Collection<ConfiguredObjectRecord> records = openAndGetRecords();
Map<String, Object> attributes = new HashMap<String, Object>();
attributes.put(Port.NAME, "TEST");
ConfiguredObjectRecord configurationEntry = new ConfiguredObjectRecordImpl(_portEntryId, Port.class.getSimpleName(), attributes, Collections.singletonMap(Broker.class.getSimpleName(), getRootEntry(records).getId()));
_handler.create(configurationEntry);
verify(_store).create(any(ConfiguredObjectRecord.class));
}
use of org.apache.qpid.server.store.ConfiguredObjectRecordImpl in project qpid-broker-j by apache.
the class ManagementModeStoreHandlerTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
_rootId = UUID.randomUUID();
_portEntryId = UUID.randomUUID();
_store = mock(DurableConfigurationStore.class);
_taskExecutor = new CurrentThreadTaskExecutor();
_taskExecutor.start();
_systemConfig = new JsonSystemConfigImpl(_taskExecutor, mock(EventLogger.class), null, new HashMap<String, Object>());
ConfiguredObjectRecord systemContextRecord = _systemConfig.asObjectRecord();
_root = new ConfiguredObjectRecordImpl(_rootId, Broker.class.getSimpleName(), Collections.singletonMap(Broker.NAME, (Object) "broker"), Collections.singletonMap(SystemConfig.class.getSimpleName(), systemContextRecord.getId()));
_portEntry = mock(ConfiguredObjectRecord.class);
when(_portEntry.getId()).thenReturn(_portEntryId);
when(_portEntry.getParents()).thenReturn(Collections.singletonMap(Broker.class.getSimpleName(), _root.getId()));
when(_portEntry.getType()).thenReturn(Port.class.getSimpleName());
final ArgumentCaptor<ConfiguredObjectRecordHandler> recovererArgumentCaptor = ArgumentCaptor.forClass(ConfiguredObjectRecordHandler.class);
doAnswer(new Answer() {
@Override
public Object answer(final InvocationOnMock invocation) throws Throwable {
ConfiguredObjectRecordHandler recoverer = recovererArgumentCaptor.getValue();
recoverer.handle(_root);
recoverer.handle(_portEntry);
return false;
}
}).when(_store).openConfigurationStore(recovererArgumentCaptor.capture());
_systemConfigAttributes = new HashMap<>();
_handler = new ManagementModeStoreHandler(_store, _systemConfig);
;
_handler.init(_systemConfig);
}
use of org.apache.qpid.server.store.ConfiguredObjectRecordImpl 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;
}
Aggregations