public void nodesUpdated(Map<String, NodeSource> nodes) {
    if (selNode != null) {
      for (NodeSource ns : nodes.values()) {
        if (selNode.getSourceName().equals(ns.getSourceName())) {

          Node depl = ns.getDeploying().get(selNode.getNodeUrl());
          if (depl != null) {
            nodeSelected(depl);
            return;
          }

          for (Host h : ns.getHosts().values()) {
            if (selNode.getHostName().equals(h.getHostName())) {

              for (Node n : h.getNodes().values()) {
                if (n.getNodeUrl().equals(selNode.getNodeUrl())) {
                  nodeSelected(n);
                  return;
                }
              }
            }
          }
        }
      }
    } else if (selHost != null) {
      for (NodeSource ns : nodes.values()) {
        if (ns.getSourceName().equals(selHost.getSourceName())) {

          for (Host h : ns.getHosts().values()) {
            if (selHost.getHostName().equals(h.getHostName())) {
              hostSelected(h);
              return;
            }
          }
        }
      }
    } else if (selNS != null) {
      for (NodeSource ns : nodes.values()) {
        if (ns.getSourceName().equals(selNS.getSourceName())) {
          nodeSourceSelected(ns);
          return;
        }
      }
    }

    nodeUnselected();
  }
예제 #2
0
  /*
   * (non-Javadoc)
   * @see org.ow2.proactive_grid_cloud_portal.rm.client.Listeners.NodeSelectedListener#hostSelected(org.ow2.proactive_grid_cloud_portal.rm.client.NodeSource.Host)
   */
  public void hostSelected(Host h) {
    this.label.hide();
    this.nodeCanvas.hide();

    this.hostLabel.setContents("<h3>" + h.getHostName() + "</h3>");
    this.nodeMonitoring.close();
    this.hostMonitoring.close();
    this.hostMonitoring.init(h);
    this.hostCanvas.show();
  }
  /*
   * (non-Javadoc)
   * @see org.ow2.proactive_grid_cloud_portal.rm.client.Listeners.NodeSelectedListener#hostSelected(org.ow2.proactive_grid_cloud_portal.rm.client.NodeSource.Host)
   */
  public void hostSelected(Host h) {
    DetailViewerRecord dv = new DetailViewerRecord();

    dv.setAttribute("hostName", h.getHostName());
    dv.setAttribute("nodes", h.getNodes().size());

    this.hostDetails.setData(new DetailViewerRecord[] {dv});
    if (h.isVirtual()) {
      this.hostLabel.setIcon(RMImages.instance.host_virtual_16().getSafeUri().asString());
    } else {
      this.hostLabel.setIcon(RMImages.instance.host_16().getSafeUri().asString());
    }

    this.label.hide();
    this.nodeCanvas.hide();
    this.hostCanvas.show();
    this.nsCanvas.hide();

    this.selHost = h;
    this.selNS = null;
    this.selNode = null;
  }