Beispiel #1
0
  private TransactionReport getHourlyReport(Payload payload) {
    String domain = payload.getDomain();
    String ipAddress = payload.getIpAddress();
    ModelRequest request =
        new ModelRequest(domain, payload.getDate())
            .setProperty("type", payload.getType())
            .setProperty("ip", ipAddress);

    if (m_service.isEligable(request)) {
      ModelResponse<TransactionReport> response = m_service.invoke(request);
      TransactionReport report = response.getModel();

      if (payload.getPeriod().isLast()) {
        Date start = new Date(payload.getDate());
        Date end = new Date(payload.getDate() + TimeHelper.ONE_HOUR);

        if (Constants.ALL.equals(domain)) {
          report = m_reportService.queryTransactionReport(domain, start, end);
        }
        Set<String> domains =
            m_reportService.queryAllDomainNames(start, end, TransactionAnalyzer.ID);
        Set<String> domainNames = report.getDomainNames();

        domainNames.addAll(domains);
      }
      return report;
    } else {
      throw new RuntimeException(
          "Internal error: no eligable transaction service registered for " + request + "!");
    }
  }
  @Override
  public void visitMachine(Machine machine) {
    if (!Constants.ALL.equals(machine.getIp())) {
      m_ip = machine.getIp();

      super.visitMachine(machine);
    }
  }
Beispiel #3
0
  public EventReport mergeAllIps(EventReport report, String ipAddress) {
    if (Constants.ALL.equalsIgnoreCase(ipAddress)) {
      AllMachineMerger all = new AllMachineMerger();

      all.visitEventReport(report);
      report = all.getReport();
    }
    return report;
  }
Beispiel #4
0
  private EventReport mergeAllNames(EventReport report, String allName) {
    if (Constants.ALL.equalsIgnoreCase(allName)) {
      AllNameMerger all = new AllNameMerger();

      all.visitEventReport(report);
      report = all.getReport();
    }
    return report;
  }
  private boolean graphNodeConfigAddOrUpdateSubmit(Payload payload, Model model) {
    String type = payload.getType();
    DomainConfig config = payload.getDomainConfig();
    String domain = config.getId();
    model.setDomainConfig(config);

    if (Constants.ALL.equalsIgnoreCase(domain)) {
      return m_topologyConfigManager.insertDomainDefaultConfig(type, config);
    } else {
      return m_topologyConfigManager.insertDomainConfig(type, config);
    }
  }