Examples of AugeasRhqException


Examples of org.rhq.rhqtransform.AugeasRhqException

        ApacheAugeasTree tree = new ApacheAugeasTree(apacheConfig.getServerRootPath(), component.getAugeas(), module);

        List<String> incld = module.getConfigFiles();

        if (incld.isEmpty())
            throw new AugeasRhqException("No configuration provided.");

        String rootPath = incld.get(0);

        AugeasNode rootNode = new ApacheAugeasNode(ApacheAugeasTree.AUGEAS_DATA_PATH + rootPath, tree);
        tree.setRootNode(rootNode);
View Full Code Here

Examples of org.rhq.rhqtransform.AugeasRhqException

*/
public class MappingToAugeasDirectiveToSimple extends ConfigurationToAugeasApacheBase {

    public void updateList(PropertyDefinitionList propDef, Property prop, AugeasNode listNode, int seq)
        throws AugeasRhqException {
        throw new AugeasRhqException("Error in configuration. There can not be any ListProperty in simple directive.");

    }
View Full Code Here

Examples of org.rhq.rhqtransform.AugeasRhqException

    }

    public void updateMap(PropertyDefinitionMap propDefMap, Property prop, AugeasNode mapNode, int seq)
        throws AugeasRhqException {
        throw new AugeasRhqException("Error in configuration.  There can not be any MapProperty in simple directive.");
    }
View Full Code Here

Examples of org.rhq.rhqtransform.AugeasRhqException

                return;
            }

            //NODE IS PRESENT IN AUGEAS AND IN CONFIGURATION AND WILL BE UPDATED
            if (nodes.size() > 1)
                throw new AugeasRhqException("Error in configuration. Directive" + propName
                    + " is declared multiple times.");

            List<AugeasNode> params = nodes.get(0).getChildByLabel("param");

            if (params.isEmpty())
                throw new AugeasRhqException("Error in configuration. Directive" + propName + " has no value.");

            if (params.size() > 1)
                throw new AugeasRhqException("Too many parameters in directive" + propName + " .");

            AugeasNode node = params.get(0);
            node.setValue(propertyValue);

        } catch (Exception e) {
            throw new AugeasRhqException("Mapping configuration to Augeas failed. " + e.getMessage());
        }
    }
View Full Code Here

Examples of org.rhq.rhqtransform.AugeasRhqException

        String propertyName = propDef.getName();

        List<AugeasNode> simpleNode = parentNode.getChildByLabel(propertyName);

        if (simpleNode.size() > 1) {
            throw new AugeasRhqException("Found multiple values for a simple property " + propertyName);
        }

        if (simpleNode.isEmpty()) {
            return new PropertySimple(propertyName, null);
        } else {
View Full Code Here

Examples of org.rhq.rhqtransform.AugeasRhqException

        super(path, configuration);

        serverRootPath = configuration.getSimpleValue(ApacheServerComponent.PLUGIN_CONFIG_PROP_SERVER_ROOT, null);

        if (modules.isEmpty())
            throw new AugeasRhqException("There is not configuration for this resource.");
        try {
            module = modules.get(0);

            List<String> foundIncludes = new ArrayList<String>();
            loadIncludes(module.getIncludedGlobs().get(0), foundIncludes);

            allConfigFiles = getIncludeFiles(serverRootPath, foundIncludes);
        } catch (Exception e) {
            throw new AugeasRhqException(e);
        }
    }
View Full Code Here

Examples of org.rhq.rhqtransform.AugeasRhqException

    public PluginDescriptorBasedAugeasConfiguration(String path,Configuration pluginConfiguration) throws AugeasRhqException {
        List<String> includes = determineGlobs(pluginConfiguration, INCLUDE_GLOBS_PROP);
        List<String> excludes = determineGlobs(pluginConfiguration, EXCLUDE_GLOBS_PROP);
        modules = new ArrayList<AugeasModuleConfig>();
        if (includes.isEmpty())
            throw new AugeasRhqException("At least one Include glob must be defined.");
             
        try {
          loadPath = pluginConfiguration.getSimpleValue(AUGEAS_LOAD_PATH, "");
           if (loadPath.equals("")){
             loadPath = path;
             }
      
        AugeasModuleConfig config = new AugeasModuleConfig();
          config.setIncludedGlobs(includes);
          config.setExcludedGlobs(excludes);         
          config.setLensPath(getAugeasModuleName(pluginConfiguration) + ".lns");
          config.setModuletName(getAugeasModuleName(pluginConfiguration));
        modules.add(config);
       
        }catch(Exception e){
          log.error("Creation of temporary Directory for augeas lens failed.");
          throw new AugeasRhqException("Creation of temporary Directory for augeas lens failed.",e);
        }
    }
View Full Code Here

Examples of org.rhq.rhqtransform.AugeasRhqException

        }
    }

    public Configuration updateConfiguration(Configuration configuration) throws AugeasRhqException {
        if (modules.isEmpty())
            throw new AugeasRhqException("Error in augeas Configuration.");
        AugeasModuleConfig tempModule = modules.get(0);

        PropertySimple includeProps = getGlobList(INCLUDE_GLOBS_PROP, tempModule.getIncludedGlobs());
        PropertySimple excludeProps = getGlobList(EXCLUDE_GLOBS_PROP, tempModule.getExcludedGlobs());
        configuration.put(includeProps);
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.