Package org.rhq.plugins.apache.parser

Examples of org.rhq.plugins.apache.parser.ApacheDirectiveTree.search()


            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


            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

        //only look for the vhost entry if the vhost we're looking for isn't the main server
        if (!MAIN_SERVER_RESOURCE_KEY.equals(vhostAddressStrings[0])) {
            ApacheDirectiveTree tree = parent.parseRuntimeConfiguration(false);

            //find the vhost entry the resource key represents
            List<ApacheDirective> vhosts = tree.search("/<VirtualHost");
            for (ApacheDirective vhost : vhosts) {
                List<ApacheDirective> serverNames = vhost.getChildByName("ServerName");
                String serverName = serverNames.size() > 0 ? serverNames.get(0).getValuesAsString() : null;

                List<String> addrs = vhost.getValues();
View Full Code Here

        String serverUrl = null;
        String vhostsGlobInclude = null;

        //now check if the httpd.conf doesn't redefine the ServerRoot
        List<ApacheDirective> serverRoots = serverConfig.search("/ServerRoot");
        if (!serverRoots.isEmpty()) {
            serverRoot = AugeasNodeValueUtil.unescape(serverRoots.get(0).getValuesAsString());
            serverRootProp.setValue(serverRoot);
        }
View Full Code Here

        ApacheDirectiveTree tree =
            ApacheServerDiscoveryComponent.parseRuntimeConfiguration(
                new File(tmpDir, "snmp-mapping/httpd.conf").getAbsolutePath(), pinfo, binfo);

        HttpdAddressUtility addrUtil = HttpdAddressUtility.get("2.2.17");
        List<ApacheDirective> vhosts = tree.search("/<VirtualHost");
        List<String> snmpNames = new ArrayList<String>(vhosts.size() + 1);
        snmpNames.add(addrUtil.getHttpdInternalMainServerAddressRepresentation(tree).toString(false, false));
        for (ApacheDirective vhost : vhosts) {
            String vhostDef = vhost.getValues().get(0);
            String serverName = null;
View Full Code Here

        ApacheDirectiveTree tree =
            ApacheServerDiscoveryComponent.parseRuntimeConfiguration(new File(tmpDir,
                "runtime-config/incl-order/httpd.conf").getAbsolutePath(), pinfo, binfo);

        List<ApacheDirective> listens = tree.search("/Listen");

        assertEquals(listens.size(), 3, "There should be 3 listen directives");

        assertEquals(listens.get(0).getValuesAsString(), "80");
        assertEquals(listens.get(1).getValuesAsString(), "81");
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.