Package org.apache.qpid.server.configuration

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


            }
        }
        Set<UUID> childrenIds = entry.getChildrenIds();
        for (UUID uuid : childrenIds)
        {
            ConfigurationEntry child = _store.getEntry(uuid);
            ConfigurationEntry result = findObjectByName(child, objectName);
            if (result != null)
            {
                return result;
            }
        }
View Full Code Here


        return null;
    }

    private void addObjectConfiguration(UUID id, String type, Map<String, Object> attributes)
    {
        ConfigurationEntry entry = new ConfigurationEntry(id, type, attributes, Collections.<UUID> emptySet(), _store);
        ConfigurationEntry root = _store.getRootEntry();

        Map<String, Collection<ConfigurationEntry>> children = root.getChildren();

        verifyChildWithNameDoesNotExist(id, type, attributes, children);

        Set<UUID> childrenIds = new HashSet<UUID>(root.getChildrenIds());
        childrenIds.add(id);
        ConfigurationEntry newRoot = new ConfigurationEntry(root.getId(), root.getType(), root.getAttributes(), childrenIds,
                _store);
        _store.save(newRoot, entry);
    }
View Full Code Here

    private boolean setObjectAttribute(ConfigurationEntry entry, String attributeName, Object value)
    {
        Map<String, Object> attributes = new HashMap<String, Object>(entry.getAttributes());
        attributes.put(attributeName, value);
        ConfigurationEntry newEntry = new ConfigurationEntry(entry.getId(), entry.getType(), attributes, entry.getChildrenIds(),
                _store);
        _store.save(newEntry);
        return true;
    }
View Full Code Here

        _saved = saved;
    }

    public void addPreferencesProviderConfiguration(String authenticationProvider, Map<String, Object> attributes)
    {
        ConfigurationEntry pp = new ConfigurationEntry(UUIDGenerator.generateRandomUUID(),
                PreferencesProvider.class.getSimpleName(), attributes, Collections.<UUID> emptySet(), _store);
        ConfigurationEntry ap = findObjectByName(authenticationProvider);
        Set<UUID> children = new HashSet<UUID>();
        children.addAll(ap.getChildrenIds());
        children.add(pp.getId());
        ConfigurationEntry newAp = new ConfigurationEntry(ap.getId(), ap.getType(), ap.getAttributes(), children, _store);
        _store.save(newAp, pp);
    }
View Full Code Here

                {
                    if (entry.hasChild(uuid))
                    {
                        Set<UUID> children = new HashSet<UUID>(entry.getChildrenIds());
                        children.remove(uuid);
                        ConfigurationEntry referal = new ConfigurationEntry(entry.getId(), entry.getType(),
                                entry.getAttributes(), children, this);
                        _entries.put(entry.getId(), referal);
                    }
                }
                removedIds.add(uuid);
View Full Code Here

    protected boolean replaceEntries(ConfigurationEntry... entries)
    {
        boolean anySaved = false;
        for (ConfigurationEntry entry : entries)
        {
            ConfigurationEntry oldEntry = _entries.put(entry.getId(), entry);
            if (!entry.equals(oldEntry))
            {
                anySaved = true;
            }
        }
View Full Code Here

            {
                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);
        }
View Full Code Here

        }
    }

    protected void copyEntry(UUID entryId, ConfigurationEntryStore initialStore, Map<UUID,ConfigurationEntry> entries)
    {
        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);
            ConfigurationEntry copy = new ConfigurationEntry(entryId, entry.getType(), new HashMap<String, Object>(entry.getAttributes()), childrenCopy, this);
            entries.put(entryId, copy);
            if (children != null)
            {
                for (UUID uuid : children)
                {
View Full Code Here

        try
        {
            byte[] bytes = json.getBytes("UTF-8");
            bais = new ByteArrayInputStream(bytes);
            JsonNode node = loadJsonNodes(bais, _objectMapper);
            ConfigurationEntry brokerEntry = toEntry(node, Broker.class, _entries);
            _rootId = brokerEntry.getId();
        }
        catch(Exception e)
        {
            throw new IllegalConfigurationException("Cannot create store from json:" + json);
        }
View Full Code Here

        }
    }

    private void createRootEntry()
    {
        ConfigurationEntry brokerEntry = new ConfigurationEntry(UUIDGenerator.generateRandomUUID(),
                Broker.class.getSimpleName(), Collections.<String, Object> emptyMap(), Collections.<UUID> emptySet(), this);
        _rootId = brokerEntry.getId();
        _entries.put(_rootId, brokerEntry);
    }
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.