本文整理了Java中org.opennms.netmgt.xml.event.Event.getSeverity()
方法的一些代码示例,展示了Event.getSeverity()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.getSeverity()
方法的具体详情如下:
包路径:org.opennms.netmgt.xml.event.Event
类名称:Event
方法名:getSeverity
[英]Returns the value of field 'severity'. The field 'severity' has the following description: The event severity
[中]
代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.daemon
@Override
public String getValue(String parm, String parsedParm, Event event, EventUtil eventUtil) {
return event.getSeverity();
}
},
代码示例来源:origin: OpenNMS/opennms
@Override
public String getValue(String parm, String parsedParm, Event event, EventUtil eventUtil) {
return event.getSeverity();
}
},
代码示例来源:origin: stackoverflow.com
import org.apache.fop.events.Event;
import org.apache.fop.events.EventFormatter;
import org.apache.fop.events.EventListener;
import org.apache.fop.events.model.EventSeverity;
/** A simple event listener that writes the events to stdout and stderr. */
public class SysOutEventListener implements EventListener {
/** {@inheritDoc} */
public void processEvent(Event event) {
String msg = EventFormatter.format(event);
EventSeverity severity = event.getSeverity();
if (severity == EventSeverity.INFO) {
System.out.println("[INFO ] " + msg);
} else if (severity == EventSeverity.WARN) {
System.out.println("[WARN ] " + msg);
} else if (severity == EventSeverity.ERROR) {
System.err.println("[ERROR] " + msg);
} else if (severity == EventSeverity.FATAL) {
System.err.println("[FATAL] " + msg);
} else {
assert false;
}
}
}
代码示例来源:origin: OpenNMS/opennms
public InMemoryEventBean(Event event) {
this.event = Objects.requireNonNull(event);
this.severity = ModelMappers.toSeverity(OnmsSeverity.get(event.getSeverity()));
this.parameters = ImmutableList.copyOf(event.getParmCollection().stream()
.filter(Objects::nonNull) // Skip null parameters
.map(EventParameterBean::new)
.collect(Collectors.toList()));
}
代码示例来源:origin: org.opennms.plugins/opennms-es-rest.main-module
body.put("servicename", event.getService());
body.put("eventseverity_text", event.getSeverity());
body.put("eventseverity", Integer.toString(OnmsSeverity.get(event.getSeverity()).getId()));
代码示例来源:origin: OpenNMS/opennms
body.put("servicename", event.getService());
body.put("eventseverity_text", event.getSeverity());
body.put("eventseverity", Integer.toString(OnmsSeverity.get(event.getSeverity()).getId()));
代码示例来源:origin: org.opennms.features/org.opennms.features.opennms-es-rest
body.put("servicename", event.getService());
body.put("eventseverity_text", event.getSeverity());
body.put("eventseverity", Integer.toString(OnmsSeverity.get(event.getSeverity()).getId()));
代码示例来源:origin: OpenNMS/opennms
LOG.trace("Checking event severity: {} against notification severity: {}", curNotif.getEventSeverity().orElse(null), event.getSeverity());
} else if (event.getSeverity().toLowerCase().matches(curNotif.getEventSeverity().get().toLowerCase())) {
LOG.debug("Event severity: {} did not match notification severity: {}", curNotif.getEventSeverity().orElse(null), event.getSeverity());
continue;
代码示例来源:origin: OpenNMS/opennms
b.append(" Service: " + event.getService() + "\n");
if (event.getSeverity() != null) {
b.append(" Severity: " + event.getSeverity() + "\n");
代码示例来源:origin: OpenNMS/opennms
String syslogMessage = getTranslatedMessage(event, node, msgFormat);
LOG.debug("Determining LOG_LEVEL for event: {}", event.getDbid());
int level = SyslogUtils.determineLogLevel(OnmsSeverity.get(event.getSeverity()));
LOG.debug("Forwarding event: {} via syslog to destination: {}", event.getDbid(), destination.getName());
instance.log(level, syslogMessage);
代码示例来源:origin: OpenNMS/opennms
new Timestamp(e.getCreationTime().getTime()),
new Timestamp(e.getTime().getTime()),
Integer.valueOf(OnmsSeverity.get(e.getSeverity()).getId()),
(e.hasNodeid() ? new Long(e.getNodeid()) : null),
e.getInterface(),
代码示例来源:origin: org.opennms.core.test-api/org.opennms.core.test-api.db
new Timestamp(e.getCreationTime().getTime()),
new Timestamp(e.getTime().getTime()),
Integer.valueOf(OnmsSeverity.get(e.getSeverity()).getId()),
(e.hasNodeid() ? new Long(e.getNodeid()) : null),
e.getInterface(),
代码示例来源:origin: OpenNMS/opennms
} else
snmpTrapHelper.addVarBinding(trap, ".1.3.6.1.4.1.5813.20.1.17.0", "OctetString", "text", "null");
if (severity == null && event.getSeverity() != null)
snmpTrapHelper.addVarBinding(trap, ".1.3.6.1.4.1.5813.20.1.18.0", "OctetString", "text", event.getSeverity());
else if (severity != null)
snmpTrapHelper.addVarBinding(trap, ".1.3.6.1.4.1.5813.20.1.18.0", "OctetString", "text", severity);
代码示例来源:origin: OpenNMS/opennms
ovent.setEventSeverity(OnmsSeverity.get(event.getSeverity()).getId());
代码示例来源:origin: OpenNMS/opennms
EventConstants.TYPE_SNMP_OCTET_STRING, event.getService());
addVarBinding(trapBuilder, ".1.3.6.1.4.1.5813.20.1.18.0", // OPENNMS-MIB::openNMS-event-severity
EventConstants.TYPE_SNMP_OCTET_STRING, event.getSeverity());
addVarBinding(trapBuilder, ".1.3.6.1.4.1.5813.20.2.1.1.0", // OPENNMS-MIB::tl1amRawMessage
EventConstants.TYPE_SNMP_OCTET_STRING, AbstractEventUtil.getInstance().expandParms("%parm[raw-message]%", event));
代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.daemon
ovent.setEventSeverity(OnmsSeverity.get(event.getSeverity()).getId());
代码示例来源:origin: org.opennms/opennms-dao-mock
throw new EventProcessorException(e);
oe.setSeverityLabel(event.getSeverity());
oe.setEventSnmp(SnmpInfo.format(event.getSnmp(), EVENT_SNMP_FIELD_SIZE));
oe.setEventSnmpHost(EventDatabaseConstants.format(event.getSnmphost(), EVENT_SNMPHOST_FIELD_SIZE));
代码示例来源:origin: OpenNMS/opennms
throw new EventProcessorException(e);
oe.setSeverityLabel(event.getSeverity());
oe.setEventSnmp(SnmpInfo.format(event.getSnmp(), EVENT_SNMP_FIELD_SIZE));
oe.setEventSnmpHost(EventDatabaseConstants.format(event.getSnmphost(), EVENT_SNMPHOST_FIELD_SIZE));
代码示例来源:origin: OpenNMS/opennms
.setUei(event.getUei())
.setSource(event.getSource())
.setSeverity(toSeverity(OnmsSeverity.get(event.getSeverity())))
.setLabel(eventConfDao.getEventLabel(event.getUei()));
if (event.getDescr() != null) {
代码示例来源:origin: org.opennms.features.kafka/org.opennms.features.kafka.producer
.setUei(event.getUei())
.setSource(event.getSource())
.setSeverity(toSeverity(OnmsSeverity.get(event.getSeverity())))
.setLabel(eventConfDao.getEventLabel(event.getUei()));
if (event.getDescr() != null) {
内容来源于网络,如有侵权,请联系作者删除!