|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.multisite.SiteContextManager
public class SiteContextManager
This is a global service that manages SiteContext objects. It can be used to get a new SiteContext object based on a specified SiteContext definition, or a site ID.
This service manages a stack of SiteContext objects so threads can manipulate the current SiteContext via push and pop methods.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
SiteContextManager()
Constructs an instanceof SiteContextManager |
Method Summary | |
---|---|
void |
clearSiteContextStack()
clear the stack of all site contexts |
protected void |
displayStackContents()
display the contents of the stack for debugging purposes |
void |
doStartService()
start service |
static Site |
getCurrentSite()
a convenience method to get the site associated with the current site context |
static SiteContext |
getCurrentSiteContext()
get the current site context. |
static java.lang.String |
getCurrentSiteId()
a convenience method to get the id for the site associated with the current site context |
SiteContext |
getEmptySiteContext()
get an empty site context |
Site |
getSite(java.lang.String pSiteId)
get a site by site id |
SiteContext |
getSiteContext(Site pSite)
create a site context using a specific site item |
SiteContext |
getSiteContext(java.lang.String pSiteId)
get a specific site context |
SiteManager |
getSiteManager()
get SiteManager |
atg.multisite.SiteStorageAdapter |
getSiteStorageAdapter()
get SiteStorageAdapter |
boolean |
isEnableStackWarnings()
get EnableStackWarnings |
boolean |
isMaintainMembershipContext()
|
protected boolean |
isSiteSnapshotsEnabledLive()
check to see if site snapshots are enabled in the live setting, regardless of the current value of enableSiteSnapshots. |
SiteContext |
popSiteContext(SiteContext pContext)
pop the current site context off the stack. |
SiteContext |
popSiteContext(SiteContext pContext,
boolean pIgnoreWarning)
pop the current site context off the stack. |
boolean |
pushSiteContext(SiteContext pContext)
push current site context on stack |
protected java.lang.String |
registerSessionWithSnapshotCache()
register a site session with the current site snapshot cache. |
void |
setEnableStackWarnings(boolean pEnableStackWarnings)
set EnableStackWarnings - if true, will generate warnings for issues with the site context stack |
void |
setMaintainMembershipContext(boolean pMaintainMembershipContext)
Do not change this property on a running system. |
void |
setSiteManager(SiteManager pSiteManager)
set SiteManager |
void |
setSiteStorageAdapter(atg.multisite.SiteStorageAdapter pSiteStorageAdapter)
set SiteStorageAdapter |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public SiteContextManager()
Method Detail |
---|
public void setSiteStorageAdapter(atg.multisite.SiteStorageAdapter pSiteStorageAdapter)
pSiteStorageAdapter
- the SiteStorageAdapterpublic atg.multisite.SiteStorageAdapter getSiteStorageAdapter()
public void setEnableStackWarnings(boolean pEnableStackWarnings)
pEnableStackWarnings
- the EnableStackWarningspublic boolean isEnableStackWarnings()
public void setSiteManager(SiteManager pSiteManager)
pSiteManager
- the SiteManagerpublic SiteManager getSiteManager()
public boolean isMaintainMembershipContext()
public void setMaintainMembershipContext(boolean pMaintainMembershipContext)
pMaintainMembershipContext
- public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the Service had a problem starting uppublic Site getSite(java.lang.String pSiteId) throws SiteContextException
pSiteId
- the ID of the site to get
SiteContextException
- if there was an error getting
the sitepublic boolean pushSiteContext(SiteContext pContext) throws SiteContextException
pContext
- the SiteContext to push on the stack
SiteContextException
- if pContext is nullpublic SiteContext popSiteContext(SiteContext pContext)
If loggingDebug is set to true on this component, then the stack contents are displayed in the debug output on each push/pop call. Each SiteContext on the stack is displayed along with the name of the calling class and method, as well as the line number of where the push call was made that placed the given SiteContext on the stact.
pContext
- the SiteContext to get popped off the stack. must
match the SiteContext currently on the top of the stack
public SiteContext popSiteContext(SiteContext pContext, boolean pIgnoreWarning)
If loggingDebug is set to true on this component, then the stack contents are displayed in the debug output on each push/pop call. Each SiteContext on the stack is displayed along with the name of the calling class and method, as well as the line number of where the push call was made that placed the given SiteContext on the stact.
pContext
- the SiteContext to get popped off the stack. must
match the SiteContext currently on the top of the stackpIgnoreWarning
- if true, do not log warnings about stack inconsistencies
public void clearSiteContextStack()
public static java.lang.String getCurrentSiteId()
public static Site getCurrentSite()
public static SiteContext getCurrentSiteContext()
public SiteContext getSiteContext(java.lang.String pSiteId) throws SiteContextException
pSiteId
- the Id of the site to base the
SiteContext object off of
SiteContextException
- if pSiteId is nullpublic SiteContext getSiteContext(Site pSite) throws SiteContextException
pSite
- the site object to use for this context
SiteContextException
- if pSite is nullpublic SiteContext getEmptySiteContext()
protected void displayStackContents()
protected java.lang.String registerSessionWithSnapshotCache()
protected boolean isSiteSnapshotsEnabledLive()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |