示例#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());
  }
示例#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());
  }