@Override
  public boolean buildDailyTask(String name, String domain, Date period) {
    ServiceReport serviceReport =
        queryHourlyReportsByDuration(name, domain, period, TaskHelper.tomorrowZero(period));
    DailyReport report = new DailyReport();

    report.setCreationDate(new Date());
    report.setDomain(domain);
    report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
    report.setName(name);
    report.setPeriod(period);
    report.setType(1);
    byte[] binaryContent = DefaultNativeBuilder.build(serviceReport);

    return m_reportService.insertDailyReport(report, binaryContent);
  }
Beispiel #2
0
  @Override
  public boolean buildDailyTask(String name, String domain, Date period) {
    BugReport bugReport =
        queryHourlyReportsByDuration(name, domain, period, TaskHelper.tomorrowZero(period));

    for (Domain d : bugReport.getDomains().values()) {
      d.setProblemUrl(
          String.format(
              "http://%s/cat/r/p?op=history&reportType=day&domain=%s&date=%s",
              getDomainName(), d.getId(), m_daily_formate.format(period)));
    }
    DailyReport report = new DailyReport();

    report.setContent(bugReport.toString());
    report.setCreationDate(new Date());
    report.setDomain(domain);
    report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
    report.setName(name);
    report.setPeriod(period);
    report.setType(1);
    byte[] binaryContent = DefaultNativeBuilder.build(bugReport);
    return m_reportService.insertDailyReport(report, binaryContent);
  }