本文整理了Java中org.opennms.netmgt.xml.event.Events.addEvent()
方法的一些代码示例,展示了Events.addEvent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Events.addEvent()
方法的具体详情如下:
包路径:org.opennms.netmgt.xml.event.Events
类名称:Events
方法名:addEvent
暂无
代码示例来源:origin: OpenNMS/opennms
public void addAllEvents(Events events) {
if (events == null) {
return;
}
final List<Event> eventCollection = events.getEventCollection();
if (eventCollection != null) {
for (final Event e : eventCollection) {
this.addEvent(e);
}
}
}
}
代码示例来源:origin: OpenNMS/opennms
public void addEvent(final Event event) {
assertEventsExists();
this._events.addEvent(event);
}
代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.api
public void addAllEvents(Events events) {
if (events == null) {
return;
}
final List<Event> eventCollection = events.getEventCollection();
if (eventCollection != null) {
for (final Event e : eventCollection) {
this.addEvent(e);
}
}
}
}
代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.api
public void addEvent(final Event event) {
assertEventsExists();
this._events.addEvent(event);
}
代码示例来源:origin: OpenNMS/opennms
@Override
public void sendNowSync(Event event) {
Objects.requireNonNull(event);
Events events = new Events();
events.addEvent(event);
Log eventLog = new Log();
eventLog.setEvents(events);
sendNowSync(eventLog);
}
代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.daemon
@Override
public void sendNowSync(Event event) {
Objects.requireNonNull(event);
Events events = new Events();
events.addEvent(event);
Log eventLog = new Log();
eventLog.setEvents(events);
sendNowSync(eventLog);
}
代码示例来源:origin: OpenNMS/opennms
/**
* {@inheritDoc}
*
* Called by a service to send an event to other listeners.
*/
@Override
public void sendNow(Event event) {
Assert.notNull(event, "event argument cannot be null");
Events events = new Events();
events.addEvent(event);
Log eventLog = new Log();
eventLog.setEvents(events);
sendNow(eventLog);
}
代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.daemon
/**
* {@inheritDoc}
*
* Called by a service to send an event to other listeners.
*/
@Override
public void sendNow(Event event) {
Assert.notNull(event, "event argument cannot be null");
Events events = new Events();
events.addEvent(event);
Log eventLog = new Log();
eventLog.setEvents(events);
sendNow(eventLog);
}
代码示例来源:origin: OpenNMS/opennms
/** {@inheritDoc} */
@Override
public void sendNow(Event event) {
Log eventLog = new Log();
Events events = new Events();
eventLog.setEvents(events);
events.addEvent(event);
sendNow(eventLog);
}
代码示例来源:origin: OpenNMS/opennms
/**
* <p>sendAllEvents</p>
*/
public void sendAllEvents() {
if (m_events.size() > 0) {
try {
Log log = new Log();
Events events = new Events();
for (Event e : m_events) {
events.addEvent(e);
}
log.setEvents(events);
EventIpcManagerFactory.getIpcManager().sendNow(log);
} catch (Throwable e) {
LOG.info("sendAllEvents: Failed sending threshold events", e);
}
removeAllEvents();
}
}
代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.api
/**
* {@inheritDoc}
*
* This method is called to send the event out
* @exception UndeclaredThrowableException
* thrown if the send fails for any reason
*/
@Override
public void send(Event event) throws EventProxyException {
Log elog = new Log();
Events events = new Events();
events.addEvent(event);
elog.setEvents(events);
send(elog);
}
代码示例来源:origin: OpenNMS/opennms
/**
* {@inheritDoc}
*
* This method is called to send the event out
* @exception UndeclaredThrowableException
* thrown if the send fails for any reason
*/
@Override
public void send(Event event) throws EventProxyException {
Log elog = new Log();
Events events = new Events();
events.addEvent(event);
elog.setEvents(events);
send(elog);
}
代码示例来源:origin: OpenNMS/opennms
for (Iterator<Event> iter = translated.iterator(); iter.hasNext();) {
Event event = iter.next();
events.addEvent(event);
if (LOG.isDebugEnabled()) {
LOG.debug("onEvent: sended translated event: {}", EventUtils.toString(e));
代码示例来源:origin: OpenNMS/opennms
public Log toEventLog(SyslogMessageLogDTO messageLog) {
final Log elog = new Log();
final Events events = new Events();
elog.setEvents(events);
for (SyslogMessageDTO message : messageLog.getMessages()) {
try {
LOG.debug("Converting syslog message into event.");
ConvertToEvent re = new ConvertToEvent(
messageLog.getSystemId(),
messageLog.getLocation(),
messageLog.getSourceAddress(),
messageLog.getSourcePort(),
message.getBytes(),
message.getTimestamp(),
syslogdConfig
);
events.addEvent(re.getEvent());
} catch (final MessageDiscardedException e) {
LOG.info("Message discarded, returning without enqueueing event.", e);
} catch (final Throwable e) {
LOG.error("Unexpected exception while processing SyslogConnection", e);
}
}
return elog;
}
代码示例来源:origin: OpenNMS/opennms
private Log toLog(TrapLogDTO messageLog) {
final Log log = new Log();
final Events events = new Events();
log.setEvents(events);
for (TrapDTO eachMessage : messageLog.getMessages()) {
try {
final Event event = eventCreator.createEventFrom(
eachMessage,
messageLog.getSystemId(),
messageLog.getLocation(),
messageLog.getTrapAddress());
if (!shouldDiscard(event)) {
if (event.getSnmp() != null) {
trapdInstrumentation.incTrapsReceivedCount(event.getSnmp().getVersion());
}
events.addEvent(event);
} else {
LOG.debug("Trap discarded due to matching event having logmsg dest == discardtraps");
trapdInstrumentation.incDiscardCount();
}
} catch (Throwable e) {
LOG.error("Unexpected error processing trap: {}", eachMessage, e);
trapdInstrumentation.incErrorCount();
}
}
return log;
}
代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.traps
private Log toLog(TrapLogDTO messageLog) {
final Log log = new Log();
final Events events = new Events();
log.setEvents(events);
for (TrapDTO eachMessage : messageLog.getMessages()) {
try {
final Event event = eventCreator.createEventFrom(
eachMessage,
messageLog.getSystemId(),
messageLog.getLocation(),
messageLog.getTrapAddress());
if (!shouldDiscard(event)) {
if (event.getSnmp() != null) {
trapdInstrumentation.incTrapsReceivedCount(event.getSnmp().getVersion());
}
events.addEvent(event);
} else {
LOG.debug("Trap discarded due to matching event having logmsg dest == discardtraps");
trapdInstrumentation.incDiscardCount();
}
} catch (Throwable e) {
LOG.error("Unexpected error processing trap: {}", eachMessage, e);
trapdInstrumentation.incErrorCount();
}
}
return log;
}
内容来源于网络,如有侵权,请联系作者删除!