Enhydra 5.1 API

org.enhydra.servlet.debug
Class ServletTransactionRecord

java.lang.Object
  |
  +--org.enhydra.servlet.debug.ServletTransactionRecord

public class ServletTransactionRecord
extends java.lang.Object

Transaction record that describes a single servlet transaction.

Version:
$Revision: 1.1 $
Author:
Mark Diekhans

Field Summary
protected  int id
          Unique id of this transaction.
protected  ServletTransactionRecord next
          Linked used for managing the record queue.
 
Constructor Summary
protected ServletTransactionRecord(java.lang.String servletName, RequestRecord requestRecord, ResponseRecord responseRecord)
          Construct a new servlet transaction record.
 
Method Summary
protected  void addTrace(java.lang.String str)
          Add a string to the trace log.
 int getId()
          Get the id of this object Id is not set until the object is added to the queue.
 java.lang.String getPostSessionString()
          Get the string description of the session data after the request was processed.
 java.lang.String getPreSessionString()
          Get the string description of the session data before the request was processed.
 RequestRecord getRequestRecord()
          Get request record.
 ResponseRecord getResponseRecord()
          Get response record.
 java.lang.String getServletName()
          Get the name of the servlet that was sent this request.
 java.lang.String getTrace()
          Get the trace log.
protected  void setError(java.lang.Throwable error)
          Set the exception or error that the servlet threw.
 void setPostSessionString(java.lang.String desc)
          Save a string (html) description of the session data after the request was processed.
 void setPreSessionString(java.lang.String desc)
          Save a string (html) description of the session data before the request was processed.
protected  void stopTracing()
          Stop tracing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

next

protected ServletTransactionRecord next
Linked used for managing the record queue.


id

protected int id
Unique id of this transaction.

Constructor Detail

ServletTransactionRecord

protected ServletTransactionRecord(java.lang.String servletName,
                                   RequestRecord requestRecord,
                                   ResponseRecord responseRecord)
Construct a new servlet transaction record.

Parameters:
requestRecord - object used to record the request.
responseRecord - object user to record the response.
Method Detail

setError

protected void setError(java.lang.Throwable error)
Set the exception or error that the servlet threw.


getId

public int getId()
Get the id of this object Id is not set until the object is added to the queue.

Returns:
the transaction record id or a value less than zero if the record has not be added to the queue.

getServletName

public java.lang.String getServletName()
Get the name of the servlet that was sent this request.

Returns:
the name of this transaction's servlet.

getRequestRecord

public RequestRecord getRequestRecord()
Get request record.

Returns:
the request record object.

getResponseRecord

public ResponseRecord getResponseRecord()
Get response record.

Returns:
the response record object.

addTrace

protected void addTrace(java.lang.String str)
Add a string to the trace log.

Parameters:
str - string to add to the trace.

stopTracing

protected void stopTracing()
Stop tracing. Calls to addTrace() will be ignored.


getTrace

public java.lang.String getTrace()
Get the trace log.

Returns:
trace string of newline seperated entries.

setPreSessionString

public void setPreSessionString(java.lang.String desc)
Save a string (html) description of the session data before the request was processed. This call is optional, as session data only applies when the servlet being debugged is an Enhydra servlet.

Parameters:
desc - A string description of the session data. May contain HTML tags.

getPreSessionString

public java.lang.String getPreSessionString()
Get the string description of the session data before the request was processed. This is optional data, if setPreSessionString() was never called, the result will be null.

Returns:
A string (possibly with HTML tags) describing the session data before the request, or null if never set or the servlet is not an Enhydra servlet.

setPostSessionString

public void setPostSessionString(java.lang.String desc)
Save a string (html) description of the session data after the request was processed. This call is optional, as session data only applies when the servlet being debugged is an Enhydra servlet.

Parameters:
desc - A string description of the session data. May contain HTML tags.

getPostSessionString

public java.lang.String getPostSessionString()
Get the string description of the session data after the request was processed. This is optional data, if setPostSessionString() was never called, the result will be null.

Returns:
A string (possibly with HTML tags) describing the session data after the request, or null if never set or the servlet is not an Enhydra servlet.

Enhydra 5.1 API