本文整理了Java中org.opennms.netmgt.xml.event.Event.setDbid()
方法的一些代码示例,展示了Event.setDbid()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.setDbid()
方法的具体详情如下:
包路径:org.opennms.netmgt.xml.event.Event
类名称:Event
方法名:setDbid
[英]Sets the value of field 'dbid'. The field 'dbid' has the following description: The event database id
[中]设置字段“dbid”的值。字段“dbid”具有以下描述:事件数据库id
代码示例来源:origin: OpenNMS/opennms
@Override
public void writeEvent(final Event e) {
e.setDbid(m_eventId.incrementAndGet());
}
};
代码示例来源:origin: org.opennms/opennms-dao-mock
@Override
public void writeEvent(final Event e) {
e.setDbid(m_eventId.incrementAndGet());
}
};
代码示例来源: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
/**
* {@inheritDoc}
*
* The method that inserts the event into the database
*/
private void process(final Header eventHeader, final Event event) throws EventProcessorException {
LOG.debug("HibernateEventWriter: processing {}, nodeid: {}, ipaddr: {}, serviceid: {}, time: {}", event.getUei(), event.getNodeid(), event.getInterface(), event.getService(), event.getTime());
try {
final OnmsEvent ovent = createOnmsEvent(eventHeader, event);
eventDao.save(ovent);
// Update the event with the database ID of the event stored in the database
event.setDbid(ovent.getId());
} catch (DeadlockLoserDataAccessException e) {
throw new EventProcessorException("Encountered deadlock when inserting event: " + event.toString(), e);
} catch (Throwable e) {
throw new EventProcessorException("Unexpected exception while storing event: " + event.toString(), e);
}
}
代码示例来源:origin: org.opennms.features.events/org.opennms.features.events.daemon
/**
* {@inheritDoc}
*
* The method that inserts the event into the database
*/
private void process(final Header eventHeader, final Event event) throws EventProcessorException {
LOG.debug("HibernateEventWriter: processing {}, nodeid: {}, ipaddr: {}, serviceid: {}, time: {}", event.getUei(), event.getNodeid(), event.getInterface(), event.getService(), event.getTime());
try {
final OnmsEvent ovent = createOnmsEvent(eventHeader, event);
eventDao.save(ovent);
// Update the event with the database ID of the event stored in the database
event.setDbid(ovent.getId());
} catch (DeadlockLoserDataAccessException e) {
throw new EventProcessorException("Encountered deadlock when inserting event: " + event.toString(), e);
} catch (Throwable e) {
throw new EventProcessorException("Unexpected exception while storing event: " + event.toString(), e);
}
}
代码示例来源:origin: OpenNMS/opennms
e.getLogmsg() == null? null : e.getLogmsg().getContent()
};
e.setDbid(eventId);
update("insert into events (" +
"eventId, eventSource, eventUei, eventCreateTime, eventTime, eventSeverity, " +
代码示例来源:origin: org.opennms.core.test-api/org.opennms.core.test-api.db
e.getLogmsg() == null? null : e.getLogmsg().getContent()
};
e.setDbid(eventId);
update("insert into events (" +
"eventId, eventSource, eventUei, eventCreateTime, eventTime, eventSeverity, " +
代码示例来源:origin: OpenNMS/opennms
private static Event toEvent(OnmsEvent onmsEvent) {
final Event event = new Event();
if (onmsEvent.getId() != null) event.setDbid(onmsEvent.getId());
if (onmsEvent.getEventUei() != null ) event.setUei(onmsEvent.getEventUei());
if (onmsEvent.getEventCreateTime() != null ) event.setCreationTime(onmsEvent.getEventCreateTime());
代码示例来源:origin: org.opennms.plugins/opennms-es-rest.main-module
if (onmsEvent.getId()!=null) event.setDbid(onmsEvent.getId());
if (onmsEvent.getEventUei() !=null ) event.setUei(onmsEvent.getEventUei());
if (onmsEvent.getEventCreateTime() !=null ) event.setCreationTime(onmsEvent.getEventCreateTime());
代码示例来源:origin: org.opennms.features/org.opennms.features.opennms-es-rest
private static Event toEvent(OnmsEvent onmsEvent) {
final Event event = new Event();
if (onmsEvent.getId() != null) event.setDbid(onmsEvent.getId());
if (onmsEvent.getEventUei() != null ) event.setUei(onmsEvent.getEventUei());
if (onmsEvent.getEventCreateTime() != null ) event.setCreationTime(onmsEvent.getEventCreateTime());
代码示例来源:origin: OpenNMS/opennms
private Event getXMLEvent(OnmsAlarm alarm) {
Event event = new Event();
event.setDbid(alarm.getLastEvent().getId());
内容来源于网络,如有侵权,请联系作者删除!