From: <se...@us...> - 2003-10-25 21:43:15
|
Update of /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine In directory sc8-pr-cvs1:/tmp/cvs-serv28155/com/sun/xacml/combine Modified Files: CombiningAlgFactory.java Log Message: updated addCombiningAlg method to use the identifier from the alg interface Index: CombiningAlgFactory.java =================================================================== RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/CombiningAlgFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CombiningAlgFactory.java 25 Aug 2003 16:46:33 -0000 1.4 --- CombiningAlgFactory.java 25 Oct 2003 21:35:55 -0000 1.5 *************** *** 1,5 **** /* ! * @(#)CombiningAlgFactory.java 1.6 01/30/03 * * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. --- 1,5 ---- /* ! * @(#)CombiningAlgFactory.java * * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. *************** *** 70,100 **** */ ! algMap.put(DenyOverridesRuleAlg.algId, ! new DenyOverridesRuleAlg()); ! algMap.put(DenyOverridesPolicyAlg.algId, ! new DenyOverridesPolicyAlg()); ! algMap.put(OrderedDenyOverridesRuleAlg.algId, ! new OrderedDenyOverridesRuleAlg()); ! algMap.put(OrderedDenyOverridesPolicyAlg.algId, ! new OrderedDenyOverridesPolicyAlg()); ! algMap.put(PermitOverridesRuleAlg.algId, ! new PermitOverridesRuleAlg()); ! algMap.put(PermitOverridesPolicyAlg.algId, ! new PermitOverridesPolicyAlg()); ! algMap.put(OrderedPermitOverridesRuleAlg.algId, ! new OrderedPermitOverridesRuleAlg()); ! algMap.put(OrderedPermitOverridesPolicyAlg.algId, ! new OrderedPermitOverridesPolicyAlg()); ! algMap.put(FirstApplicableRuleAlg.algId, ! new FirstApplicableRuleAlg()); ! algMap.put(FirstApplicablePolicyAlg.algId, ! new FirstApplicablePolicyAlg()); ! algMap.put(OnlyOneApplicablePolicyAlg.algId, ! new OnlyOneApplicablePolicyAlg()); } --- 70,89 ---- */ ! addCombiningAlg(new DenyOverridesRuleAlg()); ! addCombiningAlg(new DenyOverridesPolicyAlg()); ! addCombiningAlg(new OrderedDenyOverridesRuleAlg()); ! addCombiningAlg(new OrderedDenyOverridesPolicyAlg()); ! addCombiningAlg(new PermitOverridesRuleAlg()); ! addCombiningAlg(new PermitOverridesPolicyAlg()); ! addCombiningAlg(new OrderedPermitOverridesRuleAlg()); ! addCombiningAlg(new OrderedPermitOverridesPolicyAlg()); ! addCombiningAlg(new FirstApplicableRuleAlg()); ! addCombiningAlg(new FirstApplicablePolicyAlg()); ! addCombiningAlg(new OnlyOneApplicablePolicyAlg()); } *************** *** 112,129 **** * id given here. * - * @param algId the identifier by which the algorithm is known * @param alg the combining algorithm to add * * @throws ProcessingException if the algId is already registered */ ! public static void addCombiningAlg(URI algId, CombiningAlgorithm alg) throws ProcessingException { // check that the id doesn't already exist in the factory ! if (algMap.containsKey(algId.toString())) throw new ProcessingException("algorithm already registered"); // add the algorithm ! algMap.put(algId.toString(), alg); } --- 101,119 ---- * id given here. * * @param alg the combining algorithm to add * * @throws ProcessingException if the algId is already registered */ ! public static void addCombiningAlg(CombiningAlgorithm alg) throws ProcessingException { + String algId = alg.getIdentifier().toString(); + // check that the id doesn't already exist in the factory ! if (algMap.containsKey(algId)) throw new ProcessingException("algorithm already registered"); // add the algorithm ! algMap.put(algId, alg); } |