Package org.eclipse.persistence.logging
Class SessionLogEntry
java.lang.Object
org.eclipse.persistence.logging.SessionLogEntry
- All Implemented Interfaces:
Serializable
SessionLogEntry is a simple container object that holds
all the information pertinent to an EclipseLink 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 Also:
- Author:
- Big Country
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.eclipse.persistence.internal.databaseaccess.Accessor
protected Date
protected int
protected String
protected String
protected Object[]
protected org.eclipse.persistence.internal.sessions.AbstractSession
protected boolean
protected String
protected String
protected Thread
protected Throwable
-
Constructor Summary
ConstructorDescriptionSessionLogEntry
(int level, String category, org.eclipse.persistence.internal.sessions.AbstractSession session, String message, Object[] params, org.eclipse.persistence.internal.databaseaccess.Accessor connection, boolean shouldTranslate) Create a new session log entry for a request level, a category, a session, a message, parameters and an accessor.SessionLogEntry
(int level, org.eclipse.persistence.internal.sessions.AbstractSession session, String message, Object[] params, org.eclipse.persistence.internal.databaseaccess.Accessor connection, boolean shouldTranslate) Create a new session log entry for a request level, a session, a message, parameters and an accessor.SessionLogEntry
(org.eclipse.persistence.internal.sessions.AbstractSession session) Create a new session log entry for a session.SessionLogEntry
(org.eclipse.persistence.internal.sessions.AbstractSession session, int level, String category, Throwable throwable) Create a new session log entry for a session, a level, a category and an exception.SessionLogEntry
(org.eclipse.persistence.internal.sessions.AbstractSession session, String message) Create a new session log entry for a session and a message.SessionLogEntry
(org.eclipse.persistence.internal.sessions.AbstractSession session, String message, org.eclipse.persistence.internal.databaseaccess.Accessor connection) Create a new session log entry for a session, a message and an accessor.SessionLogEntry
(org.eclipse.persistence.internal.sessions.AbstractSession session, Throwable throwable) Create a new session log entry for a session and a throwable. -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.persistence.internal.databaseaccess.Accessor
Return the connection that generated the log entry.getDate()
Return the date of the log entry.Return the exception that caused the log entry.int
getLevel()
Return the request level of the log entry.Return the log entry's message.Return the name space of the log entry.Object[]
org.eclipse.persistence.internal.sessions.AbstractSession
Return the session that generated the log entry.Return the thread that was active when the log entry was generated.boolean
boolean
void
setConnection
(org.eclipse.persistence.internal.databaseaccess.Accessor connection) Set the connection that generated the log entry.void
Set the date of the log entry.void
setException
(Throwable throwable) Set the exception that caused the log entry.void
setLevel
(int level) Set the request level of the log entry.void
setMessage
(String message) Set the entry's message.void
setNameSpace
(String nameSpace) Set the name space of the log entry.void
setParameters
(Object[] params) Set the array of parameters to the message.void
setSession
(org.eclipse.persistence.internal.sessions.AbstractSession session) Set the session that generated the log entry.void
setShouldTranslate
(boolean shouldTranslate) Set if the message should be translated.void
setSourceClassName
(String sourceClassName) Set the source class name to the message.void
setSourceMethodName
(String sourceMethodName) Set the source method name to the message.void
Set the thread that was active when the log entry was generated.boolean
toString()
-
Field Details
-
date
-
session
protected transient org.eclipse.persistence.internal.sessions.AbstractSession session -
thread
-
connection
protected transient org.eclipse.persistence.internal.databaseaccess.Accessor connection -
message
-
throwable
-
level
protected int level -
nameSpace
-
parameters
-
shouldTranslate
protected boolean shouldTranslate -
sourceClassName
-
sourceMethodName
-
-
Constructor Details
-
SessionLogEntry
public SessionLogEntry(org.eclipse.persistence.internal.sessions.AbstractSession session) Create a new session log entry for a session.- Parameters:
session
- the session
-
SessionLogEntry
public SessionLogEntry(org.eclipse.persistence.internal.sessions.AbstractSession session, Throwable throwable) Create a new session log entry for a session and a throwable.- Parameters:
session
- the sessionthrowable
- the throwable
-
SessionLogEntry
public SessionLogEntry(org.eclipse.persistence.internal.sessions.AbstractSession session, String message) Create a new session log entry for a session and a message.- Parameters:
session
- the sessionmessage
- the message
-
SessionLogEntry
public SessionLogEntry(org.eclipse.persistence.internal.sessions.AbstractSession session, String message, org.eclipse.persistence.internal.databaseaccess.Accessor connection) Create a new session log entry for a session, a message and an accessor.- Parameters:
session
- the sessionmessage
- the messageconnection
- the accessor
-
SessionLogEntry
public SessionLogEntry(int level, org.eclipse.persistence.internal.sessions.AbstractSession session, String message, Object[] params, org.eclipse.persistence.internal.databaseaccess.Accessor connection, boolean shouldTranslate) Create a new session log entry for a request level, a session, a message, parameters and an accessor.
Possible values for log level are listed in SessionLog.- Parameters:
level
- the log levelsession
- the sessionmessage
- the messageparams
- array of parametersconnection
- the accessorshouldTranslate
- true if the entry should be translated- See Also:
-
SessionLogEntry
public SessionLogEntry(int level, String category, org.eclipse.persistence.internal.sessions.AbstractSession session, String message, Object[] params, org.eclipse.persistence.internal.databaseaccess.Accessor connection, boolean shouldTranslate) Create a new session log entry for a request level, a category, a session, a message, parameters and an accessor.
Possible values for log level and category are listed in SessionLog.- Parameters:
level
- the log levelcategory
- the categorysession
- the sessionmessage
- the messageparams
- array of parametersconnection
- the accessorshouldTranslate
- true if the entry should be translated- See Also:
-
SessionLogEntry
public SessionLogEntry(org.eclipse.persistence.internal.sessions.AbstractSession session, int level, String category, Throwable throwable) Create a new session log entry for a session, a level, a category and an exception.
Possible values for log level and category are listed in SessionLog.- Parameters:
session
- the sessionlevel
- the log levelcategory
- the categorythrowable
- the exception- See Also:
-
-
Method Details
-
getConnection
public org.eclipse.persistence.internal.databaseaccess.Accessor getConnection()Return the connection that generated the log entry.- Returns:
- the connection accessor
-
getDate
Return the date of the log entry.- Returns:
- the date
-
getException
Return the exception that caused the log entry.- Returns:
- the exception
-
getMessage
Return the log entry's message.- Returns:
- the message
-
getSession
public org.eclipse.persistence.internal.sessions.AbstractSession getSession()Return the session that generated the log entry.- Returns:
- the session
-
getThread
Return the thread that was active when the log entry was generated.- Returns:
- the thread
-
getLevel
public int getLevel()Return the request level of the log entry.
Possible values for log level are listed in SessionLog.- Returns:
- the request level of the log entry
- See Also:
-
getNameSpace
Return the name space of the log entry.
Possible values for log category (a String) are listed in SessionLog.- Returns:
- the name space of the log entry
- See Also:
-
getParameters
- Returns:
- the array of parameters to the message.
-
getSourceClassName
- Returns:
- the source class name to the message
-
getSourceMethodName
- Returns:
- the source method name to the message
-
shouldTranslate
public boolean shouldTranslate()- Returns:
- if the message should be translated.
-
hasException
public boolean hasException()- Returns:
- if the log entry was for an exception.
-
hasMessage
public boolean hasMessage()- Returns:
- if the log entry has a message
-
setConnection
public void setConnection(org.eclipse.persistence.internal.databaseaccess.Accessor connection) Set the connection that generated the log entry.- Parameters:
connection
- the connection
-
setDate
Set the date of the log entry.- Parameters:
date
- the date
-
setException
Set the exception that caused the log entry.- Parameters:
throwable
- the exception
-
setMessage
Set the entry's message.- Parameters:
message
- the message
-
setSession
public void setSession(org.eclipse.persistence.internal.sessions.AbstractSession session) Set the session that generated the log entry.- Parameters:
session
- the session
-
setThread
Set the thread that was active when the log entry was generated.- Parameters:
thread
- the thread
-
setLevel
public void setLevel(int level) Set the request level of the log entry.
Possible values for log level are listed in SessionLog.- Parameters:
level
- the log level- See Also:
-
setNameSpace
Set the name space of the log entry.
Possible values for log category (a String) are listed in SessionLog.- Parameters:
nameSpace
- the log category- See Also:
-
setParameters
Set the array of parameters to the message.- Parameters:
params
- array of parameters
-
setShouldTranslate
public void setShouldTranslate(boolean shouldTranslate) Set if the message should be translated.- Parameters:
shouldTranslate
- true if the message should be translated, false otherwise
-
setSourceClassName
Set the source class name to the message.- Parameters:
sourceClassName
- source class name
-
setSourceMethodName
Set the source method name to the message.- Parameters:
sourceMethodName
- source method name
-
toString
-