|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opennms.bb.dp.eventd.EventWriter
EventWriter loads the information in each 'EventBlock' into the database Once the events are added to the database, they are sent out via JSDT for other processes (such as actiond) to read
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 '
#MULTIPLE_VAL_DELIM
,
#DB_ATTRIB_DELIM
,
#escapeDelimiter()
,
#NAME_VAL_DELIM
Field Summary | |
private com.sun.media.jsdt.Channel |
m_channel
The JSDT channel |
private com.sun.media.jsdt.Client |
m_client
The JSDT client |
private Event |
m_event
The current event that is to be written |
private EventHeader |
m_header
The event header |
Constructor Summary | |
EventWriter(EventHeader header,
Event event,
com.sun.media.jsdt.Client client,
com.sun.media.jsdt.Channel channel)
Constructs an EventWriter thread |
Method Summary | |
private void |
add(Connection db)
Insert values into the EVENTS table |
void |
dbRun(Connection connection)
The method that starts the processing for this object |
Event |
getEvent()
Return the event serialzed to the database. |
EventHeader |
getHeader()
Return the event header used during serialzation to the database. |
void |
run()
The run method is invoked to send the new serialized event to other listening applications using JSDT. |
private void |
set(PreparedStatement stmt,
int ndx,
int value)
Sets the statement up for an interger type. |
private void |
set(PreparedStatement stmt,
int ndx,
String value)
Sets the statement up for an interger type. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private Event m_event
private EventHeader m_header
private com.sun.media.jsdt.Client m_client
private com.sun.media.jsdt.Channel m_channel
Constructor Detail |
public EventWriter(EventHeader header, Event event, com.sun.media.jsdt.Client client, com.sun.media.jsdt.Channel channel)
eventBlock
- the event to be 'persisted'channel
- JSDT channel to be used to send events out once they are added to the databaseclient
- JSDT client ID for this threadMethod Detail |
private void set(PreparedStatement stmt, int ndx, String value) throws SQLException
stmt
- The statement to add the value to.ndx
- The ndx for the value.value
- The value to add to the statement.SQLException
- Thrown if there is an error
adding the value to the statement.private void set(PreparedStatement stmt, int ndx, int value) throws SQLException
stmt
- The statement to add the value to.ndx
- The ndx for the value.value
- The value to add to the statement.SQLException
- Thrown if there is an error
adding the value to the statement.private void add(Connection db) throws SQLException
SQLException
- Thrown if there is an error adding
the event to the database.java.lang.NullPointerException
- Thrown if a required resource cannot
be found in the properties file.org.opennms.bb.events.eventd.databalocks.EventBlock
,
org.opennms.bb.events.eventd.utils.EventsParser#ATTRIB_DELIM
,
#ATTRIB_DELIM
,
#DB_ATTRIB_DELIM
,
#VALUE_TRUNCATE_INDICATOR
public void dbRun(Connection connection)
dbRun
in interface DBRunnable
connection
- the database connection to be used by this
object to add data to the DBpublic void run()
run
in interface Runnable
public EventHeader getHeader()
public Event getEvent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |