SessionLogEntrypublic class SessionLogEntry extends Object implements SerializableSessionLogEntry 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. |
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.Accessor | getConnection()PUBLIC:
Return the connection that generated the log entry.
return connection;
| public java.util.Date | getDate()PUBLIC:
Return the date of the log entry.
return date;
| public java.lang.Throwable | getException()PUBLIC:
Return the exception that caused the log entry.
return throwable;
| public int | getLevel()PUBLIC:
Return the request level of the log entry.
return level;
| public java.lang.String | getMessage()PUBLIC:
Return the log entry's message.
return message;
| public java.lang.String | getNameSpace()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.AbstractSession | getSession()PUBLIC:
Return the session that generated the log entry.
return session;
| public java.lang.Thread | getThread()PUBLIC:
Return the thread that was active when the log entry was generated.
return thread;
| public boolean | hasException()PUBLIC:
Return if the log entry was for an exception.
return getException() != null;
| public void | setConnection(oracle.toplink.essentials.internal.databaseaccess.Accessor connection)PUBLIC:
Set the connection that generated the log entry.
this.connection = connection;
| public void | setDate(java.util.Date date)PUBLIC:
Set the date of the log entry.
this.date = date;
| public void | setException(java.lang.Throwable throwable)PUBLIC:
Set the exception that caused the log entry.
this.throwable = throwable;
| public void | setLevel(int level)PUBLIC:
Set the request level of the log entry.
this.level = level;
| public void | setMessage(java.lang.String message)PUBLIC:
Set the entry's message.
this.message = message;
| public void | setNameSpace(java.lang.String nameSpace)PUBLIC:
Set the name space of the log entry.
this.nameSpace = nameSpace;
| public void | setParameters(java.lang.Object[] params)PUBLIC:
Set the array of parameters to the message.
this.parameters = params;
| public void | setSession(oracle.toplink.essentials.internal.sessions.AbstractSession session)PUBLIC:
Set the session that generated the log entry.
this.session = session;
| public void | setShouldTranslate(boolean shouldTranslate)PUBLIC:
Set if the message should be translated.
this.shouldTranslate = shouldTranslate;
| public void | setThread(java.lang.Thread thread)PUBLIC:
Set the thread that was active when the log entry was generated.
this.thread = thread;
| public boolean | shouldTranslate()PUBLIC:
Return if the message should be translated.
return shouldTranslate;
| public java.lang.String | toString()PUBLIC:
Print message.
return oracle.toplink.essentials.internal.helper.Helper.getShortClassName(getClass()) + "(" + getMessage() + ")";
|
|