Examples of PCSHealthMonitorReport


Examples of org.apache.oodt.pcs.health.PCSHealthMonitorReport

      final Class<? extends WebPage> instancesPage)
      throws InstantiationException {
    super(id);
    PCSHealthMonitor mon = new PCSHealthMonitor(fmUrlStr, wmUrlStr, rmUrlStr,
        crawlerConfFilePath, statesFilePath);
    final PCSHealthMonitorReport report = mon.getReport();

    add(new Label("report_date", report.getCreateDateIsoFormat()));
    add(new Label("fmurl", report.getFmStatus().getUrlStr()));
    add(new Label("wmurl", report.getWmStatus().getUrlStr()));
    add(new Label("rmurl", report.getRmStatus().getUrlStr()));

    add(new Image("fmstatus_icon", getUpOrDownArrowRef(report.getFmStatus()
        .getStatus())));
    add(new Image("wmstatus_icon", getUpOrDownArrowRef(report.getWmStatus()
        .getStatus())));
    add(new Image("rmstatus_icon", getUpOrDownArrowRef(report.getRmStatus()
        .getStatus())));

    ListModel crawlerStatusListModel = new ListModel(report.getCrawlerStatus());
    add(new VisibilityAndSortToggler("crawler_toggler",
        "crawler_status_showall", "crawler_status_hide", "crawler_status_sort",
        "crawler_status_unsort", "crawler_status_more", crawlerStatusListModel));

    add(new ListView<CrawlerStatus>("crawler_status_list",
        crawlerStatusListModel) {
      /*
       * (non-Javadoc)
       *
       * @see
       * org.apache.wicket.markup.html.list.ListView#populateItem(org.apache
       * .wicket.markup.html.list.ListItem)
       */
      @Override
      protected void populateItem(ListItem<CrawlerStatus> statusItem) {
        CrawlerStatus status = statusItem.getModelObject();
        String statusString = status.getInfo().getCrawlerName() + " ("
            + status.getCrawlHost() + ":" + status.getInfo().getCrawlerPort()
            + ")";
        statusItem.add(new Label("crawler_name_and_url", statusString));
        statusItem.add(new Image("crawler_status_icon",
            getUpOrDownArrowRef(status.getStatus())));
      }
    });

    ListModel batchStubStatusListModel = new ListModel(
        report.getBatchStubStatus());
    add(new VisibilityAndSortToggler("batch_stub_toggler",
        "batch_stub_showall", "batch_stub_hide", "batch_stub_sort",
        "batch_stub_unsort", "batch_stub_more", batchStubStatusListModel));

    add(new ListView<PCSDaemonStatus>("batch_stub_list",
        batchStubStatusListModel) {

      @Override
      protected void populateItem(ListItem<PCSDaemonStatus> item) {
        item.add(new Label("batch_stub_url", item.getModelObject().getUrlStr()));
        item.add(new Image("batch_stub_status_icon", getUpOrDownArrowRef(item
            .getModelObject().getStatus())));

      }
    });

    List<JobHealthStatus> jobHealthStatusList = report.getJobHealthStatus();
    add(new ListView<JobHealthStatus>("jobstatus_list", jobHealthStatusList) {
      /*
       * (non-Javadoc)
       *
       * @see
       * org.apache.wicket.markup.html.list.ListView#populateItem(org.apache
       * .wicket.markup.html.list.ListItem)
       */
      @Override
      protected void populateItem(final ListItem<JobHealthStatus> item) {
        item.add(new Label("status_name", item.getModelObject().getStatus()));
        Link<String> countLink = new Link<String>("jobstatus_count_link",
            new Model<String>(item.getModelObject().getStatus())) {

          @Override
          public void onClick() {
            PageParameters params = new PageParameters();
            params.add("pageNum", "1");
            params.add("status", getModelObject());
            setResponsePage(instancesPage, params);
          }
        };
        countLink.add(new Label("status_num_jobs", String.valueOf(item
            .getModelObject().getNumPipelines())));
        item.add(countLink);
      }
    });

    List<Product> prodList = report.getLatestProductsIngested();
    final FileManagerUtils fm = new FileManagerUtils(fmUrlStr);

    add(new ListView<Product>("file_health_list", prodList) {
      /*
       * (non-Javadoc)
       *
       * @see
       * org.apache.wicket.markup.html.list.ListView#populateItem(org.apache
       * .wicket.markup.html.list.ListItem)
       */
      @Override
      protected void populateItem(ListItem<Product> item) {
        final Product product = item.getModelObject();
        product.setProductType(fm.safeGetProductTypeById(product
            .getProductType().getProductTypeId()));
        product.setProductReferences(fm.safeGetProductReferences(product));
        final Metadata prodMet = fm.safeGetMetadata(product);
        final String filePath = fm.getFilePath(product);

        Link link = new Link("view_product_link") {
          /*
           * (non-Javadoc)
           *
           * @see org.apache.wicket.markup.html.link.Link#onClick()
           */
          @Override
          public void onClick() {
            PageParameters params = new PageParameters();
            params.add("id", product.getProductId());
            setResponsePage(productBrowser, params);
          }
        };

        link.add(new Label("file_path", filePath));
        item.add(link);
        item.add(new Label("file_ingest_datetime", prodMet.getMetadata("CAS."
            + CoreMetKeys.PRODUCT_RECEVIED_TIME)));

      }
    });

    ListModel crawlerHealthListModel = new ListModel(
        report.getCrawlerHealthStatus());
    add(new VisibilityToggler("crawler_health_toggler",
        "crawler_health_showall", "crawler_health_hide", "crawler_health_more",
        crawlerHealthListModel));

    add(new ListView<CrawlerHealth>("crawler_health_list",
View Full Code Here

Examples of org.apache.oodt.pcs.health.PCSHealthMonitorReport

  @GET
  @Path("report")
  @Produces("text/plain")
  public String healthReport() {
    PCSHealthMonitorReport report = mon.getReport();
    Map<String, Object> output = new HashMap<String, Object>();
    output.put("generated", report.getCreateDateIsoFormat());
    output.put("daemonStatus", this.encodeDaemonOutput(report));
    output.put("crawlerStatus", this.encodeCrawlerHealthReportOutput(report));
    output.put("latestFiles", this.encodeLatestFilesOutput(report));
    output.put("jobHealth", this.encodeJobHealthStatusList(report));
    output.put("ingestHealth", this.encodeIngestHealthList(report));
View Full Code Here

Examples of org.apache.oodt.pcs.health.PCSHealthMonitorReport

  @GET
  @Path("report/ingest")
  @Produces("text/plain")
  public String ingestReport() {
    PCSHealthMonitorReport report = mon.getReport();
    Map<String, Object> output = new HashMap<String, Object>();
    output.put("generated", report.getCreateDateIsoFormat());
    output.put("ingestHealth", this.encodeIngestHealthList(report));
    return this.encodeReportAsJson(output);
  }
View Full Code Here

Examples of org.apache.oodt.pcs.health.PCSHealthMonitorReport

  @GET
  @Path("report/ingest/{cname}")
  @Produces("text/plain")
  public String ingestReportByName(@PathParam("cname") String crawlerName) {
    PCSHealthMonitorReport report = mon.getReport();
    Map<String, Object> output = new HashMap<String, Object>();
    output.put("generated", report.getCreateDateIsoFormat());
    output.put("ingestHealth", this
        .encodeIngestHealthList(report, crawlerName));
    return this.encodeReportAsJson(output);
  }
View Full Code Here

Examples of org.apache.oodt.pcs.health.PCSHealthMonitorReport

  @GET
  @Path("report/jobs")
  @Produces("text/plain")
  public String jobsReport() {
    PCSHealthMonitorReport report = mon.getReport();
    Map<String, Object> output = new HashMap<String, Object>();
    output.put("generated", report.getCreateDateIsoFormat());
    output.put("jobHealth", this.encodeJobHealthStatusList(report));
    return this.encodeReportAsJson(output);
  }
View Full Code Here

Examples of org.apache.oodt.pcs.health.PCSHealthMonitorReport

  @GET
  @Path("report/jobs/{state}")
  @Produces("text/plain")
  public String jobsReportByState(@PathParam("state") String jobState) {
    PCSHealthMonitorReport report = mon.getReport();
    Map<String, Object> output = new HashMap<String, Object>();
    output.put("generated", report.getCreateDateIsoFormat());
    output.put("jobHealth", this.encodeJobHealthStatusList(report, jobState));
    return this.encodeReportAsJson(output);
  }
View Full Code Here

Examples of org.apache.oodt.pcs.health.PCSHealthMonitorReport

  @GET
  @Path("report/daemon")
  @Produces("text/plain")
  public String daemonReport() {
    PCSHealthMonitorReport report = mon.getReport();
    Map<String, Object> output = new HashMap<String, Object>();
    output.put("generated", report.getCreateDateIsoFormat());
    output.put("daemonStatus", this.encodeDaemonOutput(report));
    return this.encodeReportAsJson(output);
  }
View Full Code Here

Examples of org.apache.oodt.pcs.health.PCSHealthMonitorReport

  @GET
  @Path("report/daemon/{dname}")
  @Produces("text/plain")
  public String daemonReportByName(@PathParam("dname") String daemonName) {
    PCSHealthMonitorReport report = mon.getReport();
    Map<String, Object> output = new HashMap<String, Object>();
    output.put("generated", report.getCreateDateIsoFormat());
    output.put("daemonStatus", this.encodeDaemonOutput(report, daemonName));
    return this.encodeReportAsJson(output);

  }
View Full Code Here

Examples of org.apache.oodt.pcs.health.PCSHealthMonitorReport

  @GET
  @Path("report/crawlers")
  @Produces("text/plain")
  public String crawlerHealthReport() {
    PCSHealthMonitorReport report = mon.getReport();
    Map<String, Object> output = new HashMap<String, Object>();
    output.put("generated", report.getCreateDateIsoFormat());
    output.put("crawlerStatus", this.encodeCrawlerHealthReportOutput(report));
    return this.encodeReportAsJson(output);
  }
View Full Code Here

Examples of org.apache.oodt.pcs.health.PCSHealthMonitorReport

  @GET
  @Path("report/crawlers/{cname}")
  @Produces("text/plain")
  public String getCrawlerHealthReportByName(
      @PathParam("cname") String crawlerName) {
    PCSHealthMonitorReport report = mon.getReport();
    Map<String, Object> output = new HashMap<String, Object>();
    output.put("generated", report.getCreateDateIsoFormat());
    output.put("crawlerStatus", this.encodeCrawlerHealthReportOutput(report,
        crawlerName));
    return this.encodeReportAsJson(output);
  }
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.