|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.ucsb.nceas.metacat.EventLog
EventLog is used to intialize and store a log of events that occur in an application. The events are registered with the logger as they occur, but EventLog writes them to permenant storage when it is most convenient or efficient. EventLog is a Singleton as there should always be only one object for these logging events. TODO: Logging to the database needn't be synchronous with the event. Instead, a separate thread can be launched that periodically sleeps and only wakes periodically to see if metacat is idle. The log event can be cached and inserted later when the thread wakes and finds metacat idle. TODO: Write a function that archives a part of the log table to an external text file so that the log table doesn't get to big. This function should be able to be called manually or on a schedule. TODO: Write an access function that returns an XML report for a specific subset of events. Users should be able to query on principal, docid/rev, date, event, and possibly other fields.
Method Summary | |
static EventLog |
getInstance()
Return the single instance of the event log after initializing it if it wasn't previously initialized. |
java.lang.String |
getReport(java.lang.String[] ipAddress,
java.lang.String[] principal,
java.lang.String[] docid,
java.lang.String[] event,
java.sql.Timestamp startDate,
java.sql.Timestamp endDate)
Get a report of the log events that match a set of filters. |
void |
log(java.lang.String ipAddress,
java.lang.String principal,
java.lang.String docid,
java.lang.String event)
Log an event of interest to the application. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static EventLog getInstance()
public void log(java.lang.String ipAddress, java.lang.String principal, java.lang.String docid, java.lang.String event)
ipAddress
- the internet protocol address for the eventprincipal
- the principal for the event (a username, etc)docid
- the identifier of the document to which the event appliesevent
- the string code for the eventpublic java.lang.String getReport(java.lang.String[] ipAddress, java.lang.String[] principal, java.lang.String[] docid, java.lang.String[] event, java.sql.Timestamp startDate, java.sql.Timestamp endDate)
ipAddress
- the internet protocol address for the eventprincipal
- the principal for the event (a username, etc)docid
- the identifier of the document to which the event appliesevent
- the string code for the eventstartDate
- beginning of date range for queryendDate
- end of date range for query
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |