From: Seth P. <se...@us...> - 2004-04-26 16:46:27
|
Update of /cvsroot/sunxacml/sunxacml/com/sun/xacml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21997/com/sun/xacml Modified Files: ConfigurationStore.java Log Message: updated to use version 0.2 of the schema Index: ConfigurationStore.java =================================================================== RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/ConfigurationStore.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConfigurationStore.java 17 Mar 2004 18:03:37 -0000 1.2 --- ConfigurationStore.java 26 Apr 2004 16:46:18 -0000 1.3 *************** *** 100,104 **** * This way, the programmer still has full control over their security model, * but also has the convenience of re-using a common configuration ! * mechanism. * <p> * Note that becuase this doesn't tie directly into the rest of the code, you --- 100,105 ---- * This way, the programmer still has full control over their security model, * but also has the convenience of re-using a common configuration ! * mechanism. See http://sunxacml.sourceforge.net/schama/config-0.2.xsd for ! * the valid schama. * <p> * Note that becuase this doesn't tie directly into the rest of the code, you *************** *** 123,131 **** "com.sun.xacml.PDPConfigFile"; - /** - * Identifier for the default named elements. - */ - public static final String DEFAULT_IDENTIFIER = "default"; - // pdp elements private PDPConfig defaultPDPConfig; --- 124,127 ---- *************** *** 202,205 **** --- 198,211 ---- functionMap = new HashMap(); + // get the default names + NamedNodeMap attrs = root.getAttributes(); + String defaultPDP = attrs.getNamedItem("defaultPDP").getNodeValue(); + String defaultAF = attrs.getNamedItem("defaultAttributeFactory"). + getNodeValue(); + String defaultCAF = attrs.getNamedItem("defaultCombiningAlgFactory"). + getNodeValue(); + String defaultFF = attrs.getNamedItem("defaultFunctionFactory"). + getNodeValue(); + // loop through all the root-level elements, for each one getting its // name and then loading the right kind of element *************** *** 210,224 **** String elementName = null; ! // get the element's name, or default to DEFAULT_IDENTIFIER ! NamedNodeMap attrMap = child.getAttributes(); ! if (attrMap == null) { ! elementName = DEFAULT_IDENTIFIER; ! } else { ! Node attr = attrMap.getNamedItem("name"); ! if (attr == null) ! elementName = DEFAULT_IDENTIFIER; ! else ! elementName = attr.getNodeValue(); ! } // see if this is a pdp or a factory, and load accordingly, --- 216,223 ---- String elementName = null; ! // get the element's name ! if (child.getNodeType() == Node.ELEMENT_NODE) ! elementName = child.getAttributes(). ! getNamedItem("name").getNodeValue(); // see if this is a pdp or a factory, and load accordingly, *************** *** 262,276 **** } ! // finally, extract the default elements, if they were specified... ! // this is done as an optimizaion on the assumption that people will ! // call the getDefault* methods more than once, but may be removed ! // if that assumption proves to be incorrect in practice ! defaultPDPConfig = (PDPConfig)(pdpConfigMap.get(DEFAULT_IDENTIFIER)); defaultAttributeFactory = (AttributeFactory) ! (attributeMap.get(DEFAULT_IDENTIFIER)); defaultCombiningFactory = (CombiningAlgFactory) ! (combiningMap.get(DEFAULT_IDENTIFIER)); defaultFunctionFactoryProxy = (FunctionFactoryProxy) ! (functionMap.get(DEFAULT_IDENTIFIER)); } --- 261,272 ---- } ! // finally, extract the default elements ! defaultPDPConfig = (PDPConfig)(pdpConfigMap.get(defaultPDP)); defaultAttributeFactory = (AttributeFactory) ! (attributeMap.get(defaultAF)); defaultCombiningFactory = (CombiningAlgFactory) ! (combiningMap.get(defaultCAF)); defaultFunctionFactoryProxy = (FunctionFactoryProxy) ! (functionMap.get(defaultFF)); } |