Package net.gridshield.nexsm.entityclasses

Examples of net.gridshield.nexsm.entityclasses.HostStatus


                        }
                    }
                break;
                case Host_Down:
                    Object ostatus = v.getUserDatum("hoststatus");
                    HostStatus hstatus = (HostStatus)ostatus;
                   
                    if (hstatus.getProblemHasBeenAcknowledged()) {
                        if (statesMap.get("down_acked") != null) {
                            myIcon.add(statesMap.get("down_acked"));
                        }
                    } else {
                        if (statesMap.get("down") != null)
View Full Code Here


            clearLabels();
            rmaxwitdh = 0;
            vselected = v;
            sip.showServices(v);
            Host h = _gm.getVertexHost(vselected);
            HostStatus hs = _gm.getVertexHostStatus(vselected);
            JLabel tmp = null;
            Font f = null;
            FontMetrics fm = null;
            tmp = labelsRight.get(labelsTexts[0]);
            f = tmp.getFont();
            fm = tmp.getFontMetrics(f);
            if (h != null) {
                tmp.setText(h.getName());
                tmp.setToolTipText(tmp.getText());
                tmp = labelsRight.get(labelsTexts[1]);
                tmp.setText(h.getDescription());
                tmp.setToolTipText(tmp.getText());
                tmp = labelsRight.get(labelsTexts[2]);
                tmp.setText(h.getAddress());
                tmp.setToolTipText(tmp.getText());
                tmp = labelsRight.get(labelsTexts[3]);
                tmp.setText(h.getParentsString());
            }
            if (hs != null) {
                tmp.setToolTipText(tmp.getText());
                tmp = labelsRight.get(labelsTexts[4]); // status info
                tmp.setText(hs.getPluginOutput());
                tmp.setToolTipText(tmp.getText());
                // ^^^^^ status info
               
                tmp = labelsRight.get(labelsTexts[5]); // current state
                String currState = hs.getCurrentState().toString();
                setFontColor(tmp, hs.getCurrentState(), hs.getProblemHasBeenAcknowledged());
                tmp.setText(currState + hasBeenAcknowledged(hs.getProblemHasBeenAcknowledged(), hs.getCurrentState()));
                tmp.setToolTipText(tmp.getText());
               
                // Last check
                tmp = labelsRight.get(labelsTexts[6]);
                long time = hs.getLastCheck();
                if (time != 0) {
                    tmp.setText(DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT).format(time));
                } else {
                    tmp.setText("N/A");
                }
                tmp.setToolTipText(tmp.getText());

                // time in actual state
                tmp = labelsRight.get(labelsTexts[7]);
                tmp.setText(timeInActualState(System.currentTimeMillis() -  hs.getLastStateChange()) + (hs.getLastStateChange() == 0?"+":""));
                tmp.setToolTipText(tmp.getText());

                tmp = labelsRight.get(labelsTexts[8])//previous hard state
                setFontColor(tmp, hs.getLastHardState());
                tmp.setText(hs.getLastHardState().toString());

                tmp = labelsRight.get(labelsTexts[9]);
                time = hs.getLastHardStateChange();
                if (time != 0) {
                    tmp.setText(DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT).format(hs.getLastHardStateChange()));   
                } else {
                    tmp.setText("N/A");
                }
                tmp.setToolTipText(tmp.getText());

                time = 0;
                time = hs.getLastTimeUp();
                tmp = labelsRight.get(labelsTexts[10]);
                if (time != 0) {
                    tmp.setText(DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT).format(hs.getLastTimeUp()));
                } else {
                    tmp.setText("N/A");
                }
                tmp.setToolTipText(tmp.getText());

                time = 0;
                time = hs.getLastTimeDown();
                tmp = labelsRight.get(labelsTexts[11]);
                if (time != 0) {
                    tmp.setText(DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT).format(hs.getLastTimeDown()));
                } else {
                    tmp.setText("N/A");
                }
                tmp.setToolTipText(tmp.getText());

                tmp = labelsRight.get(labelsTexts[12]);
                time = 0;
                time = hs.getLastTimeUnreachable();
                if (time != 0) {
                    tmp.setText(DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT).format(hs.getLastTimeUnreachable()));
                } else {
                    tmp.setText("N/A");
                }
                tmp.setToolTipText(tmp.getText());
View Full Code Here

         * @return true if the vertex specified by v has some information to display,
         * false otherwise
         */
        public boolean hasSomethingToDisplay(Vertex v) {
            Host h = _gm.getVertexHost(v);
            HostStatus hs = _gm.getVertexHostStatus(v);
            boolean visible = _gm.isVisible(v, _vv.getName());
            return (visible && (h != null || hs != null));
        }
View Full Code Here

     * @return true if the vertex specified by v has some information to display,
     * false otherwise
     */
    public boolean hasSomethingToDisplay(Vertex v, VisualizationViewer vv) {
        Host h =  getGraphManager().getVertexHost(v);
        HostStatus hs = getGraphManager().getVertexHostStatus(v);
        boolean visible = getGraphManager().isVisible(v, vv.getName());
        return (visible && (h != null || hs != null));
    }
View Full Code Here

            case OpenWindow:
                String klass = "";
                String hostname = "";
                String service = "";
                Host h = null;
                HostStatus hs = null;
                ServiceStatus ss = null;
                if (args.length >= 1) {
                    klass = (String)args[0];
                }
                if (args.length >= 2) {
View Full Code Here

     * @throws java.lang.Exception If a problem is encountered
     */
    public void text(String str) throws Exception {
        if (hostDefinition) {
            if (host_name) {
                htmp = new HostStatus(str);
            }
            if (last_check) {
                htmp.setLastCheck(Long.parseLong(str)*1000);
            }
            if (current_attempt) {
View Full Code Here

TOP

Related Classes of net.gridshield.nexsm.entityclasses.HostStatus

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.