Top Description Fields Constructors Methods
org.eclipse.persistence.logging

public Class SessionLogEntry

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable, java.util.Date, org.eclipse.persistence.internal.databaseaccess.Accessor, org.eclipse.persistence.internal.sessions.AbstractSession

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.
Author
Big Country
Since
TOPLink/Java 3.0
See Also
SessionLog, DefaultSessionLog

Field Summary

Modifier and TypeField and Description
protected transient Accessor
protected Date
protected int
protected String
protected String
protected Object[]
protected transient AbstractSession
protected boolean
protected String
protected String
protected transient Thread
protected Throwable

Constructor Summary

AccessConstructor and Description
public
SessionLogEntry(AbstractSession
the session
session
)

Create a new session log entry for a session.

public
SessionLogEntry(AbstractSession
the session
session
,
Throwable
the throwable
throwable
)

Create a new session log entry for a session and a throwable.

public
SessionLogEntry(AbstractSession
the session
session
,
String
the message
message
)

Create a new session log entry for a session and a message.

public
SessionLogEntry(AbstractSession
the session
session
,
String
the message
message
,
Accessor
the accessor
connection
)

Create a new session log entry for a session, a message and an accessor.

public
SessionLogEntry(int
the log level
level
,
AbstractSession
the session
session
,
String
the message
message
,
Object[]
array of parameters
params
,
Accessor
the accessor
connection
,
boolean
true if the entry should be translated
shouldTranslate
)

Create a new session log entry for a request level, a session, a message, parameters and an accessor.

public
SessionLogEntry(int
the log level
level
,
String
the category
category
,
AbstractSession
the session
session
,
String
the message
message
,
Object[]
array of parameters
params
,
Accessor
the accessor
connection
,
boolean
true if the entry should be translated
shouldTranslate
)

Create a new session log entry for a request level, a category, a session, a message, parameters and an accessor.

public
SessionLogEntry(AbstractSession
the session
session
,
int
the log level
level
,
String
the category
category
,
Throwable
the exception
throwable
)

Create a new session log entry for a session, a level, a category and an exception.

Method Summary

Modifier and TypeMethod and Description
public Accessor

Returns:

the connection accessor
getConnection
()

Return the connection that generated the log entry.

public Date

Returns:

the date
getDate
()

Return the date of the log entry.

public Throwable

Returns:

the exception
getException
()

Return the exception that caused the log entry.

public int

Returns:

the request level of the log entry
getLevel
()

Return the request level of the log entry.

public String

Returns:

the message
getMessage
()

Return the log entry's message.

public String

Returns:

the name space of the log entry
getNameSpace
()

Return the name space of the log entry.

public Object[]

Returns:

the array of parameters to the message.
getParameters
()

public AbstractSession

Returns:

the session
getSession
()

Return the session that generated the log entry.

public String

Returns:

the source class name to the message
getSourceClassName
()

public String

Returns:

the source method name to the message
getSourceMethodName
()

public Thread

Returns:

the thread
getThread
()

Return the thread that was active when the log entry was generated.

public boolean

Returns:

if the log entry was for an exception.
hasException
()

public boolean

Returns:

if the log entry has a message
hasMessage
()

public void
setConnection(Accessor
the connection
connection
)

Set the connection that generated the log entry.

public void
setDate(Date
the date
date
)

Set the date of the log entry.

public void
setException(Throwable
the exception
throwable
)

Set the exception that caused the log entry.

public void
setLevel(int
the log level
level
)

Set the request level of the log entry.

public void
setMessage(String
the message
message
)

Set the entry's message.

public void
setNameSpace(String
the log category
nameSpace
)

Set the name space of the log entry.

public void
setParameters(Object[]
array of parameters
params
)

Set the array of parameters to the message.

public void
setSession(AbstractSession
the session
session
)

Set the session that generated the log entry.

public void
setShouldTranslate(boolean
true if the message should be translated, false otherwise
shouldTranslate
)

Set if the message should be translated.

public void
setSourceClassName(String
source class name
sourceClassName
)

Set the source class name to the message.

public void
setSourceMethodName(String
source method name
sourceMethodName
)

Set the source method name to the message.

public void
setThread(Thread
the thread
thread
)

Set the thread that was active when the log entry was generated.

public boolean

Returns:

if the message should be translated.
shouldTranslate
()

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

connectionback to summary
protected transient Accessor connection
dateback to summary
protected Date date
levelback to summary
protected int level
messageback to summary
protected String message
nameSpaceback to summary
protected String nameSpace
parametersback to summary
protected Object[] parameters
sessionback to summary
protected transient AbstractSession session
shouldTranslateback to summary
protected boolean shouldTranslate
sourceClassNameback to summary
protected String sourceClassName
sourceMethodNameback to summary
protected String sourceMethodName
threadback to summary
protected transient Thread thread
throwableback to summary
protected Throwable throwable

Constructor Detail

SessionLogEntryback to summary
public SessionLogEntry(AbstractSession session)

Create a new session log entry for a session.

Parameters
session:AbstractSession

