Package org.apache.qpid.server.configuration

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


        String newName = (String)attributes.get(NAME);
        String currentName = getName();
        if (!currentName.equals(newName))
        {
            throw new IllegalConfigurationException("Changing the name of authentication provider is not supported");
        }
        String newType = (String)attributes.get(AuthenticationManagerFactory.ATTRIBUTE_TYPE);
        String currentType = (String)getAttribute(AuthenticationManagerFactory.ATTRIBUTE_TYPE);
        if (!currentType.equals(newType))
        {
            throw new IllegalConfigurationException("Changing the type of authentication provider is not supported");
        }
        AuthenticationManagerFactory managerFactory = _factories.get(newType);
        if (managerFactory == null)
        {
            throw new IllegalConfigurationException("Cannot find authentication provider factory for type " + newType);
        }
        AuthenticationManager manager = managerFactory.createInstance(_broker, attributes);
        if (manager == null)
        {
            throw new IllegalConfigurationException("Cannot change authentication provider " + newName + " of type " + newType + " with the given attributes");
        }
        return manager;
    }
View Full Code Here


    public void setPreferencesProvider(PreferencesProvider provider)
    {
        if (AnonymousAuthenticationManagerFactory.PROVIDER_TYPE.equals(getAttribute(TYPE)))
        {
            throw new IllegalConfigurationException("Cannot set preferences provider for anonymous authentication provider");
        }
        _preferencesProvider = provider;
    }
View Full Code Here

        {
            UUID id = getId();
            Object idAttributeValue = attributes.get(ID);
            if (idAttributeValue != null && !idAttributeValue.equals(id.toString()))
            {
                throw new IllegalConfigurationException("Cannot change existing configured object id");
            }
        }
    }
View Full Code Here

        Collection<TrustStore> trustStores = getTrustStores();

        boolean needClientCert = (Boolean)getAttribute(NEED_CLIENT_AUTH) || (Boolean)getAttribute(WANT_CLIENT_AUTH);
        if (needClientCert && trustStores.isEmpty())
        {
            throw new IllegalConfigurationException("Client certificate authentication is enabled on AMQP port '"
                    + this.getName() + "' but no trust store defined");
        }

        try
        {
View Full Code Here

    public DurableConfigurationStore createMessageStore(String storeType)
    {
        DurableConfigurationStoreFactory factory = _factories.get(storeType.toLowerCase());
        if (factory == null)
        {
            throw new IllegalConfigurationException("Unknown store type: " + storeType
                                                    + ". Supported types: " + _factories.keySet());
        }
        return factory.createDurableConfigurationStore();
    }
View Full Code Here

    public MessageStore createMessageStore(String storeType)
    {
        MessageStoreFactory factory = _factories.get(storeType.toLowerCase());
        if (factory == null)
        {
            throw new IllegalConfigurationException("Unknown store type: " + storeType
                                                    + ". Supported types: " + _factories.keySet());
        }
        return factory.createMessageStore();
    }
View Full Code Here

            for(ConfigurationEntry ce : childrenOfType)
            {
                Object ceName = ce.getAttributes().get("name");
                if(name.equals(ceName) && !id.equals(ce.getId()))
                {
                    throw new IllegalConfigurationException("A " + type + " with name " + name + " already exists with a different ID");
                }
            }
        }
    }
View Full Code Here

    private void validateAttributes()
    {
        String name = getName();
        if (name == null || "".equals(name.trim()))
        {
            throw new IllegalConfigurationException("Virtual host name must be specified");
        }

        String configurationFile = (String) getAttribute(CONFIG_PATH);
        String type = (String) getAttribute(TYPE);

        boolean invalidAttributes = false;
        if (configurationFile == null)
        {
            if (type == null)
            {
                invalidAttributes = true;
            }
            else
            {
                validateAttributes(type);
            }
        }/*
        else
        {
            if (type != null)
            {
                invalidAttributes = true;
            }

        }*/
        if (invalidAttributes)
        {
            throw new IllegalConfigurationException("Please specify either the 'configPath' attribute or 'type' attributes");
        }

        // pre-load the configuration in order to validate
        try
        {
            createVirtualHostConfiguration(name);
        }
        catch(ConfigurationException e)
        {
            throw new IllegalConfigurationException("Failed to validate configuration", e);
        }
    }
View Full Code Here

        }
        else
        {
            if (!new File(configurationFile).exists())
            {
                throw new IllegalConfigurationException("Configuration file '" + configurationFile + "' does not exist");
            }
            configuration = new VirtualHostConfiguration(virtualHostName, new File(configurationFile) , _broker);
            String type = configuration.getType();
            changeAttribute(TYPE,null,type);
            VirtualHostFactory factory = VirtualHostFactory.FACTORIES.get(type);
View Full Code Here

            for(Port p : _portAdapters.values())
            {
                if(portNumber == p.getPort())
                {
                    throw new IllegalConfigurationException("Can't add port " + portName + " because port number " + portNumber + " is already configured for port " + p.getName());
                }

                if(portName == p.getName())
                {
                    throw new IllegalConfigurationException("Can't add Port because one with name " + portName + " already exists");
                }

                if(portId == p.getId())
                {
                    throw new IllegalConfigurationException("Can't add Port because one with id " + portId + " already exists");
                }
            }

            _portAdapters.put(port.getId(), port);
        }
View Full Code Here

TOP

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

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.