Package org.rhq.augeas.node

Examples of org.rhq.augeas.node.AugeasNode


    public AugeasTreeReal(Augeas ag, AugeasModuleConfig moduleConfig) {
        super(ag, moduleConfig);
    }

    public AugeasNode createNode(String fullPath) throws AugeasTreeException {
        AugeasNode node = null;

        int index = fullPath.lastIndexOf(PATH_SEPARATOR);
        if (index != -1) {
            String parentPath = fullPath.substring(0, index);
            AugeasNode parentNode = getNode(parentPath);
            node = new AugeasNodeReal(parentNode, this, fullPath);
        } else
            throw new AugeasTreeException("Node cannot be created. Parent node does not exist.");

        node.setValue(get(fullPath));
View Full Code Here


    }

    public static Configuration componentToConfiguration(PluginContainer container, Components component, String key,
        AugeasTree tree) throws UnitTestException {
        ConfigurationDefinition def = getConfigurationDefinition(container, component);
        AugeasNode node = AugeasNodeSearch.findNodeById(tree.getRootNode(), key);
        ApacheAugeasMapping map = new ApacheAugeasMapping(tree);
        Configuration config = map.updateConfiguration(node, def);
        return config;
    }
View Full Code Here

    }

    public void updateAugeas(AugeasProxy component, Configuration config, ConfigurationDefinition configDef)
        throws AugeasRhqException {
        AugeasTree tree = component.getAugeasTree(moduleName, true);
        AugeasNode startNode = getStartNode(tree);
        configurationToAugeas.updateResourceConfiguration(startNode, configDef, config);
    }
View Full Code Here

    }

    public Configuration updateConfiguration(AugeasProxy augeasComponent, ConfigurationDefinition configDef)
        throws AugeasRhqException {
        AugeasTree tree = augeasComponent.getAugeasTree(moduleName, true);
        AugeasNode startNode = getStartNode(tree);
        return augeasToConfiguration.loadResourceConfiguration(startNode, configDef);
    }
View Full Code Here

            map = (PropertyMap) mp.get(propDefMap.getName());
        }

        List<AugeasNode> nodes = tree.matchRelative(mapNode, propDefMap.getName());

        AugeasNode node;
        int i;
        if (nodes.isEmpty() || nodes.size() < seq) {
            node = tree.createNode(mapNode, propDefMap.getName(), null, seq);
            nodes.add(node);
            i = ((seq == 0) ? 0 : seq - 1);
View Full Code Here

            PropertyMap map = (PropertyMap) prop;
            listProperty = (PropertyList) map.get(propDef.getName());
        }

        List<AugeasNode> nodes = tree.matchRelative(listNode, propDef.getName());
        AugeasNode node;

        if (nodes.isEmpty() || nodes.size() < seq) {
            node = tree.createNode(listNode, propDef.getName(), null, seq);
            nodes.add(node);
        } else
View Full Code Here

    public void updateSimple(AugeasNode parentNode, PropertyDefinitionSimple propDef, Property prop, int seq)
        throws AugeasRhqException {

        PropertySimple simpleProp = null;
        AugeasNode node;
        if (prop instanceof PropertyList) {
            PropertyList lst = (PropertyList) prop;
            List<Property> props = lst.getList();
            simpleProp = (PropertySimple) props.get(seq - 1);
        }

        if (prop instanceof PropertyMap) {
            PropertyMap map = (PropertyMap) prop;
            simpleProp = (PropertySimple) map.get(propDef.getName());
        }

        List<AugeasNode> nodes = tree.matchRelative(parentNode, propDef.getName());

        if (nodes.isEmpty()) {
            node = tree.createNode(parentNode, propDef.getName(), null, 1);
        } else
            node = nodes.get(0);

        node.setValue(simpleProp.getStringValue());

    }
View Full Code Here

TOP

Related Classes of org.rhq.augeas.node.AugeasNode

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.