|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--arlut.csd.ganymede.DBLogEvent
This class stores a complete record of a single sub-transactional event, to be emitted to the DBLog log file, or sent to a set of users via email..
| Field Summary | |
(package private) Invid |
admin
|
(package private) java.lang.String |
adminName
|
(package private) boolean |
augmented
|
(package private) static boolean |
debug
|
(package private) java.lang.String |
description
|
(package private) java.lang.String |
eventClassToken
|
(package private) SharedStringBuffer |
multibuffer
We use this buffer everywhere in this class to avoid creating StringBuffers as much as we can. |
(package private) java.lang.String |
notifyList
|
(package private) java.util.Vector |
notifyVect
|
(package private) java.util.Vector |
objects
|
(package private) java.lang.String |
subject
|
(package private) java.util.Date |
time
|
(package private) java.lang.String |
transactionID
|
| Constructor Summary | |
DBLogEvent(java.lang.String line)
Constructor to construct a DBLogEvent from a log file line. |
|
DBLogEvent(java.lang.String line,
SharedStringBuffer multibuffer)
Constructor to construct a DBLogEvent from a log file line. |
|
DBLogEvent(java.lang.String eventClassToken,
java.lang.String description,
Invid admin,
java.lang.String adminName,
java.util.Vector objects,
java.util.Vector notifyVec)
|
|
DBLogEvent(java.lang.String eventClassToken,
java.lang.String description,
Invid admin,
java.lang.String adminName,
java.util.Vector objects,
java.util.Vector notifyVec,
SharedStringBuffer multibuffer)
|
|
DBLogEvent(java.util.Vector addresses,
java.lang.String subject,
java.lang.String description,
Invid admin,
java.lang.String adminName,
java.util.Vector objects)
Constructor to be used for a mailout event. |
|
| Method Summary | |
private SharedStringBuffer |
escapeStr(java.lang.String in)
This method makes the provided String safe for inclusion in the log file. |
void |
loadLine(java.lang.String line)
This method sets the fields for this DBLogEvent from a logfile line. Note that this method is designed to reuse as many of this DBLogEvent's fields as possible, so if external code keeps references to this.time or this.objects or this.notifyVect, that code should either not call loadLine(), or should make its own copies of those objects. |
static void |
main(java.lang.String[] argv)
Debug rig.. |
private java.lang.String |
readNextField(char[] line,
int startIndex)
scan the string for this field, decoding backslash escapes in the process |
private java.util.Vector |
readNotifyVect(char[] line,
int startIndex,
java.util.Vector result)
This method reads a vector of email addresses from a log file line |
private java.util.Vector |
readObjectVect(char[] line,
int startIndex,
java.util.Vector result)
This method reads a vector of invid's from a log file line |
private int |
scanSep(char[] line,
int startIndex)
find the index of the next field separator, taking into account escaped chars |
void |
setMailTargets(java.util.Vector mailTargets)
This method is used by DBLog to set the list of email targets that this event will need to be mailed to. |
java.lang.String |
toString()
|
void |
writeEntry(java.io.PrintWriter logWriter,
java.util.Date currentTime,
java.lang.String transactionID)
This method writes out this event to a log stream |
private void |
writeSep(java.io.PrintWriter logWriter)
Write a field separator to the log file |
private void |
writeStr(java.io.PrintWriter logWriter,
java.lang.String in)
Write a field to the log file, escaping it for safety |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
static final boolean debug
java.lang.String eventClassToken
java.lang.String description
Invid admin
java.lang.String adminName
java.util.Vector objects
java.lang.String notifyList
java.util.Vector notifyVect
java.lang.String subject
java.lang.String transactionID
java.util.Date time
boolean augmented
SharedStringBuffer multibuffer
| Constructor Detail |
public DBLogEvent(java.util.Vector addresses,
java.lang.String subject,
java.lang.String description,
Invid admin,
java.lang.String adminName,
java.util.Vector objects)
addresses - A vector of Strings listing email addresses to send notification
of this event to.eventClassToken - a short string specifying a DBObject
record describing the general category for the eventdescription - Descriptive text to be entered in the record of the eventadmin - Invid pointing to the adminPersona that fired the event, if anyadminName - String containing the name of the adminPersona that fired the event, if anyobjects - A vector of invids of objects involved in this event.
public DBLogEvent(java.lang.String eventClassToken,
java.lang.String description,
Invid admin,
java.lang.String adminName,
java.util.Vector objects,
java.util.Vector notifyVec)
eventClassToken - a short string specifying a DBObject
record describing the general category for the eventdescription - Descriptive text to be entered in the record of the eventadmin - Invid pointing to the adminPersona that fired the event, if anyadminName - String containing the name of the adminPersona that fired the event, if anyobjects - A vector of invids of objects involved in this event.notifyVec - A vector of Strings listing email addresses to send notification
of this event to.
public DBLogEvent(java.lang.String eventClassToken,
java.lang.String description,
Invid admin,
java.lang.String adminName,
java.util.Vector objects,
java.util.Vector notifyVec,
SharedStringBuffer multibuffer)
eventClassToken - a short string specifying a DBObject
record describing the general category for the eventdescription - Descriptive text to be entered in the record of the eventadmin - Invid pointing to the adminPersona that fired the event, if anyadminName - String containing the name of the adminPersona that fired the event, if anyobjects - A vector of invids of objects involved in this event.notifyVec - A vector of Strings listing email addresses to send notification
of this event to.multibuffer - A SharedStringBuffer that this event can use to avoid an extra object create.
If you provide a StringBuffer here, be aware that this object may use it both when this
object is being constructed, and by the writeEvent() method. The code that uses this
DBLogEvent may do whatever it likes with the buffer between method calls to this DBLogEvent,
but any method called on this object might clobber the buffer.
public DBLogEvent(java.lang.String line)
throws java.io.IOException
line - A line from the Ganymede log file
public DBLogEvent(java.lang.String line,
SharedStringBuffer multibuffer)
throws java.io.IOException
line - A line from the Ganymede log filemultibuffer - A SharedStringBuffer that this event can use to avoid an extra object create| Method Detail |
public void loadLine(java.lang.String line)
throws java.io.IOException
private int scanSep(char[] line,
int startIndex)
private java.lang.String readNextField(char[] line,
int startIndex)
private java.util.Vector readObjectVect(char[] line,
int startIndex,
java.util.Vector result)
line - The character array containing the Invid's to be extractedstartIndex - Where to start scanning the Invid's from in the lineresult - The vector to place the results in, or null if this
method should create its own result vector.
private java.util.Vector readNotifyVect(char[] line,
int startIndex,
java.util.Vector result)
line - The character array containing the addresses's to be extractedstartIndex - Where to start scanning the addresses's from in the lineresult - The vector to place the results in, or null if this
method should create its own result vector.
public void writeEntry(java.io.PrintWriter logWriter,
java.util.Date currentTime,
java.lang.String transactionID)
public void setMailTargets(java.util.Vector mailTargets)
private final void writeSep(java.io.PrintWriter logWriter)
private final void writeStr(java.io.PrintWriter logWriter,
java.lang.String in)
private final SharedStringBuffer escapeStr(java.lang.String in)
public static void main(java.lang.String[] argv)
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||