com.ibm.commerce.ras
Class MessageLogEvent

java.lang.Object
  |
  +--com.ibm.commerce.ras.LogEvent
        |
        +--com.ibm.commerce.ras.MessageLogEvent

public class MessageLogEvent
extends com.ibm.commerce.ras.LogEvent

MessageLogEvent class is used to format the message text for message loggin service. Each message contains two parts: header and body.


Field Summary
static java.lang.String COPYRIGHT
          IBM copyright notice field.
 
Constructor Summary
MessageLogEvent(java.sql.Timestamp time, java.lang.String threadName, IOutputManager outputMgr, ECMessage msg, java.lang.String clsName, java.lang.String mtdName, java.lang.Object[] params)
          Constructor for MessageLogEvent.
MessageLogEvent(java.sql.Timestamp time, java.lang.String threadName, java.lang.String uniqueClientId, IOutputManager outputMgr, ECMessage msg, java.lang.String clsName, java.lang.String mtdName, java.lang.Object[] params)
          Constructor for MessageLogEvent.
 
Method Summary
protected  java.lang.String createCompactMessageHeader()
          Create the message header in compact format
 java.lang.String createMessageBody()
          Creates the message body.
protected  java.lang.String createMessageFooter()
          Create the message footer
protected  java.lang.String createMessageHeader()
          Create the message header
protected  java.lang.String doCreateHeaderExtention()
          Create header extention
 java.lang.String getCompactMessageBody()
          Builds the message body in compact format.
 java.lang.Throwable getException()
          Gets the exception of the message.
protected static java.lang.String getExceptionStackTrace(java.lang.Throwable e)
          Get the stack trace from an exception.
protected  java.lang.String getMessage()
          Retrieve the message text
 java.lang.String getMessageBody()
          Builds the message body.
protected  boolean isCompactFormat()
          Check if the compact format is used
 void print()
          Print out the message text in specified output manager
 void setException(java.lang.Throwable newException)
          Sets the exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM copyright notice field.
See Also:
Constant Field Values
Constructor Detail

MessageLogEvent

public MessageLogEvent(java.sql.Timestamp time,
                       java.lang.String threadName,
IOutputManager outputMgr,
ECMessage msg,
                       java.lang.String clsName,
                       java.lang.String mtdName,
                       java.lang.Object[] params)
Constructor for MessageLogEvent.
Parameters:
time - the timestamp of the log entry
threadName - the thread that message is generated by
outputMgr - output device to write the logs
msg - the message object
clsName - class name that generates the message
mtdName - method name that generates the message
params - the list of parameters that will be substituted into the message text

MessageLogEvent

public MessageLogEvent(java.sql.Timestamp time,
                       java.lang.String threadName,
                       java.lang.String uniqueClientId,
IOutputManager outputMgr,
ECMessage msg,
                       java.lang.String clsName,
                       java.lang.String mtdName,
                       java.lang.Object[] params)
Constructor for MessageLogEvent.
Parameters:
time - the timestamp of the log entry
threadName - the thread that message is generated by
uniqueClientId - the unique Id to represent the client; used to debug double click problem
outputMgr - output device to write the logs
msg - the message object
clsName - class name that generates the message
mtdName - method name that generates the message
params - the list of parameters that will be substituted into the message text
Method Detail

createMessageBody

public java.lang.String createMessageBody()
Creates the message body. The message body can be in either detailed or compact format.
Specified by:
createMessageBody in class com.ibm.commerce.ras.LogEvent
Returns:
formatted message body

getCompactMessageBody

public java.lang.String getCompactMessageBody()
Builds the message body in compact format.
Returns:
the message text in compact format

getException

public java.lang.Throwable getException()
Gets the exception of the message.
Returns:
exception associated to the message

getExceptionStackTrace

protected static java.lang.String getExceptionStackTrace(java.lang.Throwable e)
Get the stack trace from an exception.
Parameters:
e - exception stack trace associated to the message

getMessageBody

public java.lang.String getMessageBody()
Builds the message body. The message body includes the class, method name, severity, the translated message and exception if any.
Returns:
the message text in detailed format

setException

public void setException(java.lang.Throwable newException)
Sets the exception.
Parameters:
newException - exception object associated to the message

createCompactMessageHeader

protected java.lang.String createCompactMessageHeader()
Create the message header in compact format

createMessageFooter

protected java.lang.String createMessageFooter()
Create the message footer

createMessageHeader

protected java.lang.String createMessageHeader()
Create the message header

doCreateHeaderExtention

protected java.lang.String doCreateHeaderExtention()
Create header extention

getMessage

protected java.lang.String getMessage()
Retrieve the message text

isCompactFormat

protected boolean isCompactFormat()
Check if the compact format is used

print

public void print()
Print out the message text in specified output manager