站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.6 API 英文版文档

ProducerSessionInformation - JBOSS Portal 2.6 API 英文版文档


org.jboss.portal.wsrp.consumer
Class ProducerSessionInformation

java.lang.Object
  extended byorg.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: 5440 $
Author:
Chris Laprun

Nested Class Summary
private  class ProducerSessionInformation.SessionInfo
           
 
Field Summary
private  java.util.Map groupCookies
          group id -> Cookie[]
private  boolean initCookieDone
           
private  org.jboss.logging.Logger log
           
private  boolean perGroupCookies
           
private  java.util.Map portletSessions
          portlet handle -> SessionInfo
private  org.apache.commons.httpclient.Cookie[] userCookie
           
 
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 getSessionIdForPortlet(java.lang.String portletHandle)
          Retrieves the session id for the portlet with the specified handle.
 java.lang.String getUserCookie()
           
 boolean isInitCookieDone()
           
 boolean isPerGroupCookies()
           
private  java.lang.String outputToExternalForm(org.apache.commons.httpclient.Cookie[] cookies)
          Create a String representation of the specified array of Cookies.
private  org.apache.commons.httpclient.Cookie[] purgeExpiredCookies(org.apache.commons.httpclient.Cookie[] cookies)
          Purges the expired cookies in the specified array.
 void removeSessionIdForPortlet(java.lang.String portletHandle)
           
 void replaceUserCookiesWith(ProducerSessionInformation currentSessionInfo)
           
 void setGroupCookieFor(java.lang.String groupId, org.apache.commons.httpclient.Cookie[] cookies)
           
 void setInitCookieDone(boolean initCookieDone)
           
 void setPerGroupCookies(boolean perGroupCookies)
           
 void setUserCookie(org.apache.commons.httpclient.Cookie[] userCookie)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private org.jboss.logging.Logger log

initCookieDone

private boolean initCookieDone

perGroupCookies

private boolean perGroupCookies

groupCookies

private java.util.Map groupCookies
group id -> Cookie[]


portletSessions

private java.util.Map portletSessions
portlet handle -> SessionInfo


userCookie

private org.apache.commons.httpclient.Cookie[] userCookie
Constructor Detail

ProducerSessionInformation

public ProducerSessionInformation()
Method Detail

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.

removeSessionIdForPortlet

public void removeSessionIdForPortlet(java.lang.String portletHandle)

getNumberOfSessions

public int getNumberOfSessions()

replaceUserCookiesWith

public void replaceUserCookiesWith(ProducerSessionInformation currentSessionInfo)

outputToExternalForm

private java.lang.String outputToExternalForm(org.apache.commons.httpclient.Cookie[] cookies)
Create a String representation of the specified array of Cookies.

Parameters:
cookies - the cookies to be output to external form
Returns:
a String representation of the cookies, ready to be sent over the wire.

purgeExpiredCookies

private org.apache.commons.httpclient.Cookie[] purgeExpiredCookies(org.apache.commons.httpclient.Cookie[] cookies)
Purges the expired cookies in the specified array.

Parameters:
cookies - the cookies to be purged
Returns:
an array of Cookies containing only still valid cookies