Package org.apache.qpid.server.configuration

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


                             String type)
    {
        ConfiguredObjectRecoverer<?> recoverer = recovererProvider.getRecoverer(type);
        if (recoverer == null)
        {
            throw new IllegalConfigurationException("Cannot recover entry for the type '" + type + "' from broker");
        }
        Collection<ConfigurationEntry> entries = childEntries.get(type);
        for (ConfigurationEntry childEntry : entries)
        {
            ConfiguredObject object = recoverer.create(recovererProvider, childEntry, broker);
            if (object == null)
            {
                throw new IllegalConfigurationException("Cannot create configured object for the entry " + childEntry);
            }
            broker.recoverChild(object);
            object.addChangeListener(storeChangeListener);
        }
    }
View Full Code Here


        if(convertedAttributes.containsKey(JMXManagement.NAME))
        {
            String newName = (String) convertedAttributes.get(JMXManagement.NAME);
            if(!getName().equals(newName))
            {
                throw new IllegalConfigurationException("Changing the name of jmx management plugin is not allowed");
            }
        }
    }
View Full Code Here

        if(changedValues.containsKey(TrustStore.NAME))
        {
            String newName = (String) changedValues.get(TrustStore.NAME);
            if(!getName().equals(newName))
            {
                throw new IllegalConfigurationException("Changing the trust store name is not allowed");
            }
        }

        Map<String, Object> merged = generateEffectiveAttributes(changedValues);
View Full Code Here

        {
            SSLUtil.getInitializedKeyStore(trustStorePath, password, type);
        }
        catch (Exception e)
        {
            throw new IllegalConfigurationException("Cannot instantiate trust store at " + trustStorePath, e);
        }

        try
        {
            TrustManagerFactory.getInstance(trustManagerFactoryAlgorithm);
        }
        catch (NoSuchAlgorithmException e)
        {
            throw new IllegalConfigurationException("Unknown trustManagerFactoryAlgorithm: " + trustManagerFactoryAlgorithm);
        }
    }
View Full Code Here

        FileSystemPreferencesStore newStore = null;
        if (!effectivePath.equals(currentPath))
        {
            if (!storeFile.exists())
            {
                throw new IllegalConfigurationException("Path to preferences file does not exist!");
            }
            newStore = new FileSystemPreferencesStore(storeFile);
            newStore.open();
        }
View Full Code Here

        String newName = (String) attributes.get(NAME);
        String currentName = getName();
        if (!currentName.equals(newName))
        {
            throw new IllegalConfigurationException("Changing the name of preferences provider is not supported");
        }
        String newType = (String) attributes.get(TYPE);
        String currentType = (String) getAttribute(TYPE);
        if (!currentType.equals(newType))
        {
            throw new IllegalConfigurationException("Changing the type of preferences provider is not supported");
        }
        String path = (String) attributes.get(PATH);
        if (path == null || path.equals("") || !(path instanceof String))
        {
            throw new IllegalConfigurationException("Path to preferences file is not specified");
        }
    }
View Full Code Here

            if (!_storeFile.exists())
            {
                File parent = _storeFile.getParentFile();
                if (!parent.exists() && !parent.mkdirs())
                {
                    throw new IllegalConfigurationException("Cannot create preferences store folders");
                }
                try
                {
                    if (_storeFile.createNewFile() && !_storeFile.exists())
                    {
                        throw new IllegalConfigurationException("Preferences store file was not created:" + _storeFile.getAbsolutePath());
                    }
                }
                catch (IOException e)
                {
                    throw new IllegalConfigurationException("Cannot create preferences store file");
                }
            }
        }
View Full Code Here

        public void open()
        {
            if (!_storeFile.exists())
            {
                throw new IllegalConfigurationException("Preferences file does not exist");
            }

            if (_storeLock != null)
            {
                throw new IllegalStateException("Preferences store is already opened");
            }
            try
            {
                _storeRAF = new RandomAccessFile(_storeFile, "rw");
                FileChannel fileChannel = _storeRAF.getChannel();
                try
                {
                    _storeLock = fileChannel.tryLock();
                }
                catch (OverlappingFileLockException e)
                {
                    _storeLock = null;
                }
                if (_storeLock == null)
                {
                    throw new IllegalConfigurationException("Cannot get lock on store file " + _storeFile.getName()
                            + " is another instance running?");
                }
                long fileSize = fileChannel.size();
                if (fileSize > 0)
                {
                    ByteBuffer buffer = ByteBuffer.allocate((int) fileSize);
                    fileChannel.read(buffer);
                    buffer.rewind();
                    buffer.flip();
                    byte[] data = buffer.array();
                    try
                    {
                        Map<String, Map<String, Object>> preferencesMap = _objectMapper.readValue(data,
                                new TypeReference<Map<String, Map<String, Object>>>()
                                {
                                });
                        _preferences.putAll(preferencesMap);
                    }
                    catch (JsonProcessingException e)
                    {
                        throw new IllegalConfigurationException("Cannot parse preferences json in " + _storeFile.getName(), e);
                    }
                }
            }
            catch (IOException e)
            {
                throw new IllegalConfigurationException("Cannot load preferences from " + _storeFile.getName(), e);
            }
        }
View Full Code Here

                    channel.truncate(baos.size());
                }
            }
            catch (IOException e)
            {
                throw new IllegalConfigurationException("Cannot store preferences", e);
            }
        }
View Full Code Here

            {
                queueFlowControlResumeSize = (Long)getAttribute(QUEUE_FLOW_RESUME_SIZE_BYTES);
            }
            if (queueFlowControlResumeSize > queueFlowControlSize)
            {
                throw new IllegalConfigurationException("Flow resume size can't be greater than flow control size");
            }
        }
        for (Map.Entry<String, Object> entry: convertedAttributes.entrySet())
        {
            Object value = entry.getValue();
            if (value instanceof Number && ((Number)value).longValue() < 0)
            {
                throw new IllegalConfigurationException("Only positive integer value can be specified for the attribute "
                        + entry.getKey());
            }
        }
    }
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.