SessionMessageImplpublic class SessionMessageImpl extends org.apache.catalina.ha.ClusterMessageBase implements SessionMessage, Serializable
Fields Summary |
---|
private int | mEvtType | private byte[] | mSession | private String | mSessionID | private String | mContextName | private long | serializationTimestamp | private boolean | timestampSet | private String | uniqueId |
Constructors Summary |
---|
public SessionMessageImpl()
| private SessionMessageImpl(String contextName, int eventtype, byte[] session, String sessionID)
mEvtType = eventtype;
mSession = session;
mSessionID = sessionID;
mContextName = contextName;
uniqueId = sessionID;
| public SessionMessageImpl(String contextName, int eventtype, byte[] session, String sessionID, 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_SESSION_EXPIRED_XXXX
The parameters: sessionID must be set.
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.
this(contextName,eventtype,session,sessionID);
uniqueId = uniqueID;
|
Methods Summary |
---|
public java.lang.String | getContextName()
return mContextName;
| public int | getEventType()returns the event type return mEvtType;
| public java.lang.String | getEventTypeString()clear text event type name (for logging purpose only)
switch (mEvtType)
{
case EVT_SESSION_CREATED : return "SESSION-MODIFIED";
case EVT_SESSION_EXPIRED : return "SESSION-EXPIRED";
case EVT_SESSION_ACCESSED : return "SESSION-ACCESSED";
case EVT_GET_ALL_SESSIONS : return "SESSION-GET-ALL";
case EVT_SESSION_DELTA : return "SESSION-DELTA";
case EVT_ALL_SESSION_DATA : return "ALL-SESSION-DATA";
case EVT_ALL_SESSION_TRANSFERCOMPLETE : return "SESSION-STATE-TRANSFERED";
default : return "UNKNOWN-EVENT-TYPE";
}
| public byte[] | getSession() return mSession;
| public java.lang.String | getSessionID() return mSessionID;
| public long | getTimestamp() return serializationTimestamp;
| public java.lang.String | getUniqueId()
return uniqueId;
| public void | setTimestamp(long time)set message send time but only the first setting works (one shot)
synchronized(this) {
if(!timestampSet) {
serializationTimestamp=time;
timestampSet = true ;
}
}
| public void | setUniqueId(java.lang.String uniqueId)
this.uniqueId = uniqueId;
| public java.lang.String | toString()
return getEventTypeString() + "#" + getContextName() + "#" + getSessionID() ;
|
|