Examples of HostStatus


Examples of com.spotify.helios.common.descriptors.HostStatus

                                     final TaskStatus.State state, final int timeout,
                                     final TimeUnit timeunit) throws Exception {
    return Polling.await(timeout, timeunit, new Callable<TaskStatus>() {
      @Override
      public TaskStatus call() throws Exception {
        final HostStatus hostStatus = getOrNull(client.hostStatus(host));
        if (hostStatus == null) {
          return null;
        }
        final TaskStatus taskStatus = hostStatus.getStatuses().get(jobId);
        return (taskStatus != null && taskStatus.getState() == state) ? taskStatus
                                                                      : null;
      }
    });
  }
View Full Code Here

Examples of com.spotify.helios.common.descriptors.HostStatus

                                        final ThrottleState throttled, final int timeout,
                                        final TimeUnit timeunit) throws Exception {
    return Polling.await(timeout, timeunit, new Callable<TaskStatus>() {
      @Override
      public TaskStatus call() throws Exception {
        final HostStatus hostStatus = getOrNull(client.hostStatus(host));
        if (hostStatus == null) {
          return null;
        }
        final TaskStatus taskStatus = hostStatus.getStatuses().get(jobId);
        return (taskStatus != null && taskStatus.getThrottled() == throttled) ? taskStatus : null;
      }
    });
  }
View Full Code Here

Examples of com.spotify.helios.common.descriptors.HostStatus

                                       final int timeout,
                                       final TimeUnit timeUnit) throws Exception {
    return Polling.await(timeout, timeUnit, new Callable<HostStatus>() {
      @Override
      public HostStatus call() throws Exception {
        final HostStatus hostStatus = getOrNull(client.hostStatus(host));
        if (hostStatus == null) {
          return null;
        }
        return (hostStatus.getStatus() == status) ? hostStatus : null;
      }
    });
  }
View Full Code Here

Examples of com.spotify.helios.common.descriptors.HostStatus

  protected void awaitTaskGone(final HeliosClient client, final String host, final JobId jobId,
                               final long timeout, final TimeUnit timeunit) throws Exception {
    Polling.await(timeout, timeunit, new Callable<Boolean>() {
      @Override
      public Boolean call() throws Exception {
        final HostStatus hostStatus = getOrNull(client.hostStatus(host));
        final TaskStatus taskStatus = hostStatus.getStatuses().get(jobId);
        final Deployment deployment = hostStatus.getJobs().get(jobId);
        return taskStatus == null && deployment == null ? true : null;
      }
    });
  }
View Full Code Here

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

Examples of net.gridshield.nexsm.entityclasses.HostStatus

            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

Examples of net.gridshield.nexsm.entityclasses.HostStatus

         * @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

Examples of net.gridshield.nexsm.entityclasses.HostStatus

     * @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

Examples of net.gridshield.nexsm.entityclasses.HostStatus

            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

Examples of net.gridshield.nexsm.entityclasses.HostStatus

     * @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
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.