|
|||||||||
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.rest.filtering.FilteringManager
public class FilteringManager
This class manages REST filtering and aliasing configuration. It is responsible for initialization of the filtering and aliasing configuration. In addition it provides runtime functionality which implements the rules from the configuration.
ComponentConfiguration
,
PropertyConfiguration
,
RestPropertyCustomizer
Nested Class Summary | |
---|---|
protected class |
FilteringManager.ClassComparator
a comparator class that sorts Class objects based on inheritance. |
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 | |
---|---|
FilteringManager()
Constructor |
Method Summary | |
---|---|
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 |
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.HashMap<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 |
setConfigurationFiles(atg.xml.XMLFile[] pConfigurationFiles)
|
void |
setIgnoreExpandableOutputForSpecificClasses(boolean pIgnoreExpandableOutputForSpecificClasses)
|
void |
setNonExpandableClassesList(java.lang.String[] pNonExpandableClassesList)
|
void |
setXMLToolsFactory(atg.xml.tools.XMLToolsFactory pXMLToolsFactory)
|
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 FilteringManager()
Method Detail |
---|
public java.util.HashMap<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
public ComponentConfiguration getFilteredComponent(java.lang.String pName)
pName
- the name of the filtering configuration to retrieve
public ComponentConfiguration getFilteredComponent(java.lang.String pName, java.lang.String pTemplateId)
pName
- the name of the filtering configuration to retrievepTemplateId
- the template id
public ComponentConfiguration getFilteredComponent(java.lang.String pName, java.lang.String[] pTemplateIds)
pName
- the name of the filtering configuration to retrievepTemplateIds
- the array of template ids
protected 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 request
JSONException
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 FilteringManager
ServiceException
- 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 resolver
ServiceException
- 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 template
ServiceException
- 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 data
ServiceException
- 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 depth
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |