Update of /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine
In directory sc8-pr-cvs1:/tmp/cvs-serv21267
Modified Files:
CombiningAlgFactory.java CombiningAlgorithm.java
DenyOverridesPolicyAlg.java DenyOverridesRuleAlg.java
FirstApplicablePolicyAlg.java FirstApplicableRuleAlg.java
OnlyOneApplicablePolicyAlg.java PermitOverridesPolicyAlg.java
PermitOverridesRuleAlg.java PolicyCombiningAlgorithm.java
RuleCombiningAlgorithm.java
Log Message:
updated to use new ordered sub-classes and to support identity
Index: CombiningAlgFactory.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/CombiningAlgFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CombiningAlgFactory.java 14 Aug 2003 22:56:48 -0000 1.3
--- CombiningAlgFactory.java 25 Aug 2003 16:46:33 -0000 1.4
***************
*** 75,82 ****
new DenyOverridesPolicyAlg());
! algMap.put(DenyOverridesRuleAlg.orderedAlgId,
! new DenyOverridesRuleAlg());
! algMap.put(DenyOverridesPolicyAlg.orderedAlgId,
! new DenyOverridesPolicyAlg());
algMap.put(PermitOverridesRuleAlg.algId,
--- 75,82 ----
new DenyOverridesPolicyAlg());
! algMap.put(OrderedDenyOverridesRuleAlg.algId,
! new OrderedDenyOverridesRuleAlg());
! algMap.put(OrderedDenyOverridesPolicyAlg.algId,
! new OrderedDenyOverridesPolicyAlg());
algMap.put(PermitOverridesRuleAlg.algId,
***************
*** 85,92 ****
new PermitOverridesPolicyAlg());
! algMap.put(PermitOverridesRuleAlg.orderedAlgId,
! new PermitOverridesRuleAlg());
! algMap.put(PermitOverridesPolicyAlg.orderedAlgId,
! new PermitOverridesPolicyAlg());
algMap.put(FirstApplicableRuleAlg.algId,
--- 85,92 ----
new PermitOverridesPolicyAlg());
! algMap.put(OrderedPermitOverridesRuleAlg.algId,
! new OrderedPermitOverridesRuleAlg());
! algMap.put(OrderedPermitOverridesPolicyAlg.algId,
! new OrderedPermitOverridesPolicyAlg());
algMap.put(FirstApplicableRuleAlg.algId,
Index: CombiningAlgorithm.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/CombiningAlgorithm.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** CombiningAlgorithm.java 13 Feb 2003 22:19:10 -0000 1.1.1.1
--- CombiningAlgorithm.java 25 Aug 2003 16:46:33 -0000 1.2
***************
*** 41,44 ****
--- 41,46 ----
import com.sun.xacml.ctx.Result;
+ import java.net.URI;
+
import java.util.List;
***************
*** 53,56 ****
--- 55,70 ----
{
+ // the identifier for the algorithm
+ private URI identifier;
+
+ /**
+ * Constructor that takes the algorithm's identifier.
+ *
+ * @param identifier the algorithm's identifier
+ */
+ public CombiningAlgorithm(URI identifier) {
+ this.identifier = identifier;
+ }
+
/**
* Combines the inputs based on the context to produce some unified
***************
*** 63,66 ****
--- 77,89 ----
*/
public abstract Result combine(EvaluationCtx context, List inputs);
+
+ /**
+ * Returns the identifier for this algorithm.
+ *
+ * @return the algorithm's identifier
+ */
+ public URI getIdentifier() {
+ return identifier;
+ }
}
Index: DenyOverridesPolicyAlg.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/DenyOverridesPolicyAlg.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DenyOverridesPolicyAlg.java 14 Aug 2003 22:56:48 -0000 1.2
--- DenyOverridesPolicyAlg.java 25 Aug 2003 16:46:33 -0000 1.3
***************
*** 45,48 ****
--- 45,49 ----
import java.net.URI;
+ import java.net.URISyntaxException;
import java.util.HashSet;
***************
*** 71,80 ****
"deny-overrides";
/**
! * The standard URN used to identify the ordered version of this algorithm
*/
! public static final String orderedAlgId =
! "urn:oasis:names:tc:xacml:1.0:policy-combining-algorithm:" +
! "ordered-deny-overrides";
/**
--- 72,107 ----
"deny-overrides";
+ // a URI form of the identifier
+ private static URI identifierURI;
+ // exception if the URI was invalid, which should never be a problem
+ private static RuntimeException earlyException;
+
+ static {
+ try {
+ identifierURI = new URI(algId);
+ } catch (URISyntaxException se) {
+ earlyException = new IllegalArgumentException();
+ earlyException.initCause(se);
+ }
+ }
+
/**
! * Standard constructor.
*/
! public DenyOverridesPolicyAlg() {
! super(identifierURI);
!
! if (earlyException != null)
! throw earlyException;
! }
!
! /**
! * Protected constructor used by the ordered version of this algorithm.
! *
! * @param identifier the algorithm's identifier
! */
! protected DenyOverridesPolicyAlg(URI identifier) {
! super(identifier);
! }
/**
Index: DenyOverridesRuleAlg.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/DenyOverridesRuleAlg.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DenyOverridesRuleAlg.java 14 Aug 2003 22:56:48 -0000 1.2
--- DenyOverridesRuleAlg.java 25 Aug 2003 16:46:33 -0000 1.3
***************
*** 44,47 ****
--- 44,48 ----
import java.net.URI;
+ import java.net.URISyntaxException;
import java.util.Iterator;
***************
*** 68,77 ****
"deny-overrides";
/**
! * The standard URN used to identify the ordered version of this algorithm
*/
! public static final String orderedAlgId =
! "urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:" +
! "ordered-deny-overrides";
/**
--- 69,104 ----
"deny-overrides";
+ // a URI form of the identifier
+ private static URI identifierURI;
+ // exception if the URI was invalid, which should never be a problem
+ private static RuntimeException earlyException;
+
+ static {
+ try {
+ identifierURI = new URI(algId);
+ } catch (URISyntaxException se) {
+ earlyException = new IllegalArgumentException();
+ earlyException.initCause(se);
+ }
+ }
+
/**
! * Standard constructor.
*/
! public DenyOverridesRuleAlg() {
! super(identifierURI);
!
! if (earlyException != null)
! throw earlyException;
! }
!
! /**
! * Protected constructor used by the ordered version of this algorithm.
! *
! * @param identifier the algorithm's identifier
! */
! protected DenyOverridesRuleAlg(URI identifier) {
! super(identifier);
! }
/**
Index: FirstApplicablePolicyAlg.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/FirstApplicablePolicyAlg.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** FirstApplicablePolicyAlg.java 13 Feb 2003 22:19:10 -0000 1.1.1.1
--- FirstApplicablePolicyAlg.java 25 Aug 2003 16:46:33 -0000 1.2
***************
*** 45,48 ****
--- 45,49 ----
import java.net.URI;
+ import java.net.URISyntaxException;
import java.util.Iterator;
***************
*** 66,69 ****
--- 67,94 ----
"urn:oasis:names:tc:xacml:1.0:policy-combining-algorithm:" +
"first-applicable";
+
+ // a URI form of the identifier
+ private static URI identifierURI;
+ // exception if the URI was invalid, which should never be a problem
+ private static RuntimeException earlyException;
+
+ static {
+ try {
+ identifierURI = new URI(algId);
+ } catch (URISyntaxException se) {
+ earlyException = new IllegalArgumentException();
+ earlyException.initCause(se);
+ }
+ }
+
+ /**
+ * Standard constructor.
+ */
+ public FirstApplicablePolicyAlg() {
+ super(identifierURI);
+
+ if (earlyException != null)
+ throw earlyException;
+ }
/**
Index: FirstApplicableRuleAlg.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/FirstApplicableRuleAlg.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** FirstApplicableRuleAlg.java 13 Feb 2003 22:19:10 -0000 1.1.1.1
--- FirstApplicableRuleAlg.java 25 Aug 2003 16:46:33 -0000 1.2
***************
*** 44,47 ****
--- 44,48 ----
import java.net.URI;
+ import java.net.URISyntaxException;
import java.util.Iterator;
***************
*** 65,68 ****
--- 66,93 ----
"urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:" +
"first-applicable";
+
+ // a URI form of the identifier
+ private static URI identifierURI;
+ // exception if the URI was invalid, which should never be a problem
+ private static RuntimeException earlyException;
+
+ static {
+ try {
+ identifierURI = new URI(algId);
+ } catch (URISyntaxException se) {
+ earlyException = new IllegalArgumentException();
+ earlyException.initCause(se);
+ }
+ }
+
+ /**
+ * Standard constructor.
+ */
+ public FirstApplicableRuleAlg() {
+ super(identifierURI);
+
+ if (earlyException != null)
+ throw earlyException;
+ }
/**
Index: OnlyOneApplicablePolicyAlg.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/OnlyOneApplicablePolicyAlg.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** OnlyOneApplicablePolicyAlg.java 13 Feb 2003 22:19:10 -0000 1.1.1.1
--- OnlyOneApplicablePolicyAlg.java 25 Aug 2003 16:46:33 -0000 1.2
***************
*** 44,47 ****
--- 44,50 ----
import com.sun.xacml.ctx.Status;
+ import java.net.URI;
+ import java.net.URISyntaxException;
+
import java.util.ArrayList;
import java.util.Iterator;
***************
*** 65,68 ****
--- 68,95 ----
"urn:oasis:names:tc:xacml:1.0:policy-combining-algorithm:" +
"only-one-applicable";
+
+ // a URI form of the identifier
+ private static URI identifierURI;
+ // exception if the URI was invalid, which should never be a problem
+ private static RuntimeException earlyException;
+
+ static {
+ try {
+ identifierURI = new URI(algId);
+ } catch (URISyntaxException se) {
+ earlyException = new IllegalArgumentException();
+ earlyException.initCause(se);
+ }
+ }
+
+ /**
+ * Standard constructor.
+ */
+ public OnlyOneApplicablePolicyAlg() {
+ super(identifierURI);
+
+ if (earlyException != null)
+ throw earlyException;
+ }
/**
Index: PermitOverridesPolicyAlg.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/PermitOverridesPolicyAlg.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PermitOverridesPolicyAlg.java 14 Aug 2003 22:56:48 -0000 1.2
--- PermitOverridesPolicyAlg.java 25 Aug 2003 16:46:33 -0000 1.3
***************
*** 45,48 ****
--- 45,49 ----
import java.net.URI;
+ import java.net.URISyntaxException;
import java.util.HashSet;
***************
*** 71,80 ****
"permit-overrides";
/**
! * The standard URN used to identify the ordered version of this algorithm
*/
! public static final String orderedAlgId =
! "urn:oasis:names:tc:xacml:1.0:policy-combining-algorithm:" +
! "ordered-permit-overrides";
/**
--- 72,107 ----
"permit-overrides";
+ // a URI form of the identifier
+ private static URI identifierURI;
+ // exception if the URI was invalid, which should never be a problem
+ private static RuntimeException earlyException;
+
+ static {
+ try {
+ identifierURI = new URI(algId);
+ } catch (URISyntaxException se) {
+ earlyException = new IllegalArgumentException();
+ earlyException.initCause(se);
+ }
+ }
+
/**
! * Standard constructor.
*/
! public PermitOverridesPolicyAlg() {
! super(identifierURI);
!
! if (earlyException != null)
! throw earlyException;
! }
!
! /**
! * Protected constructor used by the ordered version of this algorithm.
! *
! * @param identifier the algorithm's identifier
! */
! protected PermitOverridesPolicyAlg(URI identifier) {
! super(identifier);
! }
/**
Index: PermitOverridesRuleAlg.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/PermitOverridesRuleAlg.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PermitOverridesRuleAlg.java 14 Aug 2003 22:56:48 -0000 1.2
--- PermitOverridesRuleAlg.java 25 Aug 2003 16:46:33 -0000 1.3
***************
*** 44,47 ****
--- 44,48 ----
import java.net.URI;
+ import java.net.URISyntaxException;
import java.util.Iterator;
***************
*** 68,77 ****
"permit-overrides";
/**
! * The standard URN used to identify the ordered version of this algorithm
*/
! public static final String orderedAlgId =
! "urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:" +
! "ordered-permit-overrides";
/**
--- 69,104 ----
"permit-overrides";
+ // a URI form of the identifier
+ private static URI identifierURI;
+ // exception if the URI was invalid, which should never be a problem
+ private static RuntimeException earlyException;
+
+ static {
+ try {
+ identifierURI = new URI(algId);
+ } catch (URISyntaxException se) {
+ earlyException = new IllegalArgumentException();
+ earlyException.initCause(se);
+ }
+ }
+
/**
! * Standard constructor.
*/
! public PermitOverridesRuleAlg() {
! super(identifierURI);
!
! if (earlyException != null)
! throw earlyException;
! }
!
! /**
! * Protected constructor used by the ordered version of this algorithm.
! *
! * @param identifier the algorithm's identifier
! */
! protected PermitOverridesRuleAlg(URI identifier) {
! super(identifier);
! }
/**
Index: PolicyCombiningAlgorithm.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/PolicyCombiningAlgorithm.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** PolicyCombiningAlgorithm.java 13 Feb 2003 22:19:10 -0000 1.1.1.1
--- PolicyCombiningAlgorithm.java 25 Aug 2003 16:46:33 -0000 1.2
***************
*** 41,44 ****
--- 41,46 ----
import com.sun.xacml.ctx.Result;
+ import java.net.URI;
+
import java.util.List;
***************
*** 60,63 ****
--- 62,74 ----
public abstract class PolicyCombiningAlgorithm extends CombiningAlgorithm
{
+
+ /**
+ * Constructor that takes the algorithm's identifier.
+ *
+ * @param identifier the algorithm's identifier
+ */
+ public PolicyCombiningAlgorithm(URI identifier) {
+ super(identifier);
+ }
/**
Index: RuleCombiningAlgorithm.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/combine/RuleCombiningAlgorithm.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** RuleCombiningAlgorithm.java 14 Aug 2003 22:56:48 -0000 1.2
--- RuleCombiningAlgorithm.java 25 Aug 2003 16:46:33 -0000 1.3
***************
*** 41,44 ****
--- 41,46 ----
import com.sun.xacml.ctx.Result;
+ import java.net.URI;
+
import java.util.List;
***************
*** 52,55 ****
--- 54,66 ----
public abstract class RuleCombiningAlgorithm extends CombiningAlgorithm
{
+
+ /**
+ * Constructor that takes the algorithm's identifier.
+ *
+ * @param identifier the algorithm's identifier
+ */
+ public RuleCombiningAlgorithm(URI identifier) {
+ super(identifier);
+ }
/**
|