Package org.apache.catalina.ha.session
Class SessionMessageImpl
- java.lang.Object
-
- org.apache.catalina.ha.ClusterMessageBase
-
- org.apache.catalina.ha.session.SessionMessageImpl
-
- All Implemented Interfaces:
java.io.Serializable
,ClusterMessage
,SessionMessage
public class SessionMessageImpl extends ClusterMessageBase implements SessionMessage
Session cluster message- Author:
- Peter Rossbach
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.catalina.ha.ClusterMessageBase
address
-
Fields inherited from interface org.apache.catalina.ha.session.SessionMessage
EVT_ALL_SESSION_DATA, EVT_ALL_SESSION_NOCONTEXTMANAGER, EVT_ALL_SESSION_TRANSFERCOMPLETE, EVT_CHANGE_SESSION_ID, EVT_GET_ALL_SESSIONS, EVT_SESSION_ACCESSED, EVT_SESSION_CREATED, EVT_SESSION_DELTA, EVT_SESSION_EXPIRED
-
-
Constructor Summary
Constructors Constructor Description SessionMessageImpl(java.lang.String contextName, int eventtype, byte[] session, java.lang.String sessionID, java.lang.String uniqueID)
Creates a session message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getContextName()
int
getEventType()
returns the event typejava.lang.String
getEventTypeString()
clear text event type name (for logging purpose only)byte[]
getSession()
java.lang.String
getSessionID()
long
getTimestamp()
java.lang.String
getUniqueId()
void
setTimestamp(long time)
set message send time but only the first setting works (one shot)java.lang.String
toString()
-
Methods inherited from class org.apache.catalina.ha.ClusterMessageBase
getAddress, setAddress
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.catalina.ha.ClusterMessage
getAddress, setAddress
-
-
-
-
Constructor Detail
-
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 transferred 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 (applicationeventtype
- - one of the 8 event type defined in this classsession
- - the serialized byte array of the session itselfsessionID
- - the id that identifies this sessionuniqueID
- - the id that identifies this message
-
-
Method Detail
-
getEventType
public int getEventType()
returns the event type- Specified by:
getEventType
in interfaceSessionMessage
- Returns:
- one of the event types EVT_XXXX
-
getSession
public byte[] getSession()
- Specified by:
getSession
in interfaceSessionMessage
- Returns:
- the serialized data for the session
-
getSessionID
public java.lang.String getSessionID()
- Specified by:
getSessionID
in interfaceSessionMessage
- 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:
setTimestamp
in interfaceClusterMessage
- Overrides:
setTimestamp
in classClusterMessageBase
-
getTimestamp
public long getTimestamp()
- Specified by:
getTimestamp
in interfaceClusterMessage
- Overrides:
getTimestamp
in classClusterMessageBase
-
getEventTypeString
public java.lang.String getEventTypeString()
clear text event type name (for logging purpose only)- Specified by:
getEventTypeString
in interfaceSessionMessage
- Returns:
- the event type in a string representation, useful for debugging
-
getContextName
public java.lang.String getContextName()
- Specified by:
getContextName
in interfaceSessionMessage
-
getUniqueId
public java.lang.String getUniqueId()
- Specified by:
getUniqueId
in interfaceClusterMessage
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-