atg.svc.repository.service
Class StateHolderService

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.svc.repository.service.BaseService
              extended by atg.svc.repository.service.SharedService
                  extended by atg.svc.repository.service.StateHolderService
All Implemented Interfaces:
atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener

public class StateHolderService
extends SharedService

Service for managing UI window attribute state in the repository.


Field Summary
static java.lang.String CLASS_VERSION
           
static java.lang.String COMPONENT_PATH
          State Holder Service Component
static java.lang.String WINDOW_ID_ATTRIBUTE_NAME
          Window identifier attribute name
static java.lang.String WINDOW_ID_PARAMETER_NAME
          Window identifier parameter name
 
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
StateHolderService()
           
 
Method Summary
 void clearAttributes()
          Clears all window attributes with current window ID.
 void clearAttributes(javax.servlet.http.HttpSession pSession)
          Clears all window attributes with given window ID.
 void clearAttributesOnTimeout(java.lang.String pSessionId)
          Deletes all window attributes when the specified HTTP session times out.
 java.lang.Object getAttribute(javax.servlet.http.HttpSession pWrapped, java.lang.String pKey)
          get an attribute either in the session or in the state holder
 java.lang.Object getAttribute(java.lang.String pKey)
          get an attribute
 InitialService getInitialService()
          get InitialService
static StateHolderService getInstance()
          get a reference to the state holder service component
 boolean getIsSessionValid(java.lang.String pWindowId)
          Tests whether the specified session is valid
 WindowAttribute getNewWindowAttribute(java.lang.String pSessionId, java.lang.String pWindowId, java.lang.String pKey)
          Creates a window attribute bean and fills in the default values.
 java.lang.String getNewWindowId()
          Generates and returns a new window identifier.
 java.util.Collection getRepositoryAttributeCollection(java.lang.String pWindowId)
          Retrieves state holder repository-backed attributes
 java.lang.Object getSessionAttribute(javax.servlet.http.HttpSession pSession, java.lang.String pKey)
          get a cookie attribute
 java.lang.Object getSessionAttribute(java.lang.String pKey)
          get a cookie attribute
 WindowAttribute getSessionAttributeByKey(java.lang.String pSessionId, java.lang.String pKey)
          Gets a session attribute by key.
 java.util.Map<java.lang.String,java.lang.Object> getSessionAttributeMap(java.lang.String pWindowId)
          Retrieves state holder session-backed attributes
 java.lang.Object getWindowAttribute(javax.servlet.http.HttpSession pSession, java.lang.String pKey)
          get window attribute
 java.lang.Object getWindowAttribute(java.lang.String pKey)
          get window attribute
 WindowAttribute getWindowAttributeByKey(java.lang.String pSessionId, java.lang.String pWindowId, java.lang.String pKey)
          Gets a window attribute by key.
protected  java.lang.String getWindowId()
          get the window id for the current request
 java.lang.String getWindowIdAttributeName()
           
 java.lang.String getWindowIdParameterName()
           
 boolean isPreferCookieBinding()
           
 boolean isPreferRepositoryBacking()
           
 boolean isPreferSessionBacking()
           
 boolean isPreferWindowBinding()
           
 boolean isWarnIfNoWindowId()
           
 boolean isWarnIfObjectNotSerializable()
           
 void removeAttribute(javax.servlet.http.HttpSession pSession, java.lang.String pKey)
          remove an attribute
 void removeAttribute(java.lang.String pKey)
          remove an attribute
 void removeCookieAttribute(javax.servlet.http.HttpSession pSession, java.lang.String pKey)
          remove a cookie attribute
 void removeCookieAttribute(java.lang.String pKey)
          remove a cookie attribute
 void removeWindowAttribute(javax.servlet.http.HttpSession pSession, java.lang.String pKey)
          remove a window attribute
 void removeWindowAttribute(java.lang.String pKey)
          remove a window attribute
 void removeWindowAttribute(java.lang.String pSessionId, java.lang.String pWindowId, java.lang.String pKey)
          remove a window attribute
 void saveWindowAttribute(WindowAttribute pWindowAttribute)
          Saves a window attribute.
 void setAttribute(javax.servlet.http.HttpSession pWrapped, java.lang.String pKey, java.lang.Object pValue)
          set an attribute either in the session or the state holder
 void setAttribute(java.lang.String pKey, java.lang.Object pValue)
          set an attribute
 void setInitialService(InitialService pInitialService)
          set InitialService
 void setPreferCookieBinding(boolean pPreferCookieBinding)
           
 void setPreferRepositoryBacking(boolean pPreferRepositoryBacking)
           
 void setPreferSessionBacking(boolean pPreferSessionBacking)
           
 void setPreferWindowBinding(boolean pPreferWindowBinding)
           
 void setSessionAttribute(javax.servlet.http.HttpSession pSession, java.lang.String pKey, java.lang.Object pValue)
          set a cookie attribute
 void setSessionAttribute(java.lang.String pKey, java.lang.Object pValue)
          set a cookie attribute
 void setSessionAttributeMap(java.lang.String pWindowId, java.util.Map<java.lang.String,java.lang.Object> pAttributes)
          Sets state holder session-backed attributes
 void setWarnIfNoWindowId(boolean pWarnIfNoWindowId)
           
 void setWarnIfObjectNotSerializable(boolean pWarnIfObjectNotSerializable)
           
 void setWindowAttribute(javax.servlet.http.HttpSession pSession, java.lang.String pKey, java.lang.Object pValue)
          set a window attribute
 void setWindowAttribute(java.lang.String pKey, java.lang.Object pValue)
          set a window attribute
 
