FileDocCategorySizeDatePackage
SessionLogEntry.javaAPI DocGlassfish v2 API8872Tue May 22 16:54:44 BST 2007oracle.toplink.essentials.logging

SessionLogEntry

public class SessionLogEntry extends Object implements Serializable
SessionLogEntry is a simple container object that holds all the information pertinent to a TopLink logging event. It has a date/time stamp indicating when the event took place. It holds the session, thread, and accessor responsible for the event. And it holds whatever message was passed through to be logged.
see
SessionLog
see
DefaultSessionLog
author
Big Country
since
TOPLink/Java 3.0

Fields Summary
protected Date
date
protected transient AbstractSession
session
protected transient Thread
thread
protected transient Accessor
connection
protected String
message
protected Throwable
throwable
protected int
level
protected String
nameSpace
protected Object[]
parameters
protected boolean
shouldTranslate
Constructors Summary
public SessionLogEntry(AbstractSession session)
PUBLIC: Create a new session log entry for a session

        this.date = new Date();
        this.thread = Thread.currentThread();
        this.session = session;
        this.message = "";
        this.level = SessionLog.INFO;
    
public SessionLogEntry(AbstractSession session, Throwable throwable)
PUBLIC: Create a new session log entry for a session and an exception

        this(session);
        this.throwable = throwable;
        this.level = SessionLog.SEVERE;
    
public SessionLogEntry(AbstractSession session, String message)
PUBLIC: Create a new session log entry for a session and a message

        this(session);
        this.message = message;
    
public SessionLogEntry(AbstractSession session, String message, Accessor connection)
PUBLIC: Create a new session log entry for a session, a message and an accessor

        this(session, message);
        this.connection = connection;
    
public SessionLogEntry(int level, AbstractSession session, String message, Object[] params, Accessor connection, boolean shouldTranslate)
PUBLIC: Create a new session log entry for a request level, a session, a message and an accessor

        this(session, message, connection);
        this.level = level;
        this.parameters = params;
        this.shouldTranslate = shouldTranslate;
    
public SessionLogEntry(int level, String category, AbstractSession session, String message, Object[] params, Accessor connection, boolean shouldTranslate)
PUBLIC: Create a new session log entry for a request level, a session, a message and an accessor

        this(level, session, message, params, connection, shouldTranslate);
        this.nameSpace = category;
    
public SessionLogEntry(AbstractSession session, int level, String category, Throwable throwable)
PUBLIC: Create a new session log entry for a session, a level, a category and an exception

        this(session, throwable);
        this.level = level;
        this.nameSpace = category;
    
Methods Summary
public oracle.toplink.essentials.internal.databaseaccess.AccessorgetConnection()
PUBLIC: Return the connection that generated the log entry.

        return connection;
    
public java.util.DategetDate()
PUBLIC: Return the date of the log entry.

        return date;
    
public java.lang.ThrowablegetException()
PUBLIC: Return the exception that caused the log entry.

        return throwable;
    
public intgetLevel()
PUBLIC: Return the request level of the log entry.

        return level;
    
public java.lang.StringgetMessage()
PUBLIC: Return the log entry's message.

        return message;
    
public java.lang.StringgetNameSpace()
PUBLIC: Return the name space of the log entry.

        return nameSpace;
    
public java.lang.Object[]getParameters()
PUBLIC: Return the array of parameters to the message.

        return parameters;
    
public oracle.toplink.essentials.internal.sessions.AbstractSessiongetSession()
PUBLIC: Return the session that generated the log entry.

        return session;
    
public java.lang.ThreadgetThread()
PUBLIC: Return the thread that was active when the log entry was generated.

        return thread;
    
public booleanhasException()
PUBLIC: Return if the log entry was for an exception.

        return getException() != null;
    
public voidsetConnection(oracle.toplink.essentials.internal.databaseaccess.Accessor connection)
PUBLIC: Set the connection that generated the log entry.

        this.connection = connection;
    
public voidsetDate(java.util.Date date)
PUBLIC: Set the date of the log entry.

        this.date = date;
    
public voidsetException(java.lang.Throwable throwable)
PUBLIC: Set the exception that caused the log entry.

        this.throwable = throwable;
    
public voidsetLevel(int level)
PUBLIC: Set the request level of the log entry.

        this.level = level;
    
public voidsetMessage(java.lang.String message)
PUBLIC: Set the entry's message.

        this.message = message;
    
public voidsetNameSpace(java.lang.String nameSpace)
PUBLIC: Set the name space of the log entry.

        this.nameSpace = nameSpace;
    
public voidsetParameters(java.lang.Object[] params)
PUBLIC: Set the array of parameters to the message.

        this.parameters = params;
    
public voidsetSession(oracle.toplink.essentials.internal.sessions.AbstractSession session)
PUBLIC: Set the session that generated the log entry.

        this.session = session;
    
public voidsetShouldTranslate(boolean shouldTranslate)
PUBLIC: Set if the message should be translated.

        this.shouldTranslate = shouldTranslate;
    
public voidsetThread(java.lang.Thread thread)
PUBLIC: Set the thread that was active when the log entry was generated.

        this.thread = thread;
    
public booleanshouldTranslate()
PUBLIC: Return if the message should be translated.

        return shouldTranslate;
    
public java.lang.StringtoString()
PUBLIC: Print message.

        return oracle.toplink.essentials.internal.helper.Helper.getShortClassName(getClass()) + "(" + getMessage() + ")";