Update of /cvsroot/sunxacml/sunxacml/com/sun/xacml/finder
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17065/com/sun/xacml/finder
Modified Files:
PolicyFinder.java PolicyFinderModule.java
Log Message:
added support for policy versioning, a new feature of XACML 2.0
Index: PolicyFinder.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/finder/PolicyFinder.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** PolicyFinder.java 4 Jun 2004 17:50:40 -0000 1.4
--- PolicyFinder.java 7 Jan 2005 23:47:43 -0000 1.5
***************
*** 3,7 ****
* @(#)PolicyFinder.java
*
! * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
--- 3,7 ----
* @(#)PolicyFinder.java
*
! * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
***************
*** 39,42 ****
--- 39,43 ----
import com.sun.xacml.EvaluationCtx;
import com.sun.xacml.PolicyReference;
+ import com.sun.xacml.VersionConstraints;
import com.sun.xacml.ctx.Status;
***************
*** 130,134 ****
/**
! *
*/
public void init() {
--- 131,135 ----
/**
! * Initializes all modules in this finder.
*/
public void init() {
***************
*** 211,214 ****
--- 212,217 ----
* @param type type of reference (policy or policySet) as identified by
* the fields in <code>PolicyReference</code>
+ * @param constraints any optional constraints on the version of the
+ * referenced policy
*
* @return the result of trying to find an applicable policy
***************
*** 216,220 ****
* @throws IllegalArgumentException if <code>type</code> is invalid
*/
! public PolicyFinderResult findPolicy(URI idReference, int type)
throws IllegalArgumentException
{
--- 219,224 ----
* @throws IllegalArgumentException if <code>type</code> is invalid
*/
! public PolicyFinderResult findPolicy(URI idReference, int type,
! VersionConstraints constraints)
throws IllegalArgumentException
{
***************
*** 229,234 ****
while (it.hasNext()) {
PolicyFinderModule module = (PolicyFinderModule)(it.next());
! PolicyFinderResult newResult = module.findPolicy(idReference,
! type);
// if there was an error, we stop right away
--- 233,238 ----
while (it.hasNext()) {
PolicyFinderModule module = (PolicyFinderModule)(it.next());
! PolicyFinderResult newResult =
! module.findPolicy(idReference, type, constraints);
// if there was an error, we stop right away
Index: PolicyFinderModule.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/finder/PolicyFinderModule.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PolicyFinderModule.java 17 May 2004 20:34:37 -0000 1.3
--- PolicyFinderModule.java 7 Jan 2005 23:47:43 -0000 1.4
***************
*** 3,7 ****
* @(#)PolicyFinderModule.java
*
! * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
--- 3,7 ----
* @(#)PolicyFinderModule.java
*
! * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
***************
*** 38,41 ****
--- 38,42 ----
import com.sun.xacml.EvaluationCtx;
+ import com.sun.xacml.VersionConstraints;
import java.net.URI;
***************
*** 149,156 ****
* @param type type of reference (policy or policySet) as identified by
* the fields in <code>PolicyReference</code>
*
* @return the result of looking for a matching policy
*/
! public PolicyFinderResult findPolicy(URI idReference, int type) {
return new PolicyFinderResult();
}
--- 150,163 ----
* @param type type of reference (policy or policySet) as identified by
* the fields in <code>PolicyReference</code>
+ * @param constraints any optional constraints on the version of the
+ * referenced policy (this will never be null, but
+ * it may impose no constraints, and in fact will
+ * never impose constraints when used from a pre-2.0
+ * XACML policy)
*
* @return the result of looking for a matching policy
*/
! public PolicyFinderResult findPolicy(URI idReference, int type,
! VersionConstraints constraints) {
return new PolicyFinderResult();
}
|