- java.lang.Object
-
- org.eclipse.persistence.logging.SessionLogEntry
-
- All Implemented Interfaces:
Serializable
public class SessionLogEntry extends Object implements 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:
SessionLog,DefaultSessionLog, Serialized Form- Author:
- Big Country
- Since:
- TOPLink/Java 3.0
-
-
Field Summary
Fields Modifier and Type Field Description protected org.eclipse.persistence.internal.databaseaccess.AccessorconnectionDeprecated, for removal: This API element is subject to removal in a future version.UsegetConnectionId()insteadprotected DatedateDeprecated, for removal: This API element is subject to removal in a future version.protected intlevelprotected Stringmessageprotected StringnameSpaceprotected Object[]parametersprotected SessionsessionDeprecated, for removal: This API element is subject to removal in a future version.UsegetSessionId()insteadprotected booleanshouldTranslateprotected StringsourceClassNameprotected StringsourceMethodNameprotected Threadthreadprotected Throwablethrowable
-
Constructor Summary
Constructors Constructor Description SessionLogEntry(int level, String category, String sessionId, String message, Object[] params, Integer connectionId, boolean shouldTranslate)Create a new session log entry for the specified log level, category, session, message, parameters, and datasource connection identifier.SessionLogEntry(int level, String category, String sessionId, String message, Throwable throwable)Creates a new session log entry for the specified log level, category, session, message, and throwable.SessionLogEntry(int level, String category, Session session, String message, Object[] params, org.eclipse.persistence.internal.databaseaccess.Accessor connection, boolean shouldTranslate)Deprecated, for removal: This API element is subject to removal in a future version.UseSessionLogEntry(int, String, String, String, Object[], Integer, boolean)with the following parameters: sessionId set toSession.getSessionId()ornullwhensessionisnullSessionLogEntry(int level, Session session, String message, Object[] params, org.eclipse.persistence.internal.databaseaccess.Accessor connection, boolean shouldTranslate)Deprecated, for removal: This API element is subject to removal in a future version.UseSessionLogEntry(int, String, String, String, Object[], Integer, boolean)with the following parameters: category set tonullsessionId set toSession.getSessionId()ornullwhensessionisnullSessionLogEntry(Session session)Deprecated, for removal: This API element is subject to removal in a future version.UseSessionLogEntry(int, String, String, String, Throwable)with the following parameters: level set toSessionLog.INFOsessionId set toSession.getSessionId()ornullwhensessionisnullcategory set tonullmessage set to""throwable set tonullSessionLogEntry(Session session, int level, String category, Throwable throwable)Deprecated, for removal: This API element is subject to removal in a future version.UseSessionLogEntry(int, String, String, String, Throwable)with the following parameters: message set to""SessionLogEntry(Session session, String message)Deprecated, for removal: This API element is subject to removal in a future version.UseSessionLogEntry(int, String, String, String, Throwable)with the following parameters: level set toSessionLog.INFOsessionId set toSession.getSessionId()ornullwhensessionisnullcategory set tonullthrowable set tonullSessionLogEntry(Session session, String message, org.eclipse.persistence.internal.databaseaccess.Accessor connection)Deprecated, for removal: This API element is subject to removal in a future version.UseSessionLogEntry(int, String, String, String, Object[], Integer, boolean)with the following parameters: level set toSessionLog.INFOcategory set tonullsessionId set toSession.getSessionId()ornullwhensessionisnullparams set tonullconnectionId set toAccessor.getConnectionId()ornullwhenconnectionisnullshouldTranslate set tofalseSessionLogEntry(Session session, Throwable throwable)Deprecated, for removal: This API element is subject to removal in a future version.UseSessionLogEntry(int, String, String, String, Throwable)with the following parameters: level set toSessionLog.SEVEREsessionId set toSession.getSessionId()ornullwhensessionisnullcategory set tonullmessage set to""
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.eclipse.persistence.internal.databaseaccess.AccessorgetConnection()Deprecated, for removal: This API element is subject to removal in a future version.UsegetConnectionId()insteadIntegergetConnectionId()Return the datasource connection identifier that generated the log entry.DategetDate()Deprecated, for removal: This API element is subject to removal in a future version.UsegetTimeStamp().ThrowablegetException()Return the exception that caused the log entry.intgetLevel()Return the request level of the log entry.StringgetMessage()Return the log entry's message.StringgetNameSpace()Return the name space of the log entry.Object[]getParameters()SessiongetSession()Deprecated.UsegetSessionId()insteadStringgetSessionId()Return the session identifier that generated the log entry.StringgetSourceClassName()StringgetSourceMethodName()ThreadgetThread()Return the thread that was active when the log entry was generated.InstantgetTimeStamp()booleanhasException()booleanhasMessage()voidsetConnection(org.eclipse.persistence.internal.databaseaccess.Accessor connection)Deprecated, for removal: This API element is subject to removal in a future version.Accessor instance will be removed and replaced with readonlyconnectionIdvoidsetDate(Date date)Deprecated, for removal: This API element is subject to removal in a future version.voidsetException(Throwable throwable)Set the exception that caused the log entry.voidsetLevel(int level)Set the request level of the log entry.voidsetMessage(String message)Set the entry's message.voidsetNameSpace(String nameSpace)Set the name space of the log entry.voidsetParameters(Object[] params)Set the array of parameters to the message.voidsetSession(Session session)Deprecated, for removal: This API element is subject to removal in a future version.UsesetSessionId(String)insteadvoidsetSessionId(String sessionId)Set the session identifier that generated the log entry.voidsetShouldTranslate(boolean shouldTranslate)Set if the message should be translated.voidsetSourceClassName(String sourceClassName)Set the source class name to the message.voidsetSourceMethodName(String sourceMethodName)Set the source method name to the message.voidsetThread(Thread thread)Set the thread that was active when the log entry was generated.voidsetTimeStamp(Instant timeStamp)booleanshouldTranslate()StringtoString()
-
-
-
Field Detail
-
date
@Deprecated(forRemoval=true) protected Date date
Deprecated, for removal: This API element is subject to removal in a future version.
-
session
@Deprecated(forRemoval=true, since="4.0.9") protected transient Session session
Deprecated, for removal: This API element is subject to removal in a future version.UsegetSessionId()insteadThe session that generated the log entry.
-
thread
protected transient Thread thread
-
connection
@Deprecated(forRemoval=true, since="4.0.9") protected transient org.eclipse.persistence.internal.databaseaccess.Accessor connection
Deprecated, for removal: This API element is subject to removal in a future version.UsegetConnectionId()insteadThe connection that generated the log entry.
-
message
protected String message
-
throwable
protected Throwable throwable
-
level
protected int level
-
nameSpace
protected String nameSpace
-
parameters
protected Object[] parameters
-
shouldTranslate
protected boolean shouldTranslate
-
sourceClassName
protected String sourceClassName
-
sourceMethodName
protected String sourceMethodName
-
-
Constructor Detail
-
SessionLogEntry
public SessionLogEntry(int level, String category, String sessionId, String message, Object[] params, Integer connectionId, boolean shouldTranslate)Create a new session log entry for the specified log level, category, session, message, parameters, and datasource connection identifier.The log entry is created with the current thread and timestamp. The exception associated with the log entry is set to null.
- Parameters:
level- the log level of the entrycategory- the category of the log entrysessionId- the identifier of the session that generated the log entrymessage- the log messageparams- an array of parameters associated with the log messageconnectionId- the identifier of the datasource connection that generated the log entryshouldTranslate- whether the log message should be translated- See Also:
SessionLog
-
SessionLogEntry
public SessionLogEntry(int level, String category, String sessionId, String message, Throwable throwable)Creates a new session log entry for the specified log level, category, session, message, and throwable.The log entry is created with the current thread and timestamp. The category is set to the provided category, and the parameters are set to an empty array. The log message is set to the provided message.
The log message is not translated by default.
- Parameters:
level- the log level of the entrycategory- the category of the log entrysessionId- the identifier of the session that generated the log entrymessage- the log messagethrowable- the exception that caused the log entry- See Also:
SessionLog
-
SessionLogEntry
@Deprecated(forRemoval=true, since="4.0.9") public SessionLogEntry(Session session)
Deprecated, for removal: This API element is subject to removal in a future version.UseSessionLogEntry(int, String, String, String, Throwable)with the following parameters:- level set to
SessionLog.INFO - sessionId set to
Session.getSessionId()ornullwhensessionisnull - category set to
null - message set to
"" - throwable set to
null
Create a new session log entry for a session.- Parameters:
session- the session that generated the log entry- See Also:
SessionLog
- level set to
-
SessionLogEntry
@Deprecated(forRemoval=true, since="4.0.9") public SessionLogEntry(Session session, Throwable throwable)
Deprecated, for removal: This API element is subject to removal in a future version.UseSessionLogEntry(int, String, String, String, Throwable)with the following parameters:- level set to
SessionLog.SEVERE - sessionId set to
Session.getSessionId()ornullwhensessionisnull - category set to
null - message set to
""
Create a new session log entry for the specified session and throwable.- Parameters:
session- the session that generated the log entrythrowable- the exception that caused the log entry- See Also:
SessionLog
- level set to
-
SessionLogEntry
@Deprecated(forRemoval=true, since="4.0.9") public SessionLogEntry(Session session, String message)
Deprecated, for removal: This API element is subject to removal in a future version.UseSessionLogEntry(int, String, String, String, Throwable)with the following parameters:- level set to
SessionLog.INFO - sessionId set to
Session.getSessionId()ornullwhensessionisnull - category set to
null - throwable set to
null
Create a new session log entry for a session and a message.- Parameters:
session- the session that generated the log entrymessage- the log message to be recorded- See Also:
SessionLog
- level set to
-
SessionLogEntry
@Deprecated(forRemoval=true, since="4.0.9") public SessionLogEntry(Session session, String message, org.eclipse.persistence.internal.databaseaccess.Accessor connection)
Deprecated, for removal: This API element is subject to removal in a future version.UseSessionLogEntry(int, String, String, String, Object[], Integer, boolean)with the following parameters:- level set to
SessionLog.INFO - category set to
null - sessionId set to
Session.getSessionId()ornullwhensessionisnull - params set to
null - connectionId set to
Accessor.getConnectionId()ornullwhenconnectionisnull - shouldTranslate set to
false
Create a new session log entry for the specified session, message, and accessor.- Parameters:
session- the session that generated the log entrymessage- the log messageconnection- the accessor that generated the log entry- See Also:
SessionLog
- level set to
-
SessionLogEntry
@Deprecated(forRemoval=true, since="4.0.9") public SessionLogEntry(int level, Session session, String message, Object[] params, org.eclipse.persistence.internal.databaseaccess.Accessor connection, boolean shouldTranslate)
Deprecated, for removal: This API element is subject to removal in a future version.UseSessionLogEntry(int, String, String, String, Object[], Integer, boolean)with the following parameters:- category set to
null - sessionId set to
Session.getSessionId()ornullwhensessionisnull
Create a new session log entry for the specified log level, session, message, parameters, and datasource connection.- Parameters:
level- the log level of the entrysession- the session that generated the log entrymessage- the log messageparams- an array of parameters associated with the log messageconnection- the datasource connection that generated the log entryshouldTranslate- whether the log message should be translated- See Also:
SessionLog
- category set to
-
SessionLogEntry
@Deprecated(forRemoval=true, since="4.0.9") public SessionLogEntry(int level, String category, Session session, String message, Object[] params, org.eclipse.persistence.internal.databaseaccess.Accessor connection, boolean shouldTranslate)
Deprecated, for removal: This API element is subject to removal in a future version.UseSessionLogEntry(int, String, String, String, Object[], Integer, boolean)with the following parameters:- sessionId set to
Session.getSessionId()ornullwhensessionisnull
Create a new session log entry for the specified log level, category, session, message, parameters, and datasource connection.- 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:
SessionLog
- sessionId set to
-
SessionLogEntry
@Deprecated(forRemoval=true, since="4.0.9") public SessionLogEntry(Session session, int level, String category, Throwable throwable)
Deprecated, for removal: This API element is subject to removal in a future version.UseSessionLogEntry(int, String, String, String, Throwable)with the following parameters:- message set to
""
Creates a new session log entry for the specified session, log level, category, and exception.- Parameters:
session- the session that generated the log entrylevel- the log level of the entrycategory- the category of the log entrythrowable- the exception associated with the log entry- See Also:
SessionLog
- message set to
-
-
Method Detail
-
getConnection
@Deprecated(forRemoval=true, since="4.0.9") public org.eclipse.persistence.internal.databaseaccess.Accessor getConnection()
Deprecated, for removal: This API element is subject to removal in a future version.UsegetConnectionId()insteadReturn the connection that generated the log entry.- Returns:
- the connection accessor
-
getConnectionId
public Integer getConnectionId()
Return the datasource connection identifier that generated the log entry.- Returns:
- the datasource connection identifier
-
getDate
@Deprecated(forRemoval=true) public Date getDate()
Deprecated, for removal: This API element is subject to removal in a future version.UsegetTimeStamp().Return the date of the log entry.- Returns:
- the date
-
getTimeStamp
public Instant getTimeStamp()
-
getException
public Throwable getException()
Return the exception that caused the log entry.- Returns:
- the exception
-
getMessage
public String getMessage()
Return the log entry's message.- Returns:
- the message
-
getSession
public Session getSession()
Deprecated.UsegetSessionId()insteadReturn the session that generated the log entry.- Returns:
- the session
-
getSessionId
public String getSessionId()
Return the session identifier that generated the log entry.- Returns:
- the session identifier
-
getThread
public Thread 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:
SessionLog
-
getNameSpace
public String 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:
SessionLog
-
getParameters
public Object[] getParameters()
- Returns:
- the array of parameters to the message.
-
getSourceClassName
public String getSourceClassName()
- Returns:
- the source class name to the message
-
getSourceMethodName
public String 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
@Deprecated(forRemoval=true, since="4.0.9") public void setConnection(org.eclipse.persistence.internal.databaseaccess.Accessor connection)
Deprecated, for removal: This API element is subject to removal in a future version.Accessor instance will be removed and replaced with readonlyconnectionIdSet the connection that generated the log entry.- Parameters:
connection- the connection
-
setDate
@Deprecated(forRemoval=true) public void setDate(Date date)
Deprecated, for removal: This API element is subject to removal in a future version.Set the date of the log entry.- Parameters:
date- the date
-
setTimeStamp
public void setTimeStamp(Instant timeStamp)
-
setException
public void setException(Throwable throwable)
Set the exception that caused the log entry.- Parameters:
throwable- the exception
-
setMessage
public void setMessage(String message)
Set the entry's message.- Parameters:
message- the message
-
setSession
@Deprecated(forRemoval=true, since="4.0.9") public void setSession(Session session)
Deprecated, for removal: This API element is subject to removal in a future version.UsesetSessionId(String)insteadSet the session that generated the log entry.- Parameters:
session- the session
-
setSessionId
public void setSessionId(String sessionId)
Set the session identifier that generated the log entry.- Parameters:
sessionId- the session identifier
-
setThread
public void setThread(Thread thread)
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:
SessionLog
-
setNameSpace
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- the log category- See Also:
SessionLog
-
setParameters
public void setParameters(Object[] params)
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
public void setSourceClassName(String sourceClassName)
Set the source class name to the message.- Parameters:
sourceClassName- source class name
-
setSourceMethodName
public void setSourceMethodName(String sourceMethodName)
Set the source method name to the message.- Parameters:
sourceMethodName- source method name
-
-