|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jetspeed.portalsite.impl.PortalSiteSessionContextImpl
public class PortalSiteSessionContextImpl
This class encapsulates managed session state for and interface to the portal-site component and subscribes to page manager and session events to flush stale state. Note that is object is Serializable since it is designed to be cached in the session. However, because this object is cached only for these two reasons: 1. a performance optimization to reuse SiteViews, and 2. to hold optional folder page history, this object need not be relocatable between J2 instances. Consequently, all data members are marked transient and the isValid() method is used to test whether this object is a valid context for the session or if it was transferred from another server or the persistent session store and needs to be discarded.
Field Summary | |
---|---|
private Map |
folderPageHistory
folderPageHistory - map of last page visited by folder |
private static org.apache.commons.logging.Log |
log
log - logging instance |
private Map |
menuDefinitionLocatorCache
menuDefinitionLocatorCache - cached menu definition locators for absolute menus valid for session |
private org.apache.jetspeed.page.PageManager |
pageManager
pageManager - PageManager component |
private String |
pipeline
store which pipeline we are serving |
private Map |
profileLocators
profileLocators - map of session profile locators by locator names |
private SiteView |
siteView
siteView - session site view |
private boolean |
stale
stale - flag that indicates whether the state managed by this context is stale |
private boolean |
subscribed
subscribed - flag that indicates whether this context is subscribed as event listeners |
private String |
userPrincipal
userPrincipal - session user principal |
Constructor Summary | |
---|---|
PortalSiteSessionContextImpl(org.apache.jetspeed.page.PageManager pageManager)
PortalSiteSessionContextImpl - constructor |
Method Summary | |
---|---|
private void |
clearSessionProfileLocators()
clearSessionProfileLocators - clear cache session profile locators |
private Map |
getFolderPageHistory()
|
org.apache.jetspeed.om.page.Page |
getManagedPage(org.apache.jetspeed.om.page.Page page)
getManagedPage - get concrete page instance from page proxy |
SiteViewMenuDefinitionLocator |
getMenuDefinitionLocator(org.apache.jetspeed.page.document.Node node,
String name)
getMenuDefinitionLocator - get named node proxy menu definition locator from site view |
Map |
getMenuDefinitionLocatorCache()
getMenuDefinitionLocatorCache - get menu definition locators cache for absolute menus |
List |
getMenuDefinitionLocators(org.apache.jetspeed.page.document.Node node)
getMenuDefinitionLocators - get list of node proxy menu definition locators from site view |
org.apache.jetspeed.page.PageManager |
getPageManager()
getPageManager - return PageManager component instance |
String |
getPipeline()
|
Map |
getProfileLocators()
getProfileLocators - get session profile locators |
private String |
getRequestPathFromLocator(org.apache.jetspeed.profiler.ProfileLocator locator)
getRequestPathFromLocator - execute profile locator to extract request path using locator rules; this is request specific and is not part of the site view |
org.apache.jetspeed.om.folder.Folder |
getRequestRootFolder(Map requestProfileLocators)
getRequestRootFolder - select root folder proxy for given profile locators |
SiteView |
getSiteView()
getSiteView - lookup and/or create site view for profile locators of this context |
Set |
getStandardMenuNames()
getStandardMenuNames - get set of available standard menu names |
boolean |
isValid()
isValid - return flag indicating whether this context instance is valid or if it is stale after being persisted and reloaded as session state |
private static boolean |
locatorsEquals(Map locators0,
Map locators1)
locatorsEquals - test profile locator maps for equivalence ignoring request specifics |
void |
newNode(org.apache.jetspeed.page.document.Node node)
newNode - invoked when the definition of a node is created by the page manager or when the node creation is otherwise detected |
org.apache.jetspeed.portalsite.PortalSiteRequestContext |
newRequestContext(Map requestProfileLocators)
newRequestContext - create a new request context instance with fallback and history |
org.apache.jetspeed.portalsite.PortalSiteRequestContext |
newRequestContext(Map requestProfileLocators,
boolean requestFallback)
newRequestContext - create a new request context instance with history |
org.apache.jetspeed.portalsite.PortalSiteRequestContext |
newRequestContext(Map requestProfileLocators,
boolean requestFallback,
boolean useHistory)
newRequestContext - create a new request context instance |
void |
removedNode(org.apache.jetspeed.page.document.Node node)
removedNode - invoked when the definition of a node is removed by the page manager or when the node removal is otherwise detected |
org.apache.jetspeed.om.page.Page |
selectRequestPage(Map requestProfileLocators,
boolean requestFallback,
boolean useHistory)
selectRequestPage - select page proxy for request given profile locators |
private org.apache.jetspeed.om.page.Page |
selectRequestPage(String requestPath,
boolean useHistory)
selectRequestPage - select page proxy for request for specified path given profile locators and site view associated with this context |
void |
sessionDidActivate(javax.servlet.http.HttpSessionEvent event)
sessionDidActivate - notification that the session has just been activated |
void |
sessionWillPassivate(javax.servlet.http.HttpSessionEvent event)
sessionWillPassivate - notification that the session is about to be passivated |
void |
setMenuDefinitionLocatorCache(Map cache)
setMenuDefinitionLocatorCache - set menu definition locators cache for absolute menus |
void |
setPipeline(String pipeline)
|
void |
updatedNode(org.apache.jetspeed.page.document.Node node)
updatedNode - invoked when the definition of a node is updated by the page manager or when the node modification is otherwise detected |
private boolean |
updateSessionProfileLocators(Map requestProfileLocators)
updateSessionProfileLocators - detect modification of and update cached session profile locators |
void |
valueBound(javax.servlet.http.HttpSessionBindingEvent event)
valueBound - notifies this context that it is being bound to a session and identifies the session |
void |
valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
valueUnbound - notifies this context that it is being unbound from a session and identifies the session |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
private transient org.apache.jetspeed.page.PageManager pageManager
private transient Map profileLocators
private transient String userPrincipal
private transient SiteView siteView
private transient Map folderPageHistory
private transient Map menuDefinitionLocatorCache
private transient boolean subscribed
private transient boolean stale
private transient String pipeline
Constructor Detail |
---|
public PortalSiteSessionContextImpl(org.apache.jetspeed.page.PageManager pageManager)
pageManager
- PageManager component instanceMethod Detail |
---|
public org.apache.jetspeed.portalsite.PortalSiteRequestContext newRequestContext(Map requestProfileLocators)
newRequestContext
in interface org.apache.jetspeed.portalsite.PortalSiteSessionContext
requestProfileLocators
- request profile locators
public org.apache.jetspeed.portalsite.PortalSiteRequestContext newRequestContext(Map requestProfileLocators, boolean requestFallback)
newRequestContext
in interface org.apache.jetspeed.portalsite.PortalSiteSessionContext
requestProfileLocators
- request profile locatorsrequestFallback
- flag specifying whether to fallback to root folder
if locators do not select a page or access is forbidden
public org.apache.jetspeed.portalsite.PortalSiteRequestContext newRequestContext(Map requestProfileLocators, boolean requestFallback, boolean useHistory)
newRequestContext
in interface org.apache.jetspeed.portalsite.PortalSiteSessionContext
requestProfileLocators
- request profile locatorsrequestFallback
- flag specifying whether to fallback to root folder
if locators do not select a page or access is forbiddenuseHistory
- flag indicating whether to use visited page
history to select default page per site folder
public org.apache.jetspeed.om.page.Page selectRequestPage(Map requestProfileLocators, boolean requestFallback, boolean useHistory) throws org.apache.jetspeed.page.document.NodeNotFoundException
requestProfileLocators
- map of profile locators for requestrequestFallback
- flag specifying whether to fallback to root folder
if locators do not select a page or access is forbiddenuseHistory
- flag indicating whether to use visited page
history to select default page per site folder
org.apache.jetspeed.page.document.NodeNotFoundException
- if not found
SecurityException
- if view access not grantedprivate String getRequestPathFromLocator(org.apache.jetspeed.profiler.ProfileLocator locator)
locator
- profile locator to execute
private org.apache.jetspeed.om.page.Page selectRequestPage(String requestPath, boolean useHistory) throws org.apache.jetspeed.page.document.NodeNotFoundException
requestPath
- request pathuseHistory
- flag indicating whether to use visited page
history to select default page per site folder
org.apache.jetspeed.page.document.NodeNotFoundException
- if not found
SecurityException
- if view access not grantedpublic org.apache.jetspeed.om.folder.Folder getRequestRootFolder(Map requestProfileLocators) throws org.apache.jetspeed.page.document.NodeNotFoundException
requestProfileLocators
- map of profile locators for request
org.apache.jetspeed.page.document.NodeNotFoundException
- if not found
SecurityException
- if view access not grantedprivate boolean updateSessionProfileLocators(Map requestProfileLocators)
requestProfileLocators
- map of profile locators for request
private void clearSessionProfileLocators()
public SiteView getSiteView()
public org.apache.jetspeed.page.PageManager getPageManager()
getPageManager
in interface org.apache.jetspeed.portalsite.PortalSiteSessionContext
public boolean isValid()
isValid
in interface org.apache.jetspeed.portalsite.PortalSiteSessionContext
public Map getProfileLocators()
public Set getStandardMenuNames()
public List getMenuDefinitionLocators(org.apache.jetspeed.page.document.Node node)
node
- site view node proxy
public SiteViewMenuDefinitionLocator getMenuDefinitionLocator(org.apache.jetspeed.page.document.Node node, String name)
node
- site view node proxyname
- menu definition name
public org.apache.jetspeed.om.page.Page getManagedPage(org.apache.jetspeed.om.page.Page page)
page
- page proxy
public Map getMenuDefinitionLocatorCache()
public void setMenuDefinitionLocatorCache(Map cache)
private static boolean locatorsEquals(Map locators0, Map locators1)
locators0
- request profile locator maplocators1
- request profile locator map
public void newNode(org.apache.jetspeed.page.document.Node node)
newNode
in interface org.apache.jetspeed.page.PageManagerEventListener
node
- new managed node if knownpublic void updatedNode(org.apache.jetspeed.page.document.Node node)
updatedNode
in interface org.apache.jetspeed.page.PageManagerEventListener
node
- updated managed node if knownpublic void removedNode(org.apache.jetspeed.page.document.Node node)
removedNode
in interface org.apache.jetspeed.page.PageManagerEventListener
node
- removed managed node if knownpublic void sessionDidActivate(javax.servlet.http.HttpSessionEvent event)
sessionDidActivate
in interface javax.servlet.http.HttpSessionActivationListener
event
- session activation eventpublic void sessionWillPassivate(javax.servlet.http.HttpSessionEvent event)
sessionWillPassivate
in interface javax.servlet.http.HttpSessionActivationListener
event
- session activation eventpublic void valueBound(javax.servlet.http.HttpSessionBindingEvent event)
valueBound
in interface javax.servlet.http.HttpSessionBindingListener
event
- session binding eventpublic void valueUnbound(javax.servlet.http.HttpSessionBindingEvent event)
valueUnbound
in interface javax.servlet.http.HttpSessionBindingListener
event
- session binding eventprivate Map getFolderPageHistory()
public void setPipeline(String pipeline)
setPipeline
in interface org.apache.jetspeed.portalsite.PortalSiteSessionContext
public String getPipeline()
getPipeline
in interface org.apache.jetspeed.portalsite.PortalSiteSessionContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |