Package org.apache.qpid.server.configuration

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


        assertTrue("Unexpected provider children found", storeEntry.getChildrenIds().isEmpty());
    }

    public void testSaveExistingAuthenticationProvider()
    {
        ConfigurationEntry providerEntry = _store.getEntry(_authenticationProviderId);
        assertNotNull("provider configuration is not found", providerEntry);

        Map<String, Object> authenticationProviderAttributes = new HashMap<String, Object>();
        authenticationProviderAttributes.put(AuthenticationProvider.NAME, "authenticationProvider1");
        authenticationProviderAttributes.put(AuthenticationManagerFactory.ATTRIBUTE_TYPE, ExternalAuthenticationManager.class.getSimpleName());
        ConfigurationEntry updatedEntry = new ConfigurationEntry(_authenticationProviderId, AuthenticationProvider.class.getSimpleName(),
                authenticationProviderAttributes, Collections.<UUID> emptySet(), _store);
        _store.save(updatedEntry);

        ConfigurationEntry storeEntry = _store.getEntry(_authenticationProviderId);
        assertEquals("Unexpected provider configuration", updatedEntry, storeEntry);
        assertEquals("Unexpected type", AuthenticationProvider.class.getSimpleName(), storeEntry.getType());
        assertEquals("Unexpected provider attributes", updatedEntry.getAttributes(), storeEntry.getAttributes());
        assertTrue("Unexpected provider children found", storeEntry.getChildrenIds().isEmpty());
    }
View Full Code Here


        assertEquals(Collections.singleton(plugin), new HashSet<ConfiguredObject>(broker.getChildren(Plugin.class)));
    }

    public void testCreateBrokerWithKeyStores()
    {
        ConfigurationEntry pluginEntry = mock(ConfigurationEntry.class);
        KeyStore keyStore = mock(KeyStore.class);
        _brokerEntryChildren.put(KeyStore.class.getSimpleName(), Arrays.asList(pluginEntry));

        RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{pluginEntry, _authenticationProviderEntry1},
                                                                     new ConfiguredObject[]{keyStore, _authenticationProvider1});
View Full Code Here

        assertEquals(Collections.singleton(keyStore), new HashSet<ConfiguredObject>(broker.getChildren(KeyStore.class)));
    }

    public void testCreateBrokerWithTrustStores()
    {
        ConfigurationEntry pluginEntry = mock(ConfigurationEntry.class);
        TrustStore trustStore = mock(TrustStore.class);
        _brokerEntryChildren.put(TrustStore.class.getSimpleName(), Arrays.asList(pluginEntry));

        RecovererProvider recovererProvider = createRecoveryProvider(new ConfigurationEntry[]{pluginEntry, _authenticationProviderEntry1},
                                                                     new ConfiguredObject[]{trustStore, _authenticationProvider1});
View Full Code Here

                    @Override
                    public ConfiguredObject create(RecovererProvider recovererProvider, ConfigurationEntry entry, ConfiguredObject... parents)
                    {
                        for (int i = 0; i < entries.length; i++)
                        {
                            ConfigurationEntry e = entries[i];
                            if (entry == e)
                            {
                                return objectsToRecoverer[i];
                            }
                        }
View Full Code Here

        attributes.put(TrustStore.PASSWORD, "my-secret-password");
        attributes.put(TrustStore.TYPE, "NON-JKS");
        attributes.put(TrustStore.TRUST_MANAGER_FACTORY_ALGORITHM, "NON-STANDARD");
        attributes.put(TrustStore.DESCRIPTION, "Description");

        ConfigurationEntry trustStoreEntry = new ConfigurationEntry(trustStoreId, TrustStore.class.getSimpleName(), attributes,
                Collections.<UUID> emptySet(), _store);

        _store.save(trustStoreEntry);

        ConfigurationEntry storeEntry = _store.getEntry(trustStoreId);
        assertEquals("Unexpected trust store configuration", trustStoreEntry, storeEntry);
        assertEquals("Unexpected type", TrustStore.class.getSimpleName(), storeEntry.getType());
        assertEquals("Unexpected provider attributes", trustStoreEntry.getAttributes(), storeEntry.getAttributes());
        assertTrue("Unexpected provider children found", storeEntry.getChildrenIds().isEmpty());
    }
View Full Code Here

        attributes.put(KeyStore.TYPE, "NON-JKS");
        attributes.put(KeyStore.KEY_MANAGER_FACTORY_ALGORITHM, "NON-STANDARD");
        attributes.put(KeyStore.DESCRIPTION, "Description");
        attributes.put(KeyStore.CERTIFICATE_ALIAS, "Alias");

        ConfigurationEntry keyStoreEntry = new ConfigurationEntry(keyStoreId, KeyStore.class.getSimpleName(), attributes, Collections.<UUID> emptySet(),
                _store);

        _store.save(keyStoreEntry);

        ConfigurationEntry storeEntry = _store.getEntry(keyStoreId);
        assertEquals("Unexpected key store configuration", keyStoreEntry, storeEntry);
        assertEquals("Unexpected type", KeyStore.class.getSimpleName(), storeEntry.getType());
        assertEquals("Unexpected provider attributes", keyStoreEntry.getAttributes(), storeEntry.getAttributes());
        assertTrue("Unexpected provider children found", storeEntry.getChildrenIds().isEmpty());
    }
View Full Code Here

    {
        UUID groupProviderId = UUID.randomUUID();
        Map<String, Object> attributes = new HashMap<String, Object>();
        attributes.put(GroupProvider.NAME, getName());

        ConfigurationEntry groupProviderEntry = new ConfigurationEntry(groupProviderId, GroupProvider.class.getSimpleName(), attributes,
                Collections.<UUID> emptySet(), _store);

        _store.save(groupProviderEntry);

        ConfigurationEntry storeEntry = _store.getEntry(groupProviderId);
        assertEquals("Unexpected group provider configuration", groupProviderEntry, storeEntry);
        assertEquals("Unexpected type", GroupProvider.class.getSimpleName(), storeEntry.getType());
        assertEquals("Unexpected group provider attributes", groupProviderEntry.getAttributes(), storeEntry.getAttributes());
        assertTrue("Unexpected provider children found", storeEntry.getChildrenIds().isEmpty());
    }
View Full Code Here

        attributes.put(Port.RECEIVE_BUFFER_SIZE, 1);
        attributes.put(Port.SEND_BUFFER_SIZE, 2);
        attributes.put(Port.NEED_CLIENT_AUTH, true);
        attributes.put(Port.WANT_CLIENT_AUTH, true);

        ConfigurationEntry portEntry = new ConfigurationEntry(portId, Port.class.getSimpleName(), attributes, Collections.<UUID> emptySet(), _store);

        _store.save(portEntry);

        ConfigurationEntry storeEntry = _store.getEntry(portId);
        assertEquals("Unexpected port configuration", portEntry, storeEntry);
        assertEquals("Unexpected type", Port.class.getSimpleName(), storeEntry.getType());
        assertEquals("Unexpected port attributes", portEntry.getAttributes(), storeEntry.getAttributes());
        assertTrue("Unexpected port children found", storeEntry.getChildrenIds().isEmpty());
    }
View Full Code Here

    {
        UUID virtualHostId = UUID.randomUUID();
        Map<String, Object> virtualHostAttributes = new HashMap<String, Object>();
        virtualHostAttributes.put(VirtualHost.NAME, "test1");
        virtualHostAttributes.put(VirtualHost.CONFIG_PATH, "/path/to/phantom/virtualhost/config1");
        ConfigurationEntry hostEntry = new ConfigurationEntry(virtualHostId, VirtualHost.class.getSimpleName(), virtualHostAttributes,
                Collections.<UUID> emptySet(), _store);

        UUID keyStoreId = UUID.randomUUID();
        Map<String, Object> attributes = new HashMap<String, Object>();
        attributes.put(KeyStore.NAME, getName());
        attributes.put(KeyStore.PATH, "/path/to/truststore");
        attributes.put(KeyStore.PASSWORD, "my-secret-password");
        attributes.put(KeyStore.TYPE, "NON-JKS");
        attributes.put(KeyStore.KEY_MANAGER_FACTORY_ALGORITHM, "NON-STANDARD");
        attributes.put(KeyStore.DESCRIPTION, "Description");
        attributes.put(KeyStore.CERTIFICATE_ALIAS, "Alias");

        ConfigurationEntry keyStoreEntry = new ConfigurationEntry(keyStoreId, KeyStore.class.getSimpleName(), attributes, Collections.<UUID> emptySet(),
                _store);

        _store.save(hostEntry, keyStoreEntry);

        assertNotNull("Virtual host is not found", _store.getEntry(virtualHostId));
View Full Code Here

        addPreferencesProvider(preferencesProviderId, name, path);

        assertEquals("Unexpected preference provider ID in authentication provider children set", preferencesProviderId, _store
                .getEntry(_authenticationProviderId).getChildrenIds().iterator().next());
        ConfigurationEntry preferencesProviderEntry = _store.getEntry(preferencesProviderId);
        assertNotNull("Preferences providert is not found", preferencesProviderEntry);
        assertEquals("Unexpected preferences providert id", preferencesProviderId, preferencesProviderEntry.getId());
        Map<String, Object> attributes = preferencesProviderEntry.getAttributes();
        assertEquals("Unexpected preferences provider name", name, attributes.get(PreferencesProvider.NAME));
        assertEquals("Unexpected preferences provider path", path, attributes.get(FileSystemPreferencesProvider.PATH));
        assertEquals("Unexpected preferences provider type", FileSystemPreferencesProvider.PROVIDER_TYPE,
                attributes.get(PreferencesProvider.TYPE));
    }
View Full Code Here

TOP

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

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.