public class FilteringManager extends GenericService
Modifier and Type | Class and Description |
---|---|
protected class |
FilteringManager.ClassComparator
a comparator class that sorts Class objects
based on inheritance.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
SERVICE_INFO_KEY
DEFAULT_LOG_TRACE_STATUS
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
Constructor and Description |
---|
FilteringManager()
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
addComponentConfiguration(org.w3c.dom.Document pDocument)
Adds the configuration for components for the given XML Document object
|
protected void |
addItemDescriptorConfiguration(org.w3c.dom.Element pComponentElement,
java.lang.Object pComponent,
org.w3c.dom.NodeList pItemDescriptors,
java.lang.String pTemplateId)
Adds the filtering configuration for item descriptors
|
protected void |
addPropertyConfiguration(org.w3c.dom.NodeList pProperties,
ComponentConfiguration pComponentFilteringConfiguration)
Adds property level configuration to the ComponentFilteringConfiguration object
|
protected javax.servlet.Servlet |
createAdminServlet()
Creates and returns a new Servlet that will administer this
service.
|
void |
doStartService()
Initializes filtering and aliasing by reading in the configuration and generating the needed objects
|
void |
doStopService()
This is called when a Service is required to shut down.
|
protected ComponentConfiguration |
getClassFilteredComponent(java.lang.String pName,
java.util.Set<java.lang.Class<?>> pClassFilters,
java.util.Map<java.lang.String,ComponentConfiguration> pMap)
check for any component config matches based
on superclasses/interfaces in the passed in map of
component configs
|
java.util.List<java.lang.String> |
getClassNameForJSONFilter(java.lang.String pClassName,
JSONObject pJSON)
given a class name, determine possible class names to use
for looking up a filter in a json filter construct
|
atg.xml.XMLFile[] |
getConfigurationFiles() |
protected java.lang.Class |
getFilterClassFromName(java.lang.String pClassName)
get the class object for the given class name
|
ComponentConfiguration |
getFilteredComponent(java.lang.String pName)
Returns the filtering configuration for the given component name.
|
ComponentConfiguration |
getFilteredComponent(java.lang.String pName,
java.lang.String pTemplateId)
Returns the filtering configuration for the given component name and template id.
|
ComponentConfiguration |
getFilteredComponent(java.lang.String pName,
java.lang.String[] pTemplateIds)
Returns the filtering configuration for the given component name and template ids.
|
java.util.Map<java.lang.String,ComponentConfiguration> |
getFilteredComponents()
A Map of ComponentConfiguration objects whose key is a property name
|
boolean |
getIgnoreExpandableOutputForSpecificClasses() |
java.lang.String[] |
getNonExpandableClassesList() |
atg.xml.tools.XMLToDOMParser |
getXMLToDOMParser() |
atg.xml.tools.XMLToolsFactory |
getXMLToolsFactory() |
protected void |
initializeConfiguration(atg.xml.XMLFile[] pFiles)
Initializes the configuration of the FilteringManager by parsing the configuration files
|
protected void |
processComponentConfiguration(org.w3c.dom.Element pElement,
ComponentResolver pComponentResolver)
process a component configuration
|
void |
reinitialize()
Rereads the XML configuration file and reconstructs the filter configurations
|
void |
setConfigurationFiles(atg.xml.XMLFile[] pConfigurationFiles) |
void |
setIgnoreExpandableOutputForSpecificClasses(boolean pIgnoreExpandableOutputForSpecificClasses) |
void |
setNonExpandableClassesList(java.lang.String[] pNonExpandableClassesList) |
void |
setXMLToolsFactory(atg.xml.tools.XMLToolsFactory pXMLToolsFactory) |
addLogListener, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
public java.util.Map<java.lang.String,ComponentConfiguration> getFilteredComponents()
public atg.xml.XMLFile[] getConfigurationFiles()
public void setConfigurationFiles(atg.xml.XMLFile[] pConfigurationFiles)
pConfigurationFiles
- the configurationFiles to setpublic boolean getIgnoreExpandableOutputForSpecificClasses()
public void setIgnoreExpandableOutputForSpecificClasses(boolean pIgnoreExpandableOutputForSpecificClasses)
pIgnoreExpandableOutputForSpecificClasses
- public void setXMLToolsFactory(atg.xml.tools.XMLToolsFactory pXMLToolsFactory)
pXMLToolsFactory
- new value to setpublic atg.xml.tools.XMLToolsFactory getXMLToolsFactory()
XMLToolsFactory
public atg.xml.tools.XMLToDOMParser getXMLToDOMParser()
public void setNonExpandableClassesList(java.lang.String[] pNonExpandableClassesList)
pXMLToolsFactory
- new value to setpublic java.lang.String[] getNonExpandableClassesList()
XMLToolsFactory
protected javax.servlet.Servlet createAdminServlet()
GenericService
createAdminServlet
in class GenericService
public ComponentConfiguration getFilteredComponent(java.lang.String pName)
pName
- the name of the filtering configuration to retrievepublic ComponentConfiguration getFilteredComponent(java.lang.String pName, java.lang.String pTemplateId)
pName
- the name of the filtering configuration to retrievepTemplateId
- the template idpublic ComponentConfiguration getFilteredComponent(java.lang.String pName, java.lang.String[] pTemplateIds)
pName
- the name of the filtering configuration to retrievepTemplateIds
- the array of template idsprotected ComponentConfiguration getClassFilteredComponent(java.lang.String pName, java.util.Set<java.lang.Class<?>> pClassFilters, java.util.Map<java.lang.String,ComponentConfiguration> pMap)
public java.util.List<java.lang.String> getClassNameForJSONFilter(java.lang.String pClassName, JSONObject pJSON) throws JSONException
pClassName
- the class name for the current containerthe
- json object containing the filters for the requestJSONException
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if the configuration cannot be parsed correctlypublic void doStopService() throws ServiceException
doStopService
in class GenericService
ServiceException
- if the Service had a problem shutting downprotected void initializeConfiguration(atg.xml.XMLFile[] pFiles) throws ServiceException
pFiles
- the configuration file(s)ServiceException
- if the XMLToDOMParser is not configuredprotected void addComponentConfiguration(org.w3c.dom.Document pDocument) throws ServiceException
pDocument
- the XML Document object to read and use to configure the FilteringManagerServiceException
- if an invalid item descriptor name is specifiedprotected void processComponentConfiguration(org.w3c.dom.Element pElement, ComponentResolver pComponentResolver) throws ServiceException
pElement
- the component elementpComponentResolver
- the component resolverServiceException
- if an invalid item descriptor
name is specifiedprotected void addItemDescriptorConfiguration(org.w3c.dom.Element pComponentElement, java.lang.Object pComponent, org.w3c.dom.NodeList pItemDescriptors, java.lang.String pTemplateId) throws ServiceException
pComponentElement
- the DOM element object representing the filtered componentpComponent
- the actual component that is filteredpItemDescriptors
- the DOM nodes representing the item descriptorspTemplateId
- if this is a template, the id of the templateServiceException
- if an invalid item descriptor name is givenprotected void addPropertyConfiguration(org.w3c.dom.NodeList pProperties, ComponentConfiguration pComponentFilteringConfiguration) throws ServiceException
pProperties
- the NodeList which contains all the property level datapComponentFilteringConfiguration
- the component filtering configuration object which to add the property level dataServiceException
- if the property information could not be initializedprotected java.lang.Class getFilterClassFromName(java.lang.String pClassName)
pClassName
- either just the class name, or the class name plus depthpublic void reinitialize() throws ServiceException
ServiceException