Package edu.uiuc.ncsa.security.core.cf
Class CFMultiConfigurations
- java.lang.Object
- 
- edu.uiuc.ncsa.security.core.cf.CFMultiConfigurations
 
- 
- All Implemented Interfaces:
- MultiConfigurationsInterface
 
 public class CFMultiConfigurations extends Object implements MultiConfigurationsInterface Configuration Utility that allows for inheritance from other configurations. This also has sseveral static methods to help with migration of existing configurations. For testing this see the MultipleInheritanceTest in the testing harness, which exercises this very well.Created by Jeff Gaynor 
 on 1/31/21 at 4:59 PM
- 
- 
Field SummaryFields Modifier and Type Field Description static StringALIAS_TAGstatic StringDEFAULT_PARENT_LIST_DELIMITERstatic StringEXTENDS_TAGstatic StringLIST_DELIMITERSstatic StringNAME_TAG
 - 
Constructor SummaryConstructors Constructor Description CFMultiConfigurations()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Node>getAllNodes()Every node with a name attributestatic CFNodegetAllNodes(CFNode node, String name)Use this to get all the named nodes off the list.static StringgetAttributeInNode(CFNode node, String nodeName, String attributeName)Looks for the given node and returns the first attribute.static List<CFNode>getChildren(CFNode node, String name)The contract is that this will return all the named children nodes of the given node in order So if the argument is [node0,node1,...] Then result is all the children of node0, followed by all the children of node1,...static StringgetFirstAttribute(CFNode node, String name)Get the very first attribute with the given name found in the nodes.static booleangetFirstBooleanValue(CFNode node, String attrib)Get the first attribute and return a boolean.static booleangetFirstBooleanValue(CFNode node, String attrib, boolean defaultValue)Finds the first attribute with the given name and then converts to boolean.static longgetFirstLongValue(CFNode node, String attrib)static longgetFirstLongValue(CFNode node, String attrib, long defaultValue)static CFNodegetFirstNode(CFNode node, String name)Return the first named child configuration node of the given node or null if there is no such named child.MultipleInheritanceEnginegetInheritanceEngine()CFNodegetNamedConfig(String cfgName)This will return all theNodes with the given name.InheritanceMapgetNamedNodes()Every named node that does not have an alias, i.e.static StringgetNodeContents(CFNode node, String name)Convenience method for getting the value of a single node, i.e.static StringgetNodeContents(CFNode node, String name, String defaultValue)Convenience method for getting the value of a single node, i.e.static StringgetNodeValue(CFNode node, String name)Synonym firgetNodeContents(CFNode, String)for backwards compatibilitystatic StringgetNodeValue(CFNode node, String name, String defaultValue)Synonym forgetNodeContents(CFNode, String, String)for backwards compatility.voidingestConfig(CFBundle cfg, String tagName)protected List<String>splitParentList(String rawList)If the list starts with one of theLIST_DELIMITERS, use that otherwise, use a blank.
 
- 
- 
- 
Field Detail- 
EXTENDS_TAGpublic static final String EXTENDS_TAG - See Also:
- Constant Field Values
 
 - 
NAME_TAGpublic static final String NAME_TAG - See Also:
- Constant Field Values
 
 - 
ALIAS_TAGpublic static final String ALIAS_TAG - See Also:
- Constant Field Values
 
 - 
LIST_DELIMITERSpublic static final String LIST_DELIMITERS - See Also:
- Constant Field Values
 
 - 
DEFAULT_PARENT_LIST_DELIMITERpublic static final String DEFAULT_PARENT_LIST_DELIMITER - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getNamedNodespublic InheritanceMap getNamedNodes() Every named node that does not have an alias, i.e. "real" nodes
 - 
getInheritanceEnginepublic MultipleInheritanceEngine getInheritanceEngine() - Specified by:
- getInheritanceEnginein interface- MultiConfigurationsInterface
 
 - 
getNamedConfigpublic CFNode getNamedConfig(String cfgName) This will return all theNodes with the given name.- Parameters:
- cfgName-
- Returns:
 
 - 
splitParentListprotected List<String> splitParentList(String rawList) If the list starts with one of theLIST_DELIMITERS, use that otherwise, use a blank. Leading and trailing blanks on entries are ignored.
 E.g. a list of;A;B;C means ; is the delimiter. You only need to put the delimeter first if it is not a blank, so "A B C" is fine. Different delimeter let you have embedded blanks etc. E.g. ";mairzy doats;and dozey;daots! and" parses as "mairzey doats", "and dozey", "doats! and"- Parameters:
- rawList-
- Returns:
 
 - 
getFirstAttributepublic static String getFirstAttribute(CFNode node, String name) Get the very first attribute with the given name found in the nodes. A null is returned if there is no such value.- Parameters:
- node-
- name-
- Returns:
 
 - 
getFirstNodepublic static CFNode getFirstNode(CFNode node, String name) Return the first named child configuration node of the given node or null if there is no such named child. Very useful if your specification only allows for a single child node.- Parameters:
- node-
- name-
- Returns:
 
 - 
getChildrenpublic static List<CFNode> getChildren(CFNode node, String name) The contract is that this will return all the named children nodes of the given node in order So if the argument is [node0,node1,...] Then result is all the children of node0, followed by all the children of node1,... Note that you can feed the result of this list back in to get the next level of children.- Parameters:
- node-
- Returns:
 
 - 
getAllNodespublic static CFNode getAllNodes(CFNode node, String name) Use this to get all the named nodes off the list. Rather than overrides, this returns the kitchen sink. This is the equivalent of glomming together all of the like-named nodes into one big virtual node. This also gets other nodes in the configuration too so if there are multiple ones in any configuration, they are added in as well.Sometimes this is necessary. - Parameters:
- node-
- name-
- Returns:
 
 - 
getNodeContentspublic static String getNodeContents(CFNode node, String name, String defaultValue) Convenience method for getting the value of a single node, i.e. the contents, so
 <foo>value</foo>
 would have name equal to 'foo' and return the string 'value'. Returns the default value if no such value is found.- Parameters:
- node-
- name-
- defaultValue-
- Returns:
 
 - 
getNodeValuepublic static String getNodeValue(CFNode node, String name, String defaultValue) Synonym forgetNodeContents(CFNode, String, String)for backwards compatility.- Parameters:
- node-
- name-
- defaultValue-
- Returns:
 
 - 
getNodeContentspublic static String getNodeContents(CFNode node, String name) Convenience method for getting the value of a single node, i.e. the contents, so
 <foo>value</foo>
 would have name equal to 'foo' and return the string 'value'. Returns a null if no such value is found. This is also clever enough to pull things out of CDATA nodes.- Parameters:
- node-
- name-
- Returns:
 
 - 
getNodeValuepublic static String getNodeValue(CFNode node, String name) Synonym firgetNodeContents(CFNode, String)for backwards compatibility- Parameters:
- node-
- name-
- Returns:
 
 - 
getFirstBooleanValuepublic static boolean getFirstBooleanValue(CFNode node, String attrib, boolean defaultValue) Finds the first attribute with the given name and then converts to boolean. If the conversion fails, the default is returned. This supports values of true, false, on, off.- Parameters:
- node-
- attrib-
- defaultValue-
- Returns:
 
 - 
getFirstBooleanValuepublic static boolean getFirstBooleanValue(CFNode node, String attrib) Get the first attribute and return a boolean. Note that this supports values of true, false, on and off. If no such value is found, an exception is raised.- Parameters:
- node-
- attrib-
- Returns:
 
 - 
getFirstLongValuepublic static long getFirstLongValue(CFNode node, String attrib, long defaultValue) 
 
- 
 
-