the session

SessionLogEntryback to summary
public SessionLogEntry(AbstractSession session, Throwable throwable)

Create a new session log entry for a session and a throwable.

Parameters
session:AbstractSession

the session

throwable:Throwable

the throwable

SessionLogEntryback to summary
public SessionLogEntry(AbstractSession session, String message)

Create a new session log entry for a session and a message.

Parameters
session:AbstractSession

the session

message:String

the message

SessionLogEntryback to summary
public SessionLogEntry(AbstractSession session, String message, Accessor connection)

Create a new session log entry for a session, a message and an accessor.

Parameters
session:AbstractSession

the session

message:String

the message

connection:Accessor

the accessor

SessionLogEntryback to summary
public SessionLogEntry(int level, AbstractSession session, String message, Object[] params, 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:int

the log level

session:AbstractSession

the session

message:String

the message

params:Object[]

array of parameters

connection:Accessor

the accessor

shouldTranslate:boolean

true if the entry should be translated

See Also
SessionLog
SessionLogEntryback to summary
public SessionLogEntry(int level, String category, AbstractSession session, String message, Object[] params, 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:int

the log level

category:String

the category

session:AbstractSession

the session

message:String

the message

params:Object[]

array of parameters

connection:Accessor

the accessor

shouldTranslate:boolean

true if the entry should be translated

See Also
SessionLog
SessionLogEntryback to summary
public SessionLogEntry(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:AbstractSession

the session

level:int

the log level

category:String

the category

throwable:Throwable

the exception

See Also
SessionLog

Method Detail

getConnectionback to summary
public Accessor getConnection()

Return the connection that generated the log entry.

Returns:Accessor

the connection accessor

getDateback to summary
public Date getDate()

Return the date of the log entry.

Returns:Date

the date

getExceptionback to summary
public Throwable getException()

Return the exception that caused the log entry.

Returns:Throwable

the exception

getLevelback to summary
public int getLevel()

Return the request level of the log entry.
Possible values for log level are listed in SessionLog.

Returns:int

the request level of the log entry

See Also
SessionLog
getMessageback to summary
public String getMessage()

Return the log entry's message.

Returns:String

the message

getNameSpaceback to summary
public String getNameSpace()

Return the name space of the log entry.
Possible values for log category (a String) are listed in SessionLog.

Returns:String

the name space of the log entry

See Also
SessionLog
getParametersback to summary
public Object[] getParameters()
Returns:Object[]

the array of parameters to the message.

getSessionback to summary
public AbstractSession getSession()

Return the session that generated the log entry.

Returns:AbstractSession

the session

getSourceClassNameback to summary
public String getSourceClassName()
Returns:String

the source class name to the message

getSourceMethodNameback to summary
public String getSourceMethodName()
Returns:String

the source method name to the message

getThreadback to summary
public Thread getThread()

Return the thread that was active when the log entry was generated.

Returns:Thread

the thread

hasExceptionback to summary
public boolean hasException()
Returns:boolean

if the log entry was for an exception.

hasMessageback to summary
public boolean hasMessage()
Returns:boolean

if the log entry has a message

setConnectionback to summary
public void setConnection(Accessor connection)

Set the connection that generated the log entry.

Parameters
connection:Accessor

the connection

setDateback to summary
public void setDate(Date date)

Set the date of the log entry.

Parameters
date:Date

the date

setExceptionback to summary
public void setException(Throwable throwable)

Set the exception that caused the log entry.

Parameters
throwable:Throwable

the exception

setLevelback to summary
public void setLevel(int level)

Set the request level of the log entry.
Possible values for log level are listed in SessionLog.

Parameters
level:int

the log level

See Also
SessionLog
setMessageback to summary
public void setMessage(String message)

Set the entry's message.

Parameters
message:String

the message

setNameSpaceback to summary
public void setNameSpace(String nameSpace)

Set the name space of the log entry.
Possible values for log category (a String) are listed in SessionLog.

Parameters
nameSpace:String

the log category

See Also
SessionLog
setParametersback to summary
public void setParameters(Object[] params)

Set the array of parameters to the message.

Parameters
params:Object[]

array of parameters

setSessionback to summary
public void setSession(AbstractSession session)

Set the session that generated the log entry.

Parameters
session:AbstractSession

the session

setShouldTranslateback to summary
public void setShouldTranslate(boolean shouldTranslate)

Set if the message should be translated.

Parameters
shouldTranslate:boolean

true if the message should be translated, false otherwise

setSourceClassNameback to summary
public void setSourceClassName(String sourceClassName)

Set the source class name to the message.

Parameters
sourceClassName:String

source class name

setSourceMethodNameback to summary
public void setSourceMethodName(String sourceMethodName)

Set the source method name to the message.

Parameters
sourceMethodName:String

source method name

setThreadback to summary
public void setThread(Thread thread)

Set the thread that was active when the log entry was generated.

Parameters
thread:Thread

the thread

shouldTranslateback to summary
public boolean shouldTranslate()
Returns:boolean

if the message should be translated.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override