Package org.apache.qpid.server.configuration

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


    public MemoryConfigurationEntryStore(String initialStoreLocation, ConfigurationEntryStore initialStore, Map<String, String> configProperties)
    {
        this(configProperties);
        if (initialStore == null && (initialStoreLocation == null || "".equals(initialStoreLocation) ))
        {
            throw new IllegalConfigurationException("Cannot instantiate the memory broker store as neither initial store nor initial store location is provided");
        }

        if (initialStore != null)
        {
            if (initialStore instanceof MemoryConfigurationEntryStore)
View Full Code Here


        List<UUID> removedIds = new ArrayList<UUID>();
        for (UUID uuid : entryIds)
        {
            if (_rootId.equals(uuid))
            {
                throw new IllegalConfigurationException("Cannot remove root entry");
            }
        }
        for (UUID uuid : entryIds)
        {
            if (removeInternal(uuid))
View Full Code Here

        {
            mapper.writeValue(file, tree);
        }
        catch (JsonGenerationException e)
        {
            throw new IllegalConfigurationException("Cannot generate json!", e);
        }
        catch (JsonMappingException e)
        {
            throw new IllegalConfigurationException("Cannot map objects for json serialization!", e);
        }
        catch (IOException e)
        {
            throw new IllegalConfigurationException("Cannot save configuration into " + file + "!", e);
        }
    }
View Full Code Here

            int storeVersion = 0;
            JsonNode storeVersionNode = node.get(Broker.STORE_VERSION);
            if (storeVersionNode == null || storeVersionNode.isNull())
            {
                throw new IllegalConfigurationException("Broker " + Broker.STORE_VERSION + " attribute must be specified");
            }
            else
            {
                storeVersion = storeVersionNode.getIntValue();
            }

            if (storeVersion != STORE_VERSION)
            {
                throw new IllegalConfigurationException("The data of version " + storeVersion
                        + " can not be loaded by store of version " + STORE_VERSION);
            }

            ConfigurationEntry brokerEntry = toEntry(node, Broker.class, _entries);
            _rootId = brokerEntry.getId();
        }
        catch (IOException e)
        {
           throw new IllegalConfigurationException("Cannot load store from: " + url, e);
        }
        finally
        {
            if (is != null)
            {
                if (is != null)
                {
                    try
                    {
                        is.close();
                    }
                    catch (IOException e)
                    {
                        throw new IllegalConfigurationException("Cannot close input stream for: " + url, e);
                    }
                }
            }
        }
    }
View Full Code Here

        File parent = file.getParentFile();
        if (!parent.exists())
        {
            if (!parent.mkdirs())
            {
                throw new IllegalConfigurationException("Cannot create folders " + parent);
            }
        }
        try
        {
            file.createNewFile();
        }
        catch (IOException e)
        {
            throw new IllegalConfigurationException("Cannot create file " + file, e);
        }
    }
View Full Code Here

        ConfigurationEntry entry = initialStore.getEntry(entryId);
        if (entry != null)
        {
            if (entries.containsKey(entryId))
            {
                throw new IllegalConfigurationException("Duplicate id is found: " + entryId
                        + "! The following configuration entries have the same id: " + entries.get(entryId) + ", " + entry);
            }

            Set<UUID> children = entry.getChildrenIds();
            Set<UUID> childrenCopy = children == null? null : new HashSet<UUID>(children);
View Full Code Here

            ConfigurationEntry brokerEntry = toEntry(node, Broker.class, _entries);
            _rootId = brokerEntry.getId();
        }
        catch(Exception e)
        {
            throw new IllegalConfigurationException("Cannot create store from json:" + json);
        }
        finally
        {
            if (bais != null)
            {
View Full Code Here

    private Map<String, Object> toTree(UUID rootId, Map<UUID, ConfigurationEntry> entries)
    {
        ConfigurationEntry entry = entries.get(rootId);
        if (entry == null || !entry.getId().equals(rootId))
        {
            throw new IllegalConfigurationException("Cannot find entry with id " + rootId + "!");
        }
        Map<String, Object> tree = new TreeMap<String, Object>();
        Map<String, Object> attributes = entry.getAttributes();
        if (attributes != null)
        {
View Full Code Here

        {
            root = mapper.readTree(is);
        }
        catch (JsonProcessingException e)
        {
            throw new IllegalConfigurationException("Cannot parse json", e);
        }
        catch (IOException e)
        {
            throw new IllegalConfigurationException("Cannot read json", e);
        }
        return root;
    }
View Full Code Here

        if (type == null)
        {
            if (expectedConfiguredObjectClass == null)
            {
                throw new IllegalConfigurationException("Type attribute is not provided for configuration entry " + parent);
            }
            else
            {
                type = expectedConfiguredObjectClass.getSimpleName();
            }
        }
        String name = null;
        if (attributes != null)
        {
            name = (String) attributes.get(ATTRIBUTE_NAME);
        }
        if ((name == null || "".equals(name)))
        {
            if (expectedConfiguredObjectClass == Broker.class)
            {
                name = DEFAULT_BROKER_NAME;
            }
            else
            {
                throw new IllegalConfigurationException("Name attribute is not provided for configuration entry " + parent);
            }
        }
        UUID id = null;
        if (idAsString == null)
        {
            id = UUIDGenerator.generateRandomUUID();

            _generatedObjectIdDuringLoad = true;
        }
        else
        {
            try
            {
                id = UUID.fromString(idAsString);
            }
            catch (Exception e)
            {
                throw new IllegalConfigurationException(
                        "ID attribute value does not conform to UUID format for configuration entry " + parent);
            }
        }
        ConfigurationEntry entry = new ConfigurationEntry(id, type, attributes, childrenIds, this);
        if (entries.containsKey(id))
        {
            throw new IllegalConfigurationException("Duplicate id is found: " + id
                    + "! The following configuration entries have the same id: " + entries.get(id) + ", " + entry);
        }
        entries.put(id, entry);
        return entry;
    }
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.