Esempio n. 1
0
  private void sendNodeDownEventWithUpdateFieldSeverity(
      String reductionKey, MockNode node, OnmsSeverity severity) throws SQLException {
    EventBuilder event = MockEventUtil.createNodeDownEventBuilder("Test", node);

    if (reductionKey != null) {
      AlarmData data = new AlarmData();
      data.setAlarmType(1);
      data.setReductionKey(reductionKey);

      List<UpdateField> fields = new ArrayList<UpdateField>();

      UpdateField field = new UpdateField();
      field.setFieldName("Severity");
      field.setUpdateOnReduction(Boolean.TRUE);
      fields.add(field);

      data.setUpdateField(fields);

      event.setAlarmData(data);
    } else {
      event.setAlarmData(null);
    }

    event.setLogDest("logndisplay");
    event.setLogMessage("testing");

    event.setSeverity(severity.getLabel());

    m_eventdIpcMgr.sendNow(event.getEvent());
  }
Esempio n. 2
0
  private void sendNodeDownEventChangeLogMsg(String reductionKey, MockNode node, String logMsg) {

    EventBuilder event = MockEventUtil.createNodeDownEventBuilder("Test", node);

    if (reductionKey != null) {
      AlarmData data = new AlarmData();
      data.setAlarmType(1);
      data.setReductionKey(reductionKey);

      List<UpdateField> fields = new ArrayList<UpdateField>();

      UpdateField field = new UpdateField();
      field.setFieldName("logMsg");
      field.setUpdateOnReduction(Boolean.TRUE);
      fields.add(field);

      data.setUpdateField(fields);

      event.setAlarmData(data);
    } else {
      event.setAlarmData(null);
    }

    event.setLogDest("logndisplay");
    event.setLogMessage(logMsg);

    m_eventdIpcMgr.sendNow(event.getEvent());
  }
Esempio n. 3
0
  private void sendNodeDownEvent(String reductionKey, MockNode node) throws SQLException {
    EventBuilder event = MockEventUtil.createNodeDownEventBuilder("Test", node);

    if (reductionKey != null) {
      AlarmData data = new AlarmData();
      data.setAlarmType(1);
      data.setReductionKey(reductionKey);
      event.setAlarmData(data);
    } else {
      event.setAlarmData(null);
    }

    event.setLogDest("logndisplay");
    event.setLogMessage("testing");

    m_eventdIpcMgr.sendNow(event.getEvent());
  }