Package org.apache.qpid.server.configuration

Examples of org.apache.qpid.server.configuration.ConfigurationEntryStore


        {
            configureLogging(new File(options.getLogConfigFileLocation()), options.getLogWatchFrequency());
        }

        BrokerConfigurationStoreCreator storeCreator = new BrokerConfigurationStoreCreator();
        ConfigurationEntryStore store = storeCreator.createStore(storeLocation, storeType, options.getInitialConfigurationLocation(),
                                                                 options.isOverwriteConfigurationStore(), options.getConfigProperties());

        if (options.isManagementMode())
        {
            store = new ManagementModeStoreHandler(store, options);
View Full Code Here


    }

    @Override
    protected void addConfiguration(UUID id, String type, Map<String, Object> attributes, UUID parentId)
    {
        ConfigurationEntryStore store = getStore();
        ConfigurationEntry parentEntry = getStore().getEntry(parentId);
        Set<UUID> children = new HashSet<UUID>(parentEntry.getChildrenIds());
        children.add(id);
        ConfigurationEntry newParentEntry = new ConfigurationEntry(parentEntry.getId(), parentEntry.getType(), parentEntry.getAttributes(), children, store);
        store.save(newParentEntry, new ConfigurationEntry(id, type, attributes, Collections.<UUID> emptySet(), store));
    }
View Full Code Here

    public void testAttributeIsResolvedFromSystemProperties()
    {
        String defaultVhost = getTestName();
        setTestSystemProperty("my.test.property", defaultVhost);

        ConfigurationEntryStore store = getStore();
        ConfigurationEntry brokerConfigEntry = store.getRootEntry();
        Map<String, Object> attributes = new HashMap<String, Object>(brokerConfigEntry.getAttributes());
        attributes.put(Broker.DEFAULT_VIRTUAL_HOST, "${my.test.property}");
        ConfigurationEntry updatedBrokerEntry = new ConfigurationEntry(brokerConfigEntry.getId(), Broker.class.getSimpleName(),
                attributes, brokerConfigEntry.getChildrenIds(), store);
        store.save(updatedBrokerEntry);

        JsonConfigurationEntryStore store2 = new JsonConfigurationEntryStore(_storeFile.getAbsolutePath(), null, false, Collections.<String,String>emptyMap());

        assertEquals("Unresolved default virtualhost  value", defaultVhost, store2.getRootEntry().getAttributes().get(Broker.DEFAULT_VIRTUAL_HOST));
    }
View Full Code Here

    }

    @Override
    protected void addConfiguration(UUID id, String type, Map<String, Object> attributes, UUID parentId)
    {
        ConfigurationEntryStore store = getStore();
        ConfigurationEntry parentEntry = getStore().getEntry(parentId);
        Set<UUID> children = new HashSet<UUID>(parentEntry.getChildrenIds());
        children.add(id);
        ConfigurationEntry newParentEntry = new ConfigurationEntry(parentEntry.getId(), parentEntry.getType(), parentEntry.getAttributes(), children, store);
        store.save(newParentEntry, new ConfigurationEntry(id, type, attributes, Collections.<UUID> emptySet(), store));
    }
View Full Code Here

