本文整理了Java中org.opennms.netmgt.xml.event.Event.toString()
方法的一些代码示例,展示了Event.toString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.toString()
方法的具体详情如下:
包路径:org.opennms.netmgt.xml.event.Event
类名称:Event
方法名:toString
暂无
代码示例来源:origin: OpenNMS/opennms
private void sendEvent(Event e){
LOG.debug("sending event to opennms. event.tostring():" + e.toString());
try {
if (eventProxy != null) {
eventProxy.send(e);
} else {
LOG.error("OpenNMS event proxy not set - cannot send events to opennms");
}
} catch (EventProxyException ex) {
throw new RuntimeException( "event proxy problem sending Memo Change Event to OpenNMS:",ex);
}
}
代码示例来源:origin: org.opennms.plugins/opennms-es-rest.main-module
@Override
public void sendNow(Event event) {
LOG.debug("Event to send received: " + event.toString());
if (eventToIndex!=null) eventToIndex.forwardEvents(Collections.singletonList(event));
}
代码示例来源:origin: OpenNMS/opennms
private void sendEvent(Event e){
LOG.debug("sending event to opennms. event.tostring():" + e.toString());
try {
if (eventProxy != null) {
eventProxy.send(e);
} else {
LOG.error("OpenNMS event proxy not set - cannot send events to opennms");
}
} catch (EventProxyException ex) {
throw new RuntimeException(
"event proxy problem sending AlarmChangeNotificationEvent to OpenNMS:",
ex);
}
}
代码示例来源:origin: org.opennms.plugins/opennms-es-rest.main-module
@Override
public void sendNow(Event event) {
// if no elasticSearchInitialiser defined then just run
// else check if initialised then send event
if (elasticSearchInitialiser != null && elasticSearchInitialiser.isInitialised()) {
producer.send(event);
} else {
if (LOG.isDebugEnabled())
LOG.debug("Not sending event received: Elasticsearch is not initialised"
+ "\n event:" + event.toString());
}
}
代码示例来源:origin: org.opennms.plugins/opennms-es-rest.main-module
if (LOG.isDebugEnabled()) LOG.debug("Sending Alarm MEMO Event to ES:"+event.toString());
LOG.debug("Sending Alarm Created Event to ES:"+event.toString());
} else if( ALARM_DELETED_EVENT.equals(uei)){
LOG.debug("Sending Alarm Deleted Event to ES:"+event.toString());
} else if (ALARM_SEVERITY_CHANGED_EVENT.equals(uei)){
LOG.debug("Sending Alarm Changed Severity Event to ES:"+event.toString());
} else if (ALARM_CLEARED_EVENT.equals(uei)){
LOG.debug("Sending Alarm Cleared Event to ES:"+event.toString());
} else if (ALARM_ACKNOWLEDGED_EVENT.equals(uei)){
LOG.debug("Sending Alarm Acknowledged Event to ES:"+event.toString());
} else if (ALARM_UNACKNOWLEDGED_EVENT.equals(uei)){
LOG.debug("Sending Alarm Unacknowledged Event to ES:"+event.toString());
} else if (ALARM_SUPPRESSED_EVENT.equals(uei)){
LOG.debug("Sending Alarm Suppressed Event to ES:"+event.toString());
} else if (ALARM_UNSUPPRESSED_EVENT.equals(uei)){
LOG.debug("Sending Alarm Unsuppressed Event to ES:"+event.toString());
} else if (ALARM_TROUBLETICKET_STATE_CHANGE_EVENT.equals(uei)){
LOG.debug("Sending Alarm TroubleTicked state changed Event to ES:"+event.toString());
} else if (ALARM_CHANGED_EVENT.equals(uei)){
LOG.debug("Sending Alarm Changed Event to ES:"+event.toString());
retval.add(eventIndex);
} else {
if (LOG.isDebugEnabled()) LOG.debug("Not Sending Event to ES: null event.getDbid()="+event.getDbid()+ " Event="+event.toString());
代码示例来源:origin: OpenNMS/opennms
@EventHandler(uei=EventConstants.NODE_GAINED_INTERFACE_EVENT_UEI)
@Transactional
public void handleNodeGainedInterface(Event event) {
LOG.debug("Received event: {}", event.getUei());
Long nodeId = event.getNodeid();
if (nodeId == null) {
LOG.error(EventConstants.NODE_GAINED_INTERFACE_EVENT_UEI + ": Event with no node ID: " + event.toString());
return;
}
OnmsNode node = m_nodeDao.get(nodeId.intValue());
if (node == null) {
LOG.warn(EventConstants.NODE_GAINED_INTERFACE_EVENT_UEI + ": Cannot find node in DB: " + nodeId);
return;
}
// add to known nodes
m_cache.setNodeId(node.getLocation().getLocationName(), event.getInterfaceAddress(), nodeId.intValue());
}
代码示例来源:origin: OpenNMS/opennms
@EventHandler(uei=EventConstants.INTERFACE_DELETED_EVENT_UEI)
@Transactional
public void handleInterfaceDeleted(Event event) {
LOG.debug("Received event: {}", event.getUei());
Long nodeId = event.getNodeid();
if (nodeId == null) {
LOG.error(EventConstants.INTERFACE_DELETED_EVENT_UEI + ": Event with no node ID: " + event.toString());
return;
}
OnmsNode node = m_nodeDao.get(nodeId.intValue());
if (node == null) {
LOG.warn(EventConstants.INTERFACE_DELETED_EVENT_UEI + ": Cannot find node in DB: " + nodeId);
return;
}
// remove from known nodes
m_cache.removeNodeId(node.getLocation().getLocationName(), event.getInterfaceAddress(), nodeId.intValue());
}
代码示例来源:origin: org.opennms.plugins/opennms-es-rest.main-module
LOG.debug(event.toString());
retrievedEvents.add(event);
代码示例来源: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: OpenNMS/opennms
private void broadcast(Log eventLog) {
if (LOG.isTraceEnabled()) {
for (Event event : eventLog.getEvents().getEventCollection()) {
LOG.trace("Processing a syslog to event dispatch", event.toString());
String uuid = event.getUuid();
LOG.trace("Event {");
代码示例来源:origin: OpenNMS/opennms
LOG.error("No alarmid param - cannot create alarm Elasticsearch record from event content:"+ event.toString());
} else{
String id = alarmValues.get("alarmid").toString();
代码示例来源:origin: org.opennms.plugins/opennms-es-rest.main-module
if(LOG.isDebugEnabled()) LOG.debug("using local time because no event creation time for event.toString: "+ event.toString());
cal.setTime(new Date());
代码示例来源: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: org.opennms.plugins/opennms-es-rest.main-module
LOG.error("No alarmid param - cannot create alarm Elasticsearch record from event content:"+ event.toString());
} else{
String id = alarmValues.get("alarmid").toString();
代码示例来源:origin: org.opennms.features/org.opennms.features.opennms-es-rest
LOG.error("No alarmid param - cannot create alarm Elasticsearch record from event content:"+ event.toString());
} else{
String id = alarmValues.get("alarmid").toString();
代码示例来源:origin: OpenNMS/opennms
throw new IllegalArgumentException("Event is not an a \"configure SNMP\" event: "+event.toString());
代码示例来源:origin: OpenNMS/opennms
LOG.error(EventConstants.INTERFACE_REPARENTED_EVENT_UEI + ": Event with no node ID: " + event.toString());
return;
LOG.error(EventConstants.INTERFACE_REPARENTED_EVENT_UEI + ": Event with no node ID: " + event.toString());
return;
内容来源于网络,如有侵权,请联系作者删除!