Update of /cvsroot/sunxacml/sunxacml/com/sun/xacml/finder/impl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30273/com/sun/xacml/finder/impl
Modified Files:
CurrentEnvModule.java
Log Message:
Added support for the XACML 2.0 functions, cleaned up current env handling
and date/time construction, and made most of the factory-related changes
to support the promised 2.0 features
Index: CurrentEnvModule.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/finder/impl/CurrentEnvModule.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CurrentEnvModule.java 17 Mar 2004 18:03:39 -0000 1.3
--- CurrentEnvModule.java 13 Jan 2006 22:32:52 -0000 1.4
***************
*** 3,7 ****
* @(#)CurrentEnvModule.java
*
! * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
--- 3,7 ----
* @(#)CurrentEnvModule.java
*
! * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
***************
*** 64,74 ****
* specification states that these three values must always be available to
* a PDP. They may be included in the request, but if they're not, a PDP
! * must be able to recognize the attribute and generate the correct value.
! * The module provides support for this feature by generating real-time
! * values as known at the host where this module is running.
* <p>
! * This class uses the caching functions of <code>EvaluationCtx</code> to
! * make sure that values are constant within an evaluation, if that is the
! * desired behavior.
*
* @since 1.0
--- 64,74 ----
* specification states that these three values must always be available to
* a PDP. They may be included in the request, but if they're not, a PDP
! * must be able to recognize the attribute and generate a correct value.
* <p>
! * The XACML specification doesn't require that values be cached (ie,
! * remain consistent within an evaluation), but does allow it. Any caching,
! * as well as details of which time to use (time at the PEP, PDP, etc.) is
! * taken care of by the <code>EvaluationCtx</code> which is used to supply
! * the current values.
*
* @since 1.0
***************
*** 176,189 ****
createEmptyBag(type));
! // see if there's a value already cached that we should use
! TimeAttribute attr = context.getCurrentTime();
!
! if (attr == null) {
! // create the current time data
! attr = new TimeAttribute();
! context.setCurrentTime(attr);
! }
!
! return makeBag(attr);
}
--- 176,181 ----
createEmptyBag(type));
! // get the value from the context
! return makeBag(context.getCurrentTime());
}
***************
*** 198,211 ****
createEmptyBag(type));
! // see if there's a value already cached that we should use
! DateAttribute attr = context.getCurrentDate();
!
! if (attr == null) {
! // create the current date data
! attr = new DateAttribute();
! context.setCurrentDate(attr);
! }
!
! return makeBag(attr);
}
--- 190,195 ----
createEmptyBag(type));
! // get the value from the context
! return makeBag(context.getCurrentDate());
}
***************
*** 219,233 ****
return new EvaluationResult(BagAttribute.
createEmptyBag(type));
-
- // see if there's a value already cached that we should use
- DateTimeAttribute attr = context.getCurrentDateTime();
-
- if (attr == null) {
- // create the current dateTime data
- attr = new DateTimeAttribute();
- context.setCurrentDateTime(attr);
- }
! return makeBag(attr);
}
--- 203,209 ----
return new EvaluationResult(BagAttribute.
createEmptyBag(type));
! // get the value from the context
! return makeBag(context.getCurrentDateTime());
}
|