org.jboss.portal.wsrp.consumer
Class ProducerSessionInformation

java.lang.Object
  extended by org.jboss.portal.wsrp.consumer.ProducerSessionInformation

public class ProducerSessionInformation
extends java.lang.Object

Records session and cookie information for a producer.

Since:
2.4 (May 30, 2006)
Version:
$Revision: 8784 $
Author:
Chris Laprun

Constructor Summary
ProducerSessionInformation()
           
 
Method Summary
 void addSessionForPortlet(java.lang.String portletHandle, SessionContext sessionContext)
           
 void clearGroupCookies()
           
 java.lang.String getGroupCookieFor(java.lang.String groupId)
           
 int getNumberOfSessions()
           
 java.lang.String getParentSessionId()
          public only for tests
 java.lang.String getSessionIdForPortlet(java.lang.String portletHandle)
          Retrieves the session id for the portlet with the specified handle.
 java.lang.String getUserCookie()
           
 boolean isInitCookieDone()
           
 boolean isPerGroupCookies()
           
 java.lang.String removeSession(java.lang.String sessionId)
           
 java.lang.String removeSessionForPortlet(java.lang.String portletHandle)
           
 java.util.List removeSessions()
           
 void replaceUserCookiesWith(ProducerSessionInformation currentSessionInfo)
           
 void setGroupCookieFor(java.lang.String groupId, org.apache.commons.httpclient.Cookie[] cookies)
           
 void setInitCookieDone(boolean initCookieDone)
           
 void setParentSessionId(java.lang.String parentSessionId)
          public only for tests
 void setPerGroupCookies(boolean perGroupCookies)
           
 void setUserCookie(org.apache.commons.httpclient.Cookie[] userCookie)
           
 void updateHandleAssociatedInfo(java.lang.String originalHandle, java.lang.String newHandle)
          Update the mappings that were associated with the specified original portlet handle after it has been modified as a result of a clone operation to the specified new handle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProducerSessionInformation

public ProducerSessionInformation()
Method Detail

getParentSessionId

public java.lang.String getParentSessionId()
public only for tests

Returns:
Since:
2.6

setParentSessionId

public void setParentSessionId(java.lang.String parentSessionId)
public only for tests

Parameters:
parentSessionId -
Throws:
java.lang.IllegalStateException - if an attempt is made to set the parent session id to a different one when it has already been set.
Since:
2.6

getUserCookie

public java.lang.String getUserCookie()

setUserCookie

public void setUserCookie(org.apache.commons.httpclient.Cookie[] userCookie)

isInitCookieDone

public boolean isInitCookieDone()

setInitCookieDone

public void setInitCookieDone(boolean initCookieDone)

isPerGroupCookies

public boolean isPerGroupCookies()

setPerGroupCookies

public void setPerGroupCookies(boolean perGroupCookies)

setGroupCookieFor

public void setGroupCookieFor(java.lang.String groupId,
                              org.apache.commons.httpclient.Cookie[] cookies)

getGroupCookieFor

public java.lang.String getGroupCookieFor(java.lang.String groupId)

clearGroupCookies

public void clearGroupCookies()

addSessionForPortlet

public void addSessionForPortlet(java.lang.String portletHandle,
                                 SessionContext sessionContext)

getSessionIdForPortlet

public java.lang.String getSessionIdForPortlet(java.lang.String portletHandle)
Retrieves the session id for the portlet with the specified handle. Note that this will "touch" the session, hence resetting the time since the last use of the session.

Parameters:
portletHandle - the handle of the portlet for which the session id is to be retrieved
Returns:
the session id for the specified portlet, null if there is no session associated with the portlet or if the session has expired.

getNumberOfSessions

public int getNumberOfSessions()

removeSession

public java.lang.String removeSession(java.lang.String sessionId)
Parameters:
sessionId -
Returns:
the id of the removed session or null if the session had already expired

removeSessions

public java.util.List removeSessions()
Returns:
a list containing the session ids that were still valid when they were removed and would need to be released

removeSessionForPortlet

public java.lang.String removeSessionForPortlet(java.lang.String portletHandle)
Parameters:
portletHandle -
Returns:
the id of the removed session or null if the session had already expired

replaceUserCookiesWith

public void replaceUserCookiesWith(ProducerSessionInformation currentSessionInfo)

updateHandleAssociatedInfo

public void updateHandleAssociatedInfo(java.lang.String originalHandle,
                                       java.lang.String newHandle)
Update the mappings that were associated with the specified original portlet handle after it has been modified as a result of a clone operation to the specified new handle.

Parameters:
originalHandle -
newHandle -
Since:
2.6