public class ConfigurationEntryTest extends TestCase
{
    public void testGetChildren()
    {
        ConfigurationEntryStore store = mock(ConfigurationEntryStore.class);

        ConfigurationEntry virtualHostEntry1 = new ConfigurationEntry(UUID.randomUUID(), VirtualHost.class.getSimpleName(),
                Collections.<String, Object> emptyMap(), Collections.<UUID> emptySet(), store);
        ConfigurationEntry virtualHostEntry2 = new ConfigurationEntry(UUID.randomUUID(), VirtualHost.class.getSimpleName(),
                Collections.<String, Object> emptyMap(), Collections.<UUID> emptySet(), store);
        ConfigurationEntry portEntry = new ConfigurationEntry(UUID.randomUUID(), Port.class.getSimpleName(),
                Collections.<String, Object> emptyMap(), Collections.<UUID> emptySet(), store);

        when(store.getEntry(virtualHostEntry1.getId())).thenReturn(virtualHostEntry1);
        when(store.getEntry(virtualHostEntry2.getId())).thenReturn(virtualHostEntry2);
        when(store.getEntry(portEntry.getId())).thenReturn(portEntry);

        Set<UUID> childrenIds = new HashSet<UUID>();
        childrenIds.add(virtualHostEntry1.getId());
        childrenIds.add(virtualHostEntry2.getId());
        childrenIds.add(portEntry.getId());
View Full Code Here

                new HashSet<ConfigurationEntry>(ports));
    }

    public void testHashCode()
    {
        ConfigurationEntryStore store = mock(ConfigurationEntryStore.class);

        UUID id = UUID.randomUUID();
        ConfigurationEntry entry1 = new ConfigurationEntry(id, VirtualHost.class.getSimpleName(),
                Collections.<String, Object> emptyMap(), Collections.singleton(UUID.randomUUID()), store);
        ConfigurationEntry entry2 = new ConfigurationEntry(id, VirtualHost.class.getSimpleName(),
View Full Code Here

        assertFalse(entry1.hashCode() == entryWithDifferentId.hashCode());
    }

    public void testEqualsObject()
    {
        ConfigurationEntryStore store = mock(ConfigurationEntryStore.class);

        UUID id = UUID.randomUUID();
        Map<String, Object> attributes1 = new HashMap<String, Object>();
        attributes1.put(VirtualHost.NAME, "name1");
        Set<UUID> childrenIds = Collections.singleton(UUID.randomUUID());
View Full Code Here

    }

    @Override
    protected void addConfiguration(UUID id, String type, Map<String, Object> attributes, UUID parentId)
    {
        ConfigurationEntryStore store = getStore();
        ConfigurationEntry parentEntry = getStore().getEntry(parentId);
        Set<UUID> children = new HashSet<UUID>(parentEntry.getChildrenIds());
        children.add(id);
        ConfigurationEntry newParentEntry = new ConfigurationEntry(parentEntry.getId(), parentEntry.getType(), parentEntry.getAttributes(), children, store);
        store.save(newParentEntry, new ConfigurationEntry(id, type, attributes, Collections.<UUID> emptySet(), store));
    }
View Full Code Here

    public void testAttributeIsResolvedFromSystemProperties()
    {
        String defaultVhost = getTestName();
        setTestSystemProperty("my.test.property", defaultVhost);

        ConfigurationEntryStore store = getStore();
        ConfigurationEntry brokerConfigEntry = store.getRootEntry();
        Map<String, Object> attributes = new HashMap<String, Object>(brokerConfigEntry.getAttributes());
        attributes.put(Broker.DEFAULT_VIRTUAL_HOST, "${my.test.property}");
        ConfigurationEntry updatedBrokerEntry = new ConfigurationEntry(brokerConfigEntry.getId(), Broker.class.getSimpleName(),
                attributes, brokerConfigEntry.getChildrenIds(), store);
        store.save(updatedBrokerEntry);

        JsonConfigurationEntryStore store2 = new JsonConfigurationEntryStore(_storeFile.getAbsolutePath(), null, false, Collections.<String,String>emptyMap());

        assertEquals("Unresolved default virtualhost  value", defaultVhost, store2.getRootEntry().getAttributes().get(Broker.DEFAULT_VIRTUAL_HOST));
    }
View Full Code Here

    }

    @Override
    protected void addConfiguration(UUID id, String type, Map<String, Object> attributes, UUID parentId)
    {
        ConfigurationEntryStore store = getStore();
        ConfigurationEntry parentEntry = getStore().getEntry(parentId);
        Set<UUID> children = new HashSet<UUID>(parentEntry.getChildrenIds());
        children.add(id);
        ConfigurationEntry newParentEntry = new ConfigurationEntry(parentEntry.getId(), parentEntry.getType(), parentEntry.getAttributes(), children, store);
        store.save(newParentEntry, new ConfigurationEntry(id, type, attributes, Collections.<UUID> emptySet(), store));
    }
View Full Code Here

TOP

Related Classes of org.apache.qpid.server.configuration.ConfigurationEntryStore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.