org.apache.catalina.ha.session
Class SessionMessageImpl
java.lang.Object
   org.apache.catalina.ha.ClusterMessageBase
org.apache.catalina.ha.ClusterMessageBase
       org.apache.catalina.ha.session.SessionMessageImpl
org.apache.catalina.ha.session.SessionMessageImpl
- All Implemented Interfaces: 
- java.io.Serializable, ClusterMessage, SessionMessage
- public class SessionMessageImpl 
- extends ClusterMessageBase- implements SessionMessage, java.io.Serializable
Session cluster message
- Author:
- Filip Hanik, Peter Rossbach
- See Also:
- Serialized Form
 
 
 
| Constructor Summary | 
| SessionMessageImpl()
 | 
| SessionMessageImpl(java.lang.String contextName,
                   int eventtype,
                   byte[] session,
                   java.lang.String sessionID,
                   java.lang.String uniqueID)Creates a session message.
 | 
 
 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
 
 
SessionMessageImpl
public SessionMessageImpl()
SessionMessageImpl
public SessionMessageImpl(java.lang.String contextName,
                          int eventtype,
                          byte[] session,
                          java.lang.String sessionID,
                          java.lang.String uniqueID)
- Creates a session message. Depending on what event type you want this
 message to represent, you populate the different parameters in the constructor
 The following rules apply dependent on what event type argument you use:
 EVT_SESSION_CREATED
 The parameters: session, sessionID must be set.
 EVT_SESSION_EXPIRED
 The parameters: sessionID must be set.
 EVT_SESSION_ACCESSED
 The parameters: sessionID must be set.
 EVT_GET_ALL_SESSIONS
 get all sessions from from one of the nodes.
 EVT_SESSION_DELTA
 Send attribute delta (add,update,remove attribute or principal, ...).
 EVT_ALL_SESSION_DATA
 Send complete serializes session list
 EVT_ALL_SESSION_TRANSFERCOMPLETE
 send that all session state information are transfered
    after GET_ALL_SESSION received from this sender.
 EVT_CHANGE_SESSION_ID
 send original sessionID and new sessionID.
 EVT_ALL_SESSION_NOCONTEXTMANAGER
 send that context manager does not exist
    after GET_ALL_SESSION received from this sender.
 
 
- Parameters:
- contextName- - the name of the context (application
- eventtype- - one of the 8 event type defined in this class
- session- - the serialized byte array of the session itself
- sessionID- - the id that identifies this session
- uniqueID- - the id that identifies this message
 
getEventType
public int getEventType()
- returns the event type
 
- 
- Specified by:
- getEventTypein interface- SessionMessage
 
- 
- Returns:
- one of the event types EVT_XXXX
 
getSession
public byte[] getSession()
- 
- Specified by:
- getSessionin interface- SessionMessage
 
- 
- Returns:
- the serialized data for the session
 
getSessionID
public java.lang.String getSessionID()
- 
- Specified by:
- getSessionIDin interface- SessionMessage
 
- 
- Returns:
- the session ID for the session
 
setTimestamp
public void setTimestamp(long time)
- set message send time but only the first setting works (one shot)
 
- 
- Specified by:
- setTimestampin interface- ClusterMessage
- Overrides:
- setTimestampin class- ClusterMessageBase
 
- 
 
getTimestamp
public long getTimestamp()
- 
- Specified by:
- getTimestampin interface- ClusterMessage
- Overrides:
- getTimestampin class- ClusterMessageBase
 
- 
 
getEventTypeString
public java.lang.String getEventTypeString()
- clear text event type name (for logging purpose only)
 
- 
- Specified by:
- getEventTypeStringin interface- SessionMessage
 
- 
- Returns:
- the event type in a string representating, useful for debugging
 
getContextName
public java.lang.String getContextName()
- 
- Specified by:
- getContextNamein interface- SessionMessage
 
- 
 
getUniqueId
public java.lang.String getUniqueId()
- 
- Specified by:
- getUniqueIdin interface- ClusterMessage
- Overrides:
- getUniqueIdin class- ClusterMessageBase
 
- 
 
setUniqueId
public void setUniqueId(java.lang.String uniqueId)
- 
- Specified by:
- setUniqueIdin interface- ClusterMessage
- Overrides:
- setUniqueIdin class- ClusterMessageBase
 
- 
 
toString
public java.lang.String toString()
- 
- Overrides:
- toStringin class- java.lang.Object
 
- 
 
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.