org.opennms.netmgt.xml.event.Event.setAlarmData()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中org.opennms.netmgt.xml.event.Event.setAlarmData()方法的一些代码示例,展示了Event.setAlarmData()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.setAlarmData()方法的具体详情如下:
包路径:org.opennms.netmgt.xml.event.Event
类名称:Event
方法名:setAlarmData

Event.setAlarmData介绍

[英]Sets the value of field 'alarmData'. The field 'alarmData' has the following description: Data used to create an event.
[中]设置字段“alarmData”的值。“alarmData”字段具有以下描述:用于创建事件的数据。

代码示例

代码示例来源:origin: OpenNMS/opennms

/**
 * <p>setAlarmData</p>
 *
 * @param alarmData a {@link org.opennms.netmgt.xml.event.AlarmData} object.
 * @return a {@link org.opennms.netmgt.model.events.EventBuilder} object.
 */
public EventBuilder setAlarmData(final AlarmData alarmData) {
  if (alarmData != null) {
    m_event.setAlarmData(alarmData);
  }
  return this;
}

代码示例来源:origin: OpenNMS/opennms

private Event cloneEvent(Event srcEvent) {
  Event clonedEvent = EventTranslatorConfigFactory.cloneEvent(srcEvent);
  /* since alarmData and severity are computed based on translated information in 
   * eventd using the data from eventconf, we unset it here to eventd
   * can reset to the proper new settings.
   */ 
  clonedEvent.setAlarmData(null);
  clonedEvent.setSeverity(null);
  /* the reasoning for alarmData and severity also applies to description (see NMS-4038). */
  clonedEvent.setDescr(null);
  if (!m_mapping.getPreserveSnmpData()) { // NMS-8374
    clonedEvent.setSnmp(null);
  }
  return clonedEvent;
}

代码示例来源:origin: OpenNMS/opennms

/**
 * <p>createNodeDownEventWithReason</p>
 *
 * @param source a {@link java.lang.String} object.
 * @param node a {@link org.opennms.netmgt.mock.MockNode} object.
 * @param reason a {@link java.lang.String} object.
 * @return a {@link org.opennms.netmgt.xml.event.Event} object.
 */
public static Event createNodeDownEventWithReason(String source, MockNode node, String reason) {
  Event event = createNodeEventWithReason(source, EventConstants.NODE_DOWN_EVENT_UEI, node, reason);
  event.setSeverity(OnmsSeverity.MAJOR.getLabel());
  // <alarm-data reduction-key="%uei%:%dpname%:%nodeid%" alarm-type="1" auto-clean="false" />
  AlarmData alarmData = new AlarmData();
  alarmData.setReductionKey("%uei%:%dpname%:%nodeid%");
  alarmData.setAlarmType(1);
  alarmData.setAutoClean(false);
  event.setAlarmData(alarmData);
  return event;
}

代码示例来源:origin: OpenNMS/opennms

e.setAlarmData(alarmData);

代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.daemon

alarmData.setManagedObject(managedObject);
e.setAlarmData(alarmData);

代码示例来源:origin: OpenNMS/opennms

if (alarm.getClearKey() != null)
  ad.setClearKey(alarm.getClearKey());
event.setAlarmData(ad);
return event;

相关文章