Examples of AugeasNode


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

Examples of org.rhq.augeas.node.AugeasNode

    }

    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

Examples of org.rhq.augeas.node.AugeasNode

    }

    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

Examples of org.rhq.plugins.augeas.helper.AugeasNode

    @Override
    protected String getResourceConfigurationRootPath() {
        Configuration pluginConfig = getResourceContext().getPluginConfiguration();
        String targetName = pluginConfig.getSimple(TARGET_NAME_PROP).getStringValue();
        String targetPath = "/files/etc/samba/smb.conf/target[.='" + targetName + "']";
        AugeasNode targetNode = new AugeasNode(targetPath);
        Augeas augeas = getAugeas();

        List<String> matches = augeas.match(targetNode.getPath());
        return matches.get(0);
    }
View Full Code Here

Examples of org.rhq.plugins.augeas.helper.AugeasNode

*/
public class PostfixAccessComponent extends AugeasConfigurationComponent {
    @Override
    protected AugeasNode getNewListMemberNode(AugeasNode listNode, PropertyDefinitionMap listMemberPropDefMap,
        int listIndex) {
        AugeasNode node = new AugeasNode(listNode, "0" + listIndex);
        return node;
    }
View Full Code Here

Examples of org.rhq.plugins.augeas.helper.AugeasNode

        if (namePaths == null || namePaths.isEmpty()) {
            return null;
        }

        AugeasNode node = new AugeasNode(namePaths.get(0));
        return node.getParent();
    }
View Full Code Here

Examples of org.rhq.plugins.augeas.helper.AugeasNode

        String specFilter = parentNode.getPath() + "/spec";
        List<String> userPaths = augeas.match(String.format(specFilter + "/user[.='%s']", userName));
        if (userPaths == null || userPaths.isEmpty()) {
            return null;
        }
        AugeasNode node = new AugeasNode(userPaths.get(0));
        return node.getParent();
    }
View Full Code Here

Examples of org.rhq.plugins.augeas.helper.AugeasNode

      return super.createResource(report);
    }

    @Override
    protected AugeasNode getNewListMemberNode(AugeasNode listNode, PropertyDefinitionMap listMemberPropDefMap, int listIndex) {
        AugeasNode node = new AugeasNode(listNode, "0" + listIndex);
        return node;
    }
View Full Code Here

Examples of org.rhq.plugins.augeas.helper.AugeasNode

        if (namePaths == null || namePaths.isEmpty()) {
            return null;
        }

        AugeasNode node = new AugeasNode(namePaths.get(0));
        return node.getParent();
    }
View Full Code Here

Examples of org.rhq.plugins.augeas.helper.AugeasNode

        // First insert the root node corresponding to the new child Resource.
        String rootPath = getChildResourceConfigurationRootPath(report.getResourceType(),
            report.getResourceConfiguration());
        initAugeas();
        try {
            AugeasNode rootNode = new AugeasNode(rootPath);
            if (this.augeas.exists(rootNode.getPath())) {
                report.setStatus(CreateResourceStatus.FAILURE);
                report.setErrorMessage("An Augeas node already exists with path " + rootPath);
                return report;
            }
            String rootLabel = getChildResourceConfigurationRootLabel(report.getResourceType(),
                report.getResourceConfiguration());
            this.augeas.set(rootNode.getPath(), rootLabel);

            // Then set all its child nodes.
            Collection<PropertyDefinition> propDefs = resourceConfigDef.getPropertyDefinitions().values();
            for (PropertyDefinition propDef : propDefs) {
                setNode(propDef, resourceConfig, this.augeas, rootNode);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.