Class SessionLogEntry

  • All Implemented Interfaces:
    java.io.Serializable

    public class SessionLogEntry
    extends java.lang.Object
    implements java.io.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.Accessor connection  
      protected java.util.Date date  
      protected int level  
      protected java.lang.String message  
      protected java.lang.String nameSpace  
      protected java.lang.Object[] parameters  
      protected org.eclipse.persistence.internal.sessions.AbstractSession session  
      protected boolean shouldTranslate  
      protected java.lang.String sourceClassName  
      protected java.lang.String sourceMethodName  
      protected java.lang.Thread thread  
      protected java.lang.Throwable throwable  
    • Constructor Summary

      Constructors 
      Constructor Description
      SessionLogEntry​(int level, java.lang.String category, org.eclipse.persistence.internal.sessions.AbstractSession session, java.lang.String message, java.lang.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, java.lang.String message, java.lang.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, java.lang.String category, java.lang.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, java.lang.String message)
      Create a new session log entry for a session and a message.
      SessionLogEntry​(org.eclipse.persistence.internal.sessions.AbstractSession session, java.lang.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, java.lang.Throwable throwable)
      Create a new session log entry for a session and a throwable.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.eclipse.persistence.internal.databaseaccess.Accessor getConnection()
      Return the connection that generated the log entry.
      java.util.Date getDate()
      Return the date of the log entry.
      java.lang.Throwable getException()
      Return the exception that caused the log entry.
      int getLevel()
      Return the request level of the log entry.
      java.lang.String getMessage()
      Return the log entry's message.
      java.lang.String getNameSpace()
      Return the name space of the log entry.
      java.lang.Object[] getParameters()  
      org.eclipse.persistence.internal.sessions.AbstractSession getSession()
      Return the session that generated the log entry.
      java.lang.String getSourceClassName()  
      java.lang.String getSourceMethodName()  
      java.lang.Thread getThread()
      Return the thread that was active when the log entry was generated.
      boolean hasException()  
      boolean hasMessage()  
      void setConnection​(org.eclipse.persistence.internal.databaseaccess.Accessor connection)
      Set the connection that generated the log entry.
      void setDate​(java.util.Date date)
      Set the date of the log entry.
      void setException​(java.lang.Throwable throwable)
      Set the exception that caused the log entry.
      void setLevel​(int level)
      Set the request level of the log entry.
      void setMessage​(java.lang.String message)
      Set the entry's message.
      void setNameSpace​(java.lang.String nameSpace)
      Set the name space of the log entry.
      void setParameters​(java.lang.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​(java.lang.String sourceClassName)
      Set the source class name to the message.
      void setSourceMethodName​(java.lang.String sourceMethodName)
      Set the source method name to the message.
      void setThread​(java.lang.Thread thread)
      Set the thread that was active when the log entry was generated.
      boolean shouldTranslate()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • date

        protected java.util.Date date
      • session

        protected transient org.eclipse.persistence.internal.sessions.AbstractSession session
      • thread

        protected transient java.lang.Thread thread
      • connection

        protected transient org.eclipse.persistence.internal.databaseaccess.Accessor connection
      • message

        protected java.lang.String message
      • throwable

        protected java.lang.Throwable throwable
      • level

        protected int level
      • nameSpace

        protected java.lang.String nameSpace
      • parameters

        protected java.lang.Object[] parameters
      • shouldTranslate

        protected boolean shouldTranslate
      • sourceClassName

        protected java.lang.String sourceClassName
      • sourceMethodName

        protected java.lang.String sourceMethodName
    • Constructor Detail

      • 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,
                               java.lang.Throwable throwable)
        Create a new session log entry for a session and a throwable.
        Parameters:
        session - the session
        throwable - the throwable
      • SessionLogEntry

        public SessionLogEntry​(org.eclipse.persistence.internal.sessions.AbstractSession session,
                               java.lang.String message)
        Create a new session log entry for a session and a message.
        Parameters:
        session - the session
        message - the message
      • SessionLogEntry

        public SessionLogEntry​(org.eclipse.persistence.internal.sessions.AbstractSession session,
                               java.lang.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 session
        message - the message
        connection - the accessor
      • SessionLogEntry

        public SessionLogEntry​(int level,
                               org.eclipse.persistence.internal.sessions.AbstractSession session,
                               java.lang.String message,
                               java.lang.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 level
        session - the session
        message - the message
        params - array of parameters
        connection - the accessor
        shouldTranslate - true if the entry should be translated
        See Also:
        SessionLog
      • SessionLogEntry

        public SessionLogEntry​(int level,
                               java.lang.String category,
                               org.eclipse.persistence.internal.sessions.AbstractSession session,
                               java.lang.String message,
                               java.lang.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 level
        category - the category
        session - the session
        message - the message
        params - array of parameters
        connection - the accessor
        shouldTranslate - true if the entry should be translated
        See Also:
        SessionLog
      • SessionLogEntry

        public SessionLogEntry​(org.eclipse.persistence.internal.sessions.AbstractSession session,
                               int level,
                               java.lang.String category,
                               java.lang.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 session
        level - the log level
        category - the category
        throwable - the exception
        See Also:
        SessionLog
    • Method Detail

      • getConnection

        public org.eclipse.persistence.internal.databaseaccess.Accessor getConnection()
        Return the connection that generated the log entry.
        Returns:
        the connection accessor
      • getDate

        public java.util.Date getDate()
        Return the date of the log entry.
        Returns:
        the date
      • getException

        public java.lang.Throwable getException()
        Return the exception that caused the log entry.
        Returns:
        the exception
      • getMessage

        public java.lang.String 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

        public java.lang.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 java.lang.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 java.lang.Object[] getParameters()
        Returns:
        the array of parameters to the message.
      • getSourceClassName

        public java.lang.String getSourceClassName()
        Returns:
        the source class name to the message
      • getSourceMethodName

        public java.lang.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

        public void setConnection​(org.eclipse.persistence.internal.databaseaccess.Accessor connection)
        Set the connection that generated the log entry.
        Parameters:
        connection - the connection
      • setDate

        public void setDate​(java.util.Date date)
        Set the date of the log entry.
        Parameters:
        date - the date
      • setException

        public void setException​(java.lang.Throwable throwable)
        Set the exception that caused the log entry.
        Parameters:
        throwable - the exception
      • setMessage

        public void setMessage​(java.lang.String message)
        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

        public void setThread​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.String sourceClassName)
        Set the source class name to the message.
        Parameters:
        sourceClassName - source class name
      • setSourceMethodName

        public void setSourceMethodName​(java.lang.String sourceMethodName)
        Set the source method name to the message.
        Parameters:
        sourceMethodName - source method name
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object