Class CarbonTomcatSessionMessage
java.lang.Object
org.apache.axis2.clustering.ClusteringCommand
org.apache.axis2.clustering.ClusteringMessage
org.wso2.carbon.webapp.mgt.session.CarbonTomcatSessionMessage
- All Implemented Interfaces:
Serializable,org.apache.catalina.ha.ClusterMessage,org.apache.catalina.ha.session.SessionMessage
public class CarbonTomcatSessionMessage
extends org.apache.axis2.clustering.ClusteringMessage
implements org.apache.catalina.ha.session.SessionMessage
This class implements tomcat session message and extends axis2 clustering message. This is needed
when clustering is enabled for webapps with tomcat, the session messages for those webapps
should be sent to other nodes via the axis2 clustering implementation.
- See Also:
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionCarbonTomcatSessionMessage(String contextName, int eventtype, byte[] session, String sessionID, String uniqueID) Deprecated.CarbonTomcatSessionMessage(String contextName, int eventtype, byte[] session, String sessionID, String uniqueID, int tenantId) -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute(org.apache.axis2.context.ConfigurationContext mainConfigContext) org.apache.catalina.tribes.Memberintreturns the event typeclear text event type name (for logging purpose only)org.apache.axis2.clustering.ClusteringCommandbyte[]longvoidsetAddress(org.apache.catalina.tribes.Member member) voidsetTenantId(int tenantId) voidsetTimestamp(long time) set message send time but only the first setting works (one shot)toString()Methods inherited from class org.apache.axis2.clustering.ClusteringMessage
equals, getUuid, hashCode
-
Field Details
-
address
protected transient org.apache.catalina.tribes.Member address
-
-
Constructor Details
-
CarbonTomcatSessionMessage
public CarbonTomcatSessionMessage() -
CarbonTomcatSessionMessage
-
CarbonTomcatSessionMessage
@Deprecated public CarbonTomcatSessionMessage(String contextName, int eventtype, byte[] session, String sessionID, String uniqueID) Deprecated.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 (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 Details
-
getEventType
public int getEventType()returns the event type- Specified by:
getEventTypein interfaceorg.apache.catalina.ha.session.SessionMessage- Returns:
- one of the event types EVT_XXXX
-
getSession
public byte[] getSession()- Specified by:
getSessionin interfaceorg.apache.catalina.ha.session.SessionMessage- Returns:
- the serialized data for the session
-
getSessionID
- Specified by:
getSessionIDin interfaceorg.apache.catalina.ha.session.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 interfaceorg.apache.catalina.ha.ClusterMessage
-
getTimestamp
public long getTimestamp()- Specified by:
getTimestampin interfaceorg.apache.catalina.ha.ClusterMessage- Overrides:
getTimestampin classorg.apache.axis2.clustering.ClusteringMessage
-
getEventTypeString
clear text event type name (for logging purpose only)- Specified by:
getEventTypeStringin interfaceorg.apache.catalina.ha.session.SessionMessage- Returns:
- the event type in a string representation, useful for debugging
-
getContextName
- Specified by:
getContextNamein interfaceorg.apache.catalina.ha.session.SessionMessage
-
getAddress
public org.apache.catalina.tribes.Member getAddress()- Specified by:
getAddressin interfaceorg.apache.catalina.ha.ClusterMessage
-
setAddress
public void setAddress(org.apache.catalina.tribes.Member member) - Specified by:
setAddressin interfaceorg.apache.catalina.ha.ClusterMessage
-
getUniqueId
- Specified by:
getUniqueIdin interfaceorg.apache.catalina.ha.ClusterMessage
-
toString
-
getResponse
public org.apache.axis2.clustering.ClusteringCommand getResponse()- Specified by:
getResponsein classorg.apache.axis2.clustering.ClusteringMessage
-
setTenantId
public void setTenantId(int tenantId) -
execute
public void execute(org.apache.axis2.context.ConfigurationContext mainConfigContext) throws org.apache.axis2.clustering.ClusteringFault - Specified by:
executein classorg.apache.axis2.clustering.ClusteringCommand- Throws:
org.apache.axis2.clustering.ClusteringFault
-