Пример #1
0
 @Override
 public void visitProblemReport(ProblemReport problemReport) {
   m_domain = problemReport.getDomain();
   m_report = new ProblemReport();
   m_report.getIps().addAll(problemReport.getIps());
   m_report.getDomainNames().addAll(problemReport.getDomainNames());
   m_report.setDomain(problemReport.getDomain());
   m_report.setStartTime(problemReport.getStartTime());
   m_report.setEndTime(problemReport.getEndTime());
   super.visitProblemReport(problemReport);
 }
Пример #2
0
  public ProblemReport createAggregatedReport(Map<String, ProblemReport> reports) {
    ProblemReport report = new ProblemReport(Constants.ALL);
    ProblemReportAllBuilder visitor = new ProblemReportAllBuilder(report);

    try {
      for (ProblemReport temp : reports.values()) {
        if (m_manager.validateDomain(temp.getDomain())) {
          report.getIps().add(temp.getDomain());
          report.getDomainNames().add(temp.getDomain());
          visitor.visitProblemReport(temp);
        }
      }
    } catch (Exception e) {
      Cat.logError(e);
    }
    return report;
  }
Пример #3
0
  @Override
  public boolean createHourlyTask(ProblemReport report) {
    String domain = report.getDomain();

    if (m_manager.validateDomain(domain)) {
      return m_taskManager.createTask(
          report.getStartTime(), domain, ProblemAnalyzer.ID, TaskProlicy.ALL);
    } else if (m_manager.isCrashLog(domain)) {
      return m_taskManager.createTask(
          report.getStartTime(), domain, ProblemAnalyzer.ID, TaskProlicy.ALL_EXCLUED_HOURLY);
    } else {
      return true;
    }
  }
Пример #4
0
  @Override
  public void beforeSave(Map<String, ProblemReport> reports) {
    for (ProblemReport report : reports.values()) {
      Set<String> domainNames = report.getDomainNames();

      domainNames.clear();
      domainNames.addAll(reports.keySet());
    }

    if (reports.size() > 0) {
      ProblemReport all = createAggregatedReport(reports);

      reports.put(all.getDomain(), all);
    }

    ProblemReport frontEnd = reports.get(Constants.FRONT_END);

    if (frontEnd != null) {
      reports.put(Constants.FRONT_END, rebuildFrontEndReport(frontEnd));
    }
  }
Пример #5
0
 @Override
 public String getDomain(ProblemReport report) {
   return report.getDomain();
 }