Methods inherited from class atg.svc.repository.service.SharedService
getServiceSharedBeanHomes, getServiceSharedBeanHomesName, getServiceSharedRepositoryHomes, getServiceSharedRepositoryHomesName, setServiceSharedBeanHomesName, setServiceSharedRepositoryHomesName
 
Methods inherited from class atg.svc.repository.service.BaseService
getRepositoryService, getToday, setRepositoryService
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
See Also:
Constant Field Values

COMPONENT_PATH

public static final java.lang.String COMPONENT_PATH
State Holder Service Component

See Also:
Constant Field Values

WINDOW_ID_ATTRIBUTE_NAME

public static final java.lang.String WINDOW_ID_ATTRIBUTE_NAME
Window identifier attribute name

See Also:
Constant Field Values

WINDOW_ID_PARAMETER_NAME

public static final java.lang.String WINDOW_ID_PARAMETER_NAME
Window identifier parameter name

See Also:
Constant Field Values
Constructor Detail

StateHolderService

public StateHolderService()
Method Detail

isPreferCookieBinding

public boolean isPreferCookieBinding()

setPreferCookieBinding

public void setPreferCookieBinding(boolean pPreferCookieBinding)

isPreferWindowBinding

public boolean isPreferWindowBinding()

setPreferWindowBinding

public void setPreferWindowBinding(boolean pPreferWindowBinding)

isPreferRepositoryBacking

public boolean isPreferRepositoryBacking()

setPreferRepositoryBacking

public void setPreferRepositoryBacking(boolean pPreferRepositoryBacking)

isPreferSessionBacking

public boolean isPreferSessionBacking()

setPreferSessionBacking

public void setPreferSessionBacking(boolean pPreferSessionBacking)

isWarnIfNoWindowId

public boolean isWarnIfNoWindowId()

setWarnIfNoWindowId

public void setWarnIfNoWindowId(boolean pWarnIfNoWindowId)

isWarnIfObjectNotSerializable

public boolean isWarnIfObjectNotSerializable()

setWarnIfObjectNotSerializable

public void setWarnIfObjectNotSerializable(boolean pWarnIfObjectNotSerializable)

getWindowIdAttributeName

public java.lang.String getWindowIdAttributeName()
Returns:
Window ID attribute name

getWindowIdParameterName

public java.lang.String getWindowIdParameterName()
Returns:
Window ID parameter name

setInitialService

public void setInitialService(InitialService pInitialService)
set InitialService

Parameters:
pInitialService - the InitialService

getInitialService

public InitialService getInitialService()
get InitialService

Returns:
the InitialService

getWindowId

protected java.lang.String getWindowId()
get the window id for the current request


setWindowAttribute

public void setWindowAttribute(java.lang.String pKey,
                               java.lang.Object pValue)
set a window attribute


setWindowAttribute

public void setWindowAttribute(javax.servlet.http.HttpSession pSession,
                               java.lang.String pKey,
                               java.lang.Object pValue)
set a window attribute


setSessionAttribute

public void setSessionAttribute(java.lang.String pKey,
                                java.lang.Object pValue)
set a cookie attribute


setSessionAttribute

public void setSessionAttribute(javax.servlet.http.HttpSession pSession,
                                java.lang.String pKey,
                                java.lang.Object pValue)
set a cookie attribute


setAttribute

public void setAttribute(java.lang.String pKey,
                         java.lang.Object pValue)
set an attribute


setAttribute

public void setAttribute(javax.servlet.http.HttpSession pWrapped,
                         java.lang.String pKey,
                         java.lang.Object pValue)
set an attribute either in the session or the state holder


getWindowAttribute

public java.lang.Object getWindowAttribute(java.lang.String pKey)
get window attribute


getWindowAttribute

