Package org.glassfish.flashlight.datatree

Examples of org.glassfish.flashlight.datatree.TreeNode


    public TreeNode getPossibleParentNode(String pattern) {
        // simplify by bailing out early if preconditions are not met...
        if (pattern == null || pattern.length() <= 0 || pattern.indexOf('*') >= 0)
            return null;

        TreeNode node = null;
        int longest = 0;

        for (TreeNode n : traverse(true)) {
            String aname = n.getCompletePathName();

View Full Code Here


        if (!ok(desiredName))
            return null;

        desiredName = decodeNameToDots(desiredName);
        TreeNode node = normalizedChildren.get(desiredName);

        // one more try.  GUI sometimes chops off the starting "server".
        if (node == null && !desiredName.startsWith("server.")) {
            node = normalizedChildren.get("server." + desiredName);
View Full Code Here

            report.setMessage(localStrings.getLocalString("mrdr.null",
                "MonitoringRuntimeDataRegistry is null"));
            return report;
        }

        TreeNode serverNode = mrdr.get("server");
        if (serverNode == null) {
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            report.setMessage(localStrings.getLocalString("mrdr.null",
                "MonitoringRuntimeDataRegistry server node is null"));
            return report;
        }

        String [] patternArr = new String [] {"server.web.servlet.*"};
       
  long activeServletsLoadedCount = 0;
  long maxServletsLoadedCount = 0;
  long totalServletsLoadedCount = 0;

        for (String pattern : patternArr) {
            List<TreeNode> tnL = serverNode.getNodes(pattern);
            for (TreeNode tn : tnL) {
                if (tn.hasChildNodes()) {
                    continue;
                }
                if ("activeservletsloadedcount".equals(tn.getName())) {
View Full Code Here

            report.setMessage(localStrings.getLocalString("mrdr.null",
                "MonitoringRuntimeDataRegistry is null"));
            return report;
        }

        TreeNode serverNode = mrdr.get("server");
        if (serverNode == null) {
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            report.setMessage(localStrings.getLocalString("mrdr.null",
                "MonitoringRuntimeDataRegistry server node is null"));
            return report;
        }

        String [] patternArr;
           
        if (appName != null) {
            // post prelude - need to fix this for virtual server
            patternArr = new String [] {"server.applications." + appName + ".*.*"};
        } else {
            patternArr = new String [] {"server.web.session.*",
                    "server.web.servlet.*", "server.web.jsp.*"};
        }
       
  long activeSessionsCount = 0;
  long sessionsTotal = 0;
  long rejectedSessionsTotal = 0;
  long activatedSessionsTotal = 0;

  long activeJspsLoadedCount = 0;
  long maxJspsLoadedCount = 0;
  long totalJspsLoadedCount = 0;

  long activeServletsLoadedCount = 0;
  long maxServletsLoadedCount = 0;
  long totalServletsLoadedCount = 0;

        long lval = 0;

        for (String pattern : patternArr) {
            List<TreeNode> tnL = serverNode.getNodes(pattern);
            for (TreeNode tn : tnL) {
                if (tn.hasChildNodes()) {
                    continue;
                }

View Full Code Here

            report.setMessage(localStrings.getLocalString("mrdr.null",
                "MonitoringRuntimeDataRegistry is null"));
            return report;
        }

        TreeNode serverNode = mrdr.get("server");
        if (serverNode == null) {
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            report.setMessage(localStrings.getLocalString("mrdr.null",
                "MonitoringRuntimeDataRegistry server node is null"));
            return report;
        }

        long errorCount = 0;
        long maxTime = 0;
        double processingTime = 0;
        long requestCount = 0;

        List<TreeNode> tnL = serverNode.getNodes("server.web.request.*");
        for (TreeNode tn : tnL) {
            if (tn.hasChildNodes()) {
                continue;
            }

View Full Code Here

        ar.setSuccess();

        String currentInstanceName = System.getProperty("com.sun.aas.instanceName");
        boolean isRunningOnDAS = "server".equals(currentInstanceName); //TODO this needs to come from an API. Check with admin team
        MonitoringRuntimeDataRegistry monitoringRegistry =habitat.getRemoteLocator().getService(MonitoringRuntimeDataRegistry.class);
        TreeNode rootNode = monitoringRegistry.get(currentInstanceName);

        //The pathSegments will always contain "domain". Discard it
        pathSegments = pathSegments.subList(1, pathSegments.size());
        if(!pathSegments.isEmpty()) {
            PathSegment lastSegment = pathSegments.get(pathSegments.size() - 1);
            if(lastSegment.getPath().isEmpty()) { // if there is a trailing '/' (like monitoring/domain/), a spurious pathSegment is added. Discard it.
                pathSegments = pathSegments.subList(0,pathSegments.size() - 1);
            }
        }

        if(!pathSegments.isEmpty() ) {
            String firstPathElement = pathSegments.get(0).getPath();
            if(firstPathElement.equals(currentInstanceName)) { // Query for current instance. Execute it
                //iterate over pathsegments and build a dotted name to look up in monitoring registry
                StringBuilder pathInMonitoringRegistry = new StringBuilder();
                for(PathSegment pathSegment : pathSegments.subList(1,pathSegments.size()) ) {
                        if(pathInMonitoringRegistry.length() > 0 ) {
                            pathInMonitoringRegistry.append('.');
                        }
                        pathInMonitoringRegistry.append(pathSegment.getPath().replaceAll("\\.", "\\\\.")); // Need to escape '.' before passing it to monitoring code
                }

                TreeNode resultNode = pathInMonitoringRegistry.length() > 0 && rootNode != null ?
                        rootNode.getNode(pathInMonitoringRegistry.toString()) : rootNode;
                if (resultNode != null) {
                    List<TreeNode> list = new ArrayList<TreeNode>();
                    if (resultNode.hasChildNodes()) {
                        list.addAll(resultNode.getEnabledChildNodes());
                    } else {
                        list.add(resultNode);
                    }
                    constructEntity(list, ar);
                    responseBuilder.entity(new ActionReportResult(ar));
View Full Code Here

            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            report.setMessage(rb.getString(HTTPListenerStatsImpl.MRDR_NULL));
            return report;
        }

        TreeNode serverNode = mrdr.get("server");
        if (serverNode == null) {
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            report.setMessage(rb.getString(HTTPListenerStatsImpl.MRDR_NULL));
            return report;
        }

        String [] patternArr;
           
        if (appName != null) {
            // post prelude - need to fix this for virtual server
            patternArr = new String [] {"server.applications." + appName + ".*.*"};
        } else {
            patternArr = new String [] {"server.web.session.*",
                    "server.web.servlet.*", "server.web.jsp.*"};
        }
       
  long activeSessionsCount = 0;
  long sessionsTotal = 0;
  long rejectedSessionsTotal = 0;
  long activatedSessionsTotal = 0;

  long activeJspsLoadedCount = 0;
  long maxJspsLoadedCount = 0;
  long totalJspsLoadedCount = 0;

  long activeServletsLoadedCount = 0;
  long maxServletsLoadedCount = 0;
  long totalServletsLoadedCount = 0;

        long lval = 0;

        for (String pattern : patternArr) {
            List<TreeNode> tnL = serverNode.getNodes(pattern);
            for (TreeNode tn : tnL) {
                if (tn.hasChildNodes()) {
                    continue;
                }

View Full Code Here

            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            report.setMessage(rb.getString(MRDR_NULL));
            return report;
        }

        TreeNode serverNode = mrdr.get("server");
        if (serverNode == null) {
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            report.setMessage(rb.getString(MRDR_NULL));
            return report;
        }

        long errorCount = 0;
        long maxTime = 0;
        double processingTime = 0;
        long requestCount = 0;

        List<TreeNode> tnL = serverNode.getNodes("server.web.request.*");
        for (TreeNode tn : tnL) {
            if (tn.hasChildNodes()) {
                continue;
            }

View Full Code Here

            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            report.setMessage(rb.getString(HTTPListenerStatsImpl.MRDR_NULL));
            return report;
        }

        TreeNode serverNode = mrdr.get("server");
        if (serverNode == null) {
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            report.setMessage(rb.getString(HTTPListenerStatsImpl.MRDR_NULL));
            return report;
        }

        String [] patternArr = new String [] {"server.web.servlet.*"};
       
  long activeServletsLoadedCount = 0;
  long maxServletsLoadedCount = 0;
  long totalServletsLoadedCount = 0;

        for (String pattern : patternArr) {
            List<TreeNode> tnL = serverNode.getNodes(pattern);
            for (TreeNode tn : tnL) {
                if (tn.hasChildNodes()) {
                    continue;
                }
                if ("activeservletsloadedcount".equals(tn.getName())) {
View Full Code Here

        ar.setSuccess();

        String currentInstanceName = System.getProperty("com.sun.aas.instanceName");
        boolean isRunningOnDAS = "server".equals(currentInstanceName); //TODO this needs to come from an API. Check with admin team
        MonitoringRuntimeDataRegistry monitoringRegistry =habitat.getComponent(MonitoringRuntimeDataRegistry.class);
        TreeNode rootNode = monitoringRegistry.get(currentInstanceName);

        //The pathSegments will always contain "domain". Discard it
        pathSegments = pathSegments.subList(1, pathSegments.size());
        if(!pathSegments.isEmpty()) {
            PathSegment lastSegment = pathSegments.get(pathSegments.size() - 1);
            if(lastSegment.getPath().isEmpty()) { // if there is a trailing '/' (like monitroing/domain/), a spurious pathSegment is added. Discard it.
                pathSegments = pathSegments.subList(0,pathSegments.size() - 1);
            }
        }

        if(!pathSegments.isEmpty() ) {
            String firstPathElement = pathSegments.get(0).getPath();
            if(firstPathElement.equals(currentInstanceName)) { // Query for current instance. Execute it
                //iterate over pathsegments and build a dotted name to look up in monitoring registry
                StringBuilder pathInMonitoringRegistry = new StringBuilder();
                for(PathSegment pathSegment : pathSegments.subList(1,pathSegments.size()) ) {
                        if(pathInMonitoringRegistry.length() > 0 ) {
                            pathInMonitoringRegistry.append('.');
                        }
                        pathInMonitoringRegistry.append(pathSegment.getPath().replaceAll("\\.", "\\\\.")); // Need to escape '.' before passing it to monitoring code
                }

                TreeNode resultNode = pathInMonitoringRegistry.length() > 0 ? rootNode.getNode(pathInMonitoringRegistry.toString()) : rootNode;
                if (resultNode != null) {
                    List<TreeNode> list = new ArrayList<TreeNode>();
                    if (resultNode.hasChildNodes()) {
                        list.addAll(resultNode.getEnabledChildNodes());
                    } else {
                        list.add(resultNode);
                    }
                    constructEntity(list, ar);
                    responseBuilder.entity(new ActionReportResult(ar));
View Full Code Here

TOP

Related Classes of org.glassfish.flashlight.datatree.TreeNode

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.