Examples of ApacheDirectiveTree


Examples of org.rhq.plugins.apache.parser.ApacheDirectiveTree

        ApacheDeploymentUtil.addDefaultVariables(replacements, null);

        HttpdAddressUtility addressUtility = apacheSetup.getServerComponent()
            .getAddressUtility();
        ApacheDirectiveTree runtimeConfig = apacheSetup.getRuntimeConfiguration();

        replacements.put("snmp.identifier",
            addressUtility.getHttpdInternalMainServerAddressRepresentation(runtimeConfig).toString(false, false));

        replacements.put("main.rhq4.resource.key", ApacheVirtualHostServiceComponent.MAIN_SERVER_RESOURCE_KEY);
View Full Code Here

Examples of org.rhq.plugins.apache.parser.ApacheDirectiveTree

                    ApacheDeploymentUtil.deployConfiguration(confDir, configurationFiles, additionalFilesToProcess, deploymentConfig);
                }

                //ok, now try to find the ping URL. The best thing is to actually invoke
                //the same code the apache server discovery does.
                ApacheDirectiveTree tree = ApacheServerDiscoveryComponent.parseRuntimeConfiguration(confFilePath, null, ApacheBinaryInfo.getInfo(exePath, SystemInfoFactory.createSystemInfo()));

                //XXX this hardcodes apache2 as the only option we have...
                HttpdAddressUtility.Address addrToUse = HttpdAddressUtility.APACHE_2_x.getMainServerSampleAddress(tree, null, -1);
                pingUrl = addrToUse.toString();
View Full Code Here

Examples of org.rhq.plugins.apache.parser.ApacheDirectiveTree

    }

    protected void defineRHQ3ResourceKeys(ApacheTestConfiguration testConfig, ApacheTestSetup setup) throws Exception {
        setup.withApacheSetup().init();
        ApacheServerComponent component = setup.withApacheSetup().getServerComponent();
        ApacheDirectiveTree config = component.parseRuntimeConfiguration(false);

        DeploymentConfig deployConfig = setup.getDeploymentConfig();

        VirtualHostLegacyResourceKeyUtil keyUtil = new VirtualHostLegacyResourceKeyUtil(component, config);
View Full Code Here

Examples of org.rhq.plugins.apache.parser.ApacheDirectiveTree

        throws InvalidPluginConfigurationException, Exception {

        Set<DiscoveredResourceDetails> discoveredResources = new LinkedHashSet<DiscoveredResourceDetails>();

        ApacheServerComponent serverComponent = context.getParentResourceComponent();
        ApacheDirectiveTree tree = serverComponent.parseRuntimeConfiguration(false);

        //first define the root server as one virtual host
        discoverMainServer(context, tree, discoveredResources);

        ResourceType resourceType = context.getResourceType();
View Full Code Here

Examples of org.rhq.plugins.apache.parser.ApacheDirectiveTree

        String newResourceKey = null;

        ApacheServerComponent serverComponent = inventoriedResource.getParentResourceComponent();

        ApacheDirectiveTree tree = serverComponent.parseRuntimeConfiguration(false);

        List<VHostSpec> vhosts = VHostSpec.detect(tree);
        VirtualHostLegacyResourceKeyUtil legacyResourceKeyUtil =
            new VirtualHostLegacyResourceKeyUtil(serverComponent, tree);
View Full Code Here

Examples of org.rhq.plugins.apache.parser.ApacheDirectiveTree

     * @param suppressUnknownModuleWarnings true if the method should suppress logging the warnings about unknown modules
     * @return a new directive tree that represents the runtime configuration
     */
    public static ApacheDirectiveTree extract(ApacheDirectiveTree tree, ProcessInfo httpdProcessInfo,
        ApacheBinaryInfo httpdBinaryInfo, Map<String, String> moduleNames, boolean suppressUnknownModuleWarnings) {
        ApacheDirectiveTree ret = tree.clone();
        transform(new TransformingWalker(), ret.getRootNode(),
            getNodeInspector(httpdProcessInfo, httpdBinaryInfo, moduleNames, suppressUnknownModuleWarnings, false));

        return ret;
    }
View Full Code Here

Examples of org.rhq.plugins.apache.parser.ApacheDirectiveTree

            String[] vhostDefs = vhostDef.split(" ");

            HttpdAddressUtility.Address addr;
            try {
                ApacheDirectiveTree parserTree = parseRuntimeConfiguration(true);

                Pattern virtualHostPattern = Pattern.compile(".+:([\\d]+|\\*)");
                Matcher matcher = virtualHostPattern.matcher(vhostDefs[0]);
                if (!matcher.matches())
                    throw new Exception("Wrong format of virtual host resource name. The right format is Address:Port.");
View Full Code Here

Examples of org.rhq.plugins.apache.parser.ApacheDirectiveTree

        if (executablePath != null) {
            executableFile = resolvePathRelativeToServerRoot(executablePath);
        } else {
            String serverRoot = null;

            ApacheDirectiveTree tree = parseRuntimeConfiguration(true);
            List<ApacheDirective> directives = tree.search("/ServerRoot");
            if (!directives.isEmpty())
                if (!directives.get(0).getValues().isEmpty())
                    serverRoot = directives.get(0).getValues().get(0);

            SystemInfo systemInfo = this.resourceContext.getSystemInformation();
View Full Code Here

Examples of org.rhq.plugins.apache.parser.ApacheDirectiveTree

        } else {
            boolean found = false;
            // First try server root as base
            String serverRoot = null;
            try {
                ApacheDirectiveTree tree = parseRuntimeConfiguration(true);
                List<ApacheDirective> directives = tree.search("/ServerRoot");
                if (!directives.isEmpty())
                    if (!directives.get(0).getValues().isEmpty())
                        serverRoot = directives.get(0).getValues().get(0);

            } catch (Exception e) {
View Full Code Here

Examples of org.rhq.plugins.apache.parser.ApacheDirectiveTree

        return controlScriptFile;
    }

    @NotNull
    public ConfigurationTimestamp getConfigurationTimestamp() {
        ApacheDirectiveTree tree = parseRuntimeConfiguration(true);
        Set<String> paths = tree.getAllPaths();
        Set<File> files = new HashSet<File>(paths.size());
        for (String p : paths) {
            files.add(new File(p));
        }
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.