com.endeca.portal.data
Class SelectiveRefinementsManager

java.lang.Object
  extended by com.endeca.portal.data.SelectiveRefinementsManager

public class SelectiveRefinementsManager
extends java.lang.Object

SelectiveRefinementsManager is a singleton that manages the selective refinements lists for every data source (MDEXState) in the application, ensuring that each list is initialized exactly once for the life of the application (or until its entry is cleared).

Author:
dgrimm

Field Summary
protected static org.apache.log4j.Logger logger
           
 
Method Summary
protected  java.lang.Object clone()
           
static SelectiveRefinementsManager getInstance()
           
protected  java.util.List<java.lang.String> getNonNullBaseAttributes(javax.portlet.PortletRequest request, MDEXState mdexState)
          Returns a list of attributes that have values in the data source's base view
 java.util.List<java.lang.String> getSelectiveRefinements(java.lang.String mdexStateId)
          The selective refinements list for the specified data source
 void initSelectiveRefinements(javax.portlet.PortletRequest request, MDEXState mdexState)
          Initialize mdexState selective refinements list given the data source configuration.
 boolean isSelectiveRefinementsEnabled(MDEXState mdexState)
          Determines if selective refinements is enabled for the specified data source.
 void removeSelectiveRefinements(java.lang.String mdexStateId)
          Removes selective refinements list for the specified data source, effectively clearing its cached values so that it will be re-initialized.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

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

getInstance

public static SelectiveRefinementsManager getInstance()

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

initSelectiveRefinements

public void initSelectiveRefinements(javax.portlet.PortletRequest request,
                                     MDEXState mdexState)
                              throws DataSourceException
Initialize mdexState selective refinements list given the data source configuration. Only initialized when config exists, selective refinements is enabled and not already initialized. Adds auto-detected attribute names plus additional attribute names and subtracts excluded attribute names.

Parameters:
config - Selective Refinements configuration from the data source
Throws:
DataSourceException

getSelectiveRefinements

public java.util.List<java.lang.String> getSelectiveRefinements(java.lang.String mdexStateId)
The selective refinements list for the specified data source

Parameters:
mdexStateId - data source id
Returns:
selective refinements list

removeSelectiveRefinements

public void removeSelectiveRefinements(java.lang.String mdexStateId)
Removes selective refinements list for the specified data source, effectively clearing its cached values so that it will be re-initialized.

Parameters:
mdexStateId - data source id

isSelectiveRefinementsEnabled

public boolean isSelectiveRefinementsEnabled(MDEXState mdexState)
Determines if selective refinements is enabled for the specified data source.

Parameters:
mdexState - data source
Returns:
true if it is enabled and the list is not null

getNonNullBaseAttributes

protected java.util.List<java.lang.String> getNonNullBaseAttributes(javax.portlet.PortletRequest request,
                                                                    MDEXState mdexState)
                                                             throws DataSourceException
Returns a list of attributes that have values in the data source's base view

Parameters:
mdexState - the data source
request - the portlet request
Returns:
list of attribute names
Throws:
DataSourceException