public class SessionHandler extends Object implements SessionEventListener
| Modifier and Type | Field and Description |
|---|---|
protected WSRPConsumerImpl |
consumer |
| Constructor and Description |
|---|
SessionHandler(WSRPConsumerImpl consumer)
Constructs a new SessionHandler.
|
| Modifier and Type | Method and Description |
|---|---|
ProducerSessionInformation |
getProducerSessionInformation(javax.servlet.http.HttpSession session)
Retrieves the ProducerSessionInformation from the specified session.
|
ProducerSessionInformation |
getProducerSessionInformation(org.gatein.pc.api.invocation.PortletInvocation invocation)
Retrieves the ProducerSessionInformation containing the current state of what is known session-wise for this producer, creating a new one if none existed previously.
|
static String |
getRealId(String sessionId)
Returns a session id with any trailing jvmRoute removed.
|
void |
initCookieIfNeeded(org.gatein.pc.api.invocation.PortletInvocation invocation)
Invokes initCookie if needed (i.e.
|
boolean |
isPerUserCookieInit()
Whether initCookie needs to be called once per user.
|
void |
onSessionEvent(SessionEvent event)
Listen to consumer-side session destruction events to notify the producer that the portlet sessions for that user need to be released.
|
void |
releaseSessions() |
boolean |
requiresInitCookie()
Whether the associated producer requires initCookie to be called.
|
void |
resetCurrentlyHeldInformation()
Resets the information held by RequestHeaderClientHandler for the current interaction.
|
void |
updateSessionIfNeeded(SessionContext sessionContext,
org.gatein.pc.api.invocation.PortletInvocation invocation,
String portletHandle)
Updates, if needed, the known session information based on the data provided by the specified SessionContext (i.e.
|
void |
updateSessionInfoFor(String originalHandle,
String newHandle,
org.gatein.pc.api.invocation.PortletInvocation invocation)
Maintains session information associated with portlets when their handle is modified (for example, after a clone operation).
|
protected WSRPConsumerImpl consumer
public SessionHandler(WSRPConsumerImpl consumer)
consumer - the consumer this SessionHandler is associated with.public boolean isPerUserCookieInit()
public boolean requiresInitCookie()
public void resetCurrentlyHeldInformation()
public void initCookieIfNeeded(org.gatein.pc.api.invocation.PortletInvocation invocation)
throws org.gatein.pc.api.PortletInvokerException
invocation - the current PortletInvocation potentially requiring the consumer to call initCookie on the producerorg.gatein.pc.api.PortletInvokerExceptionpublic void updateSessionIfNeeded(SessionContext sessionContext, org.gatein.pc.api.invocation.PortletInvocation invocation, String portletHandle)
sessionContext - the WSRP SessionContext containing potential session information updatesinvocation - the current PortletInvocationportletHandle - the handle identifying the portlet being interacted withpublic ProducerSessionInformation getProducerSessionInformation(org.gatein.pc.api.invocation.PortletInvocation invocation)
invocation - the current PortletInvocation (to be able to retrieve the current consumer-side HTTP session where the information is kept)public ProducerSessionInformation getProducerSessionInformation(javax.servlet.http.HttpSession session)
session - the consumer-side session to retrieve a ProducerSessionInformation fromnull if none existspublic void releaseSessions()
throws org.gatein.pc.api.PortletInvokerException
org.gatein.pc.api.PortletInvokerExceptionpublic void onSessionEvent(SessionEvent event)
onSessionEvent in interface SessionEventListenerevent - any SessionEvent so we need to only process SessionEvent.SessionEventType#SESSION_DESTROYED event typespublic static String getRealId(String sessionId)
sessionId - the raw session idsessionId with the final '.' and any characters thereafter removed.public void updateSessionInfoFor(String originalHandle, String newHandle, org.gatein.pc.api.invocation.PortletInvocation invocation)
originalHandle - the original handle of the portletnewHandle - the new portlet handleinvocation - the invocation associated with the operationCopyright © 2006-2014 GateIn. All Rights Reserved.