本文整理了Java中org.opennms.netmgt.xml.event.Event.setSeverity()
方法的一些代码示例,展示了Event.setSeverity()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.setSeverity()
方法的具体详情如下:
包路径:org.opennms.netmgt.xml.event.Event
类名称:Event
方法名:setSeverity
[英]Sets the value of field 'severity'. The field 'severity' has the following description: The event severity
[中]设置字段“严重性”的值。“严重性”字段具有以下描述:事件严重性
代码示例来源:origin: OpenNMS/opennms
/**
* <p>setSeverity</p>
*
* @param severity a {@link java.lang.String} object.
* @return a {@link org.opennms.netmgt.model.events.EventBuilder} object.
*/
public EventBuilder setSeverity(final String severity) {
m_event.setSeverity(OnmsSeverity.get(severity).getLabel());
return this;
}
代码示例来源:origin: OpenNMS/opennms
@Override
public void processRow(ResultSet rs) throws SQLException {
event.setDbid(rs.getInt("eventid"));
event.setUei(rs.getString("eventuei"));
event.setNodeid(rs.getLong("nodeid"));
event.setTime(rs.getDate("eventtime"));
event.setHost(rs.getString("eventhost"));
event.setInterface(rs.getString("ipaddr"));
event.setSnmphost(rs.getString("eventsnmphost"));
event.setService(getServiceName(rs.getInt("serviceid")));
event.setCreationTime(rs.getDate("eventcreatetime"));
event.setSeverity(rs.getString("eventseverity"));
event.setPathoutage(rs.getString("eventpathoutage"));
Tticket tticket = new Tticket();
tticket.setContent(rs.getString("eventtticket"));
tticket.setState(rs.getString("eventtticketstate"));
event.setTticket(tticket);
event.setSource(rs.getString("eventsource"));
}
代码示例来源: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
if (onmsEvent.getEventUei() != null ) event.setUei(onmsEvent.getEventUei());
if (onmsEvent.getEventCreateTime() != null ) event.setCreationTime(onmsEvent.getEventCreateTime());
if (onmsEvent.getSeverityLabel() !=null ) event.setSeverity(onmsEvent.getSeverityLabel());
if (onmsEvent.getEventDescr() !=null ) event.setDescr(onmsEvent.getEventDescr());
if (onmsEvent.getEventHost() !=null ) event.setHost(onmsEvent.getEventHost());
代码示例来源:origin: org.opennms.plugins/opennms-es-rest.main-module
if (onmsEvent.getSeverityLabel() !=null ) event.setSeverity(onmsEvent.getSeverityLabel());
if (onmsEvent.getEventDescr() !=null ) event.setDescr(onmsEvent.getEventDescr());
if (onmsEvent.getEventHost()!=null ) event.setHost(onmsEvent.getEventHost());
代码示例来源:origin: org.opennms.features/org.opennms.features.opennms-es-rest
if (onmsEvent.getEventUei() != null ) event.setUei(onmsEvent.getEventUei());
if (onmsEvent.getEventCreateTime() != null ) event.setCreationTime(onmsEvent.getEventCreateTime());
if (onmsEvent.getSeverityLabel() !=null ) event.setSeverity(onmsEvent.getSeverityLabel());
if (onmsEvent.getEventDescr() !=null ) event.setDescr(onmsEvent.getEventDescr());
if (onmsEvent.getEventHost() !=null ) event.setHost(onmsEvent.getEventHost());
代码示例来源:origin: OpenNMS/opennms
e.setSeverity(null);
e.setSeverity(econf.getSeverity());
代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.daemon
e.setSeverity(null);
e.setSeverity(econf.getSeverity());
代码示例来源:origin: OpenNMS/opennms
event.setSeverity((alarm.getSeverity()).getLabel());
内容来源于网络,如有侵权,请联系作者删除!