org.opennms.netmgt.eventd.processor
Class JdbcEventWriter

java.lang.Object
  extended by org.opennms.netmgt.eventd.processor.AbstractJdbcPersister
      extended by org.opennms.netmgt.eventd.processor.JdbcEventWriter
All Implemented Interfaces:
EventProcessor, org.springframework.beans.factory.InitializingBean

public final class JdbcEventWriter
extends AbstractJdbcPersister
implements EventProcessor, org.springframework.beans.factory.InitializingBean

EventWriter loads the information in each 'Event' into the database. While loading mutiple values of the same element into a single DB column, the mutiple values are delimited by MULTIPLE_VAL_DELIM. When an element and its attribute are loaded into a single DB column, the value and the attribute are separated by a DB_ATTRIB_DELIM. When using delimiters to append values, if the values already have the delimiter, the delimiter in the value is escaped as in URLs. Values for the ' ' block are loaded with each parm name and parm value delimited with the NAME_VAL_DELIM.

Author:
Sowmya Nataraj , OpenNMS.org
See Also:
Constants.MULTIPLE_VAL_DELIM, Constants.DB_ATTRIB_DELIM, Constants.NAME_VAL_DELIM

Field Summary
 
Fields inherited from class org.opennms.netmgt.eventd.processor.AbstractJdbcPersister
EVENT_ACKUSER_FIELD_SIZE, EVENT_AUTOACTION_FIELD_SIZE, EVENT_CORRELATION_FIELD_SIZE, EVENT_DESCR_FIELD_SIZE, EVENT_DPNAME_FIELD_SIZE, EVENT_FORWARD_FIELD_SIZE, EVENT_HOST_FIELD_SIZE, EVENT_INTERFACE_FIELD_SIZE, EVENT_LOGGRP_FIELD_SIZE, EVENT_LOGMSG_FIELD_SIZE, EVENT_MOUSEOVERTEXT_FIELD_SIZE, EVENT_OPERACTION_FIELD_SIZE, EVENT_OPERACTION_MENU_FIELD_SIZE, EVENT_OPERINSTRUCT_FIELD_SIZE, EVENT_PATHOUTAGE_FIELD_SIZE, EVENT_SNMP_FIELD_SIZE, EVENT_SNMPHOST_FIELD_SIZE, EVENT_SOURCE_FIELD_SIZE, EVENT_TTICKET_FIELD_SIZE, EVENT_UEI_FIELD_SIZE, EVENT_X733_ALARMTYPE_SIZE, MSG_NO, MSG_YES
 
Constructor Summary
JdbcEventWriter()
           
 
Method Summary
protected  String getEventHost(Event event, Connection connection)
           
 void process(Header eventHeader, Event event)
          The method that inserts the event into the database
 
Methods inherited from class org.opennms.netmgt.eventd.processor.AbstractJdbcPersister
afterPropertiesSet, checkEventSanityAndDoWeProcess, getDataSource, getEventdServiceManager, getEventTime, getGetNextIdString, getNextId, getServiceID, log, set, set, set, set, setDataSource, setEventdServiceManager, setGetNextIdString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
 

Constructor Detail

JdbcEventWriter

public JdbcEventWriter()
Method Detail

process

public void process(Header eventHeader,
                    Event event)
             throws SQLException,
                    org.springframework.dao.DataAccessException
The method that inserts the event into the database

Specified by:
process in interface EventProcessor
Parameters:
eventHeader - the event header
event - the actual event to be inserted
Throws:
SQLException
org.springframework.dao.DataAccessException

getEventHost

protected String getEventHost(Event event,
                              Connection connection)
Parameters:
event -
Returns:


Copyright © 2009. All Rights Reserved.