Ejemplo n.º 1
0
  private void processExceptionRule() {
    List<ThresholdRule> rules = m_manager.getAllExceptionRules();
    Transaction t = Cat.newTransaction("Alarm", "ProcessExceptionRule");

    for (ThresholdRule rule : rules) {
      try {
        String connectUrl = rule.getConnectUrl();
        ThresholdDataEntity entity = m_connector.fetchAlarmData(connectUrl);

        if (entity != null) {
          entity.setDomain(rule.getDomain());
          Cat.getProducer().logEvent("AlarmUrl", connectUrl, Event.SUCCESS, entity.toString());

          ExceptionDataEvent event = new ExceptionDataEvent(entity);

          m_dispatcher.dispatch(event);
        }
      } catch (Exception e) {
        t.setStatus(e);
        Cat.logError(e);
      }
    }
    t.setStatus(Transaction.SUCCESS);
    t.complete();
  }
Ejemplo n.º 2
0
  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();

    sb.append("Service: ").append(m_data.toString());
    return sb.toString();
  }