public java.lang.Object getWindowAttribute(javax.servlet.http.HttpSession pSession,
                                           java.lang.String pKey)
get window attribute


getSessionAttribute

public java.lang.Object getSessionAttribute(java.lang.String pKey)
get a cookie attribute


getSessionAttribute

public java.lang.Object getSessionAttribute(javax.servlet.http.HttpSession pSession,
                                            java.lang.String pKey)
get a cookie attribute


getAttribute

public java.lang.Object getAttribute(java.lang.String pKey)
get an attribute


getAttribute

public java.lang.Object getAttribute(javax.servlet.http.HttpSession pWrapped,
                                     java.lang.String pKey)
get an attribute either in the session or in the state holder


removeWindowAttribute

public void removeWindowAttribute(java.lang.String pKey)
remove a window attribute


removeWindowAttribute

public void removeWindowAttribute(javax.servlet.http.HttpSession pSession,
                                  java.lang.String pKey)
remove a window attribute


removeCookieAttribute

public void removeCookieAttribute(java.lang.String pKey)
remove a cookie attribute


removeCookieAttribute

public void removeCookieAttribute(javax.servlet.http.HttpSession pSession,
                                  java.lang.String pKey)
remove a cookie attribute


removeAttribute

public void removeAttribute(java.lang.String pKey)
remove an attribute


removeAttribute

public void removeAttribute(javax.servlet.http.HttpSession pSession,
                            java.lang.String pKey)
remove an attribute


clearAttributes

public void clearAttributes()
                     throws ObjectNotFoundException,
                            PersistenceException
Clears all window attributes with current window ID.

Throws:
ObjectNotFoundException
PersistenceException

clearAttributes

public void clearAttributes(javax.servlet.http.HttpSession pSession)
                     throws ObjectNotFoundException,
                            PersistenceException
Clears all window attributes with given window ID.

Throws:
ObjectNotFoundException
PersistenceException

clearAttributesOnTimeout

public void clearAttributesOnTimeout(java.lang.String pSessionId)
                              throws ObjectNotFoundException,
                                     PersistenceException
Deletes all window attributes when the specified HTTP session times out.

Parameters:
pSessionId - A J2EE HTTP session identifier.
Throws:
ObjectNotFoundException
PersistenceException

getNewWindowId

public java.lang.String getNewWindowId()
Generates and returns a new window identifier.

Returns:
The new window ID.

getSessionAttributeByKey

public WindowAttribute getSessionAttributeByKey(java.lang.String pSessionId,
                                                java.lang.String pKey)
Gets a session attribute by key.

Parameters:
pSessionId - The HTTP session identifier.
pKey - A valid window attribute key.
Returns:
The specified attribute object for the window.

getWindowAttributeByKey

public WindowAttribute getWindowAttributeByKey(java.lang.String pSessionId,
                                               java.lang.String pWindowId,
                                               java.lang.String pKey)
Gets a window attribute by key.

Parameters:
pSessionId - The HTTP session identifier.
pWindowId - The window for which to retrieve panel state.
pKey - A valid window attribute key.
Returns:
The specified attribute object for the window.

saveWindowAttribute

public void saveWindowAttribute(WindowAttribute pWindowAttribute)
                         throws ObjectNotFoundException,
                                PersistenceException
Saves a window attribute.

Parameters:
pWindowAttribute - The window attribute bean to save.
Throws:
ObjectNotFoundException
PersistenceException

removeWindowAttribute

public void removeWindowAttribute(java.lang.String pSessionId,
                                  java.lang.String pWindowId,
                                  java.lang.String pKey)
remove a window attribute


getRepositoryAttributeCollection

public java.util.Collection getRepositoryAttributeCollection(java.lang.String pWindowId)
Retrieves state holder repository-backed attributes


getSessionAttributeMap

public java.util.Map<java.lang.String,java.lang.Object> getSessionAttributeMap(java.lang.String pWindowId)
Retrieves state holder session-backed attributes


setSessionAttributeMap

public void setSessionAttributeMap(java.lang.String pWindowId,
                                   java.util.Map<java.lang.String,java.lang.Object> pAttributes)
Sets state holder session-backed attributes


getIsSessionValid

public boolean getIsSessionValid(java.lang.String pWindowId)
Tests whether the specified session is valid


getNewWindowAttribute

public WindowAttribute getNewWindowAttribute(java.lang.String pSessionId,
                                             java.lang.String pWindowId,
                                             java.lang.String pKey)
Creates a window attribute bean and fills in the default values.

Parameters:
pSessionId - The HTTP session id.
pWindowId - The window id.
pKey - The attribute key.
Returns:
A UserPanel beanImpl

getInstance

public static StateHolderService getInstance()
get a reference to the state holder service component