com.endeca.portal.data
Class AbstractMDEXStateManager

java.lang.Object
  extended by com.endeca.portal.data.AbstractMDEXStateManager
All Implemented Interfaces:
MDEXStateManager, java.io.Serializable
Direct Known Subclasses:
DefaultMDEXStateManager

public abstract class AbstractMDEXStateManager
extends java.lang.Object
implements MDEXStateManager

An abstract base class for MDEX State Managers. Contains utility methods that implementing classes may find useful.

Author:
Endeca Technologies, Inc.
See Also:
Serialized Form

Field Summary
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
AbstractMDEXStateManager()
           
 
Method Summary
protected  void addEventTrigger(javax.portlet.PortletRequest request, MDEXState ds)
          Use this method to make sure an appropriate change event will be triggered for an altered MDEXState.
abstract  QueryState handleStateInitial(javax.portlet.PortletRequest request, MDEXState mdexState)
          Handles retrieval of the initial query state from a data source; used for query-time determination of the query a portlet should fire during portlet execution.
abstract  QueryState handleStateMerge(javax.portlet.PortletRequest request, MDEXState mdexState)
          Handles retrieval of a query state from a data source; used for query-time determination of the query a portlet should fire during portlet execution.
abstract  void handleStateReset(javax.portlet.PortletRequest request, MDEXState mdexState)
          Handle resetting of the query state to its initial state; used for initialization of a data source or user-visible controls to remove all filters.
abstract  void handleStateUpdate(javax.portlet.PortletRequest request, MDEXState mdexState, QueryState newQueryState)
          Handles updating a data source with a new query state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger
Constructor Detail

AbstractMDEXStateManager

public AbstractMDEXStateManager()
Method Detail

handleStateUpdate

public abstract void handleStateUpdate(javax.portlet.PortletRequest request,
                                       MDEXState mdexState,
                                       QueryState newQueryState)
                                throws QueryStateException
Description copied from interface: MDEXStateManager
Handles updating a data source with a new query state. This method is called internally to DataSource.setQueryState(QueryState newState)

Specified by:
handleStateUpdate in interface MDEXStateManager
Parameters:
request - the current PortletRequest
mdexState - the MDEXState representing the current data source
newQueryState - the query state to be set onto the data source
Throws:
QueryStateException

handleStateMerge

public abstract QueryState handleStateMerge(javax.portlet.PortletRequest request,
                                            MDEXState mdexState)
                                     throws QueryStateException
Description copied from interface: MDEXStateManager
Handles retrieval of a query state from a data source; used for query-time determination of the query a portlet should fire during portlet execution. This method is called internally to DataSource.getQueryState()

Specified by:
handleStateMerge in interface MDEXStateManager
Parameters:
request - the current PortletRequest
mdexState - the MDEXState representing the current data source
Returns:
the portlet-visible QueryState as determined by the request and mdexState
Throws:
QueryStateException

handleStateReset

public abstract void handleStateReset(javax.portlet.PortletRequest request,
                                      MDEXState mdexState)
                               throws QueryStateException
Description copied from interface: MDEXStateManager
Handle resetting of the query state to its initial state; used for initialization of a data source or user-visible controls to remove all filters. This method is called internally to DataSource.resetQueryState()

Specified by:
handleStateReset in interface MDEXStateManager
Parameters:
request - the current PortletRequest
mdexState - the MDEXState representing the current data source
Throws:
QueryStateException

handleStateInitial

public abstract QueryState handleStateInitial(javax.portlet.PortletRequest request,
                                              MDEXState mdexState)
                                       throws QueryStateException
Description copied from interface: MDEXStateManager
Handles retrieval of the initial query state from a data source; used for query-time determination of the query a portlet should fire during portlet execution. This method is called internally to DataSource.getInitialQueryState()

Specified by:
handleStateInitial in interface MDEXStateManager
Parameters:
request - the current PortletRequest
mdexState - the MDEXState representing the current data source
Returns:
the portlet-visible initial QueryState as determined by the request and mdexState
Throws:
QueryStateException

addEventTrigger

protected void addEventTrigger(javax.portlet.PortletRequest request,
                               MDEXState ds)
Use this method to make sure an appropriate change event will be triggered for an altered MDEXState. Implementers should call this method from handleStateReset(PortletRequest, MDEXState) and from handleStateUpdate(PortletRequest, MDEXState, QueryState) to ensure all portlets are aware of the change.

Parameters:
request - the current PortletRequest
ds - The MDEXState representing the data source that has changed and needs an event triggered