Update of /cvsroot/sunxacml/sunxacml/com/sun/xacml/finder/impl
In directory sc8-pr-cvs1:/tmp/cvs-serv21844/com/sun/xacml/finder/impl
Modified Files:
CurrentEnvModule.java SelectorModule.java
Log Message:
TimeAttribute fix for DST and new Time & current env features plus some small
fixes and cleanups
Index: CurrentEnvModule.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/finder/impl/CurrentEnvModule.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** CurrentEnvModule.java 13 Feb 2003 22:19:13 -0000 1.1.1.1
--- CurrentEnvModule.java 11 Aug 2003 20:48:45 -0000 1.2
***************
*** 67,70 ****
--- 67,74 ----
* 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.
*
* @author Seth Proctor
***************
*** 149,157 ****
if (attrName.equals(ENVIRONMENT_CURRENT_TIME)) {
! return handleTime(attributeType, issuer);
} else if (attrName.equals(ENVIRONMENT_CURRENT_DATE)) {
! return handleDate(attributeType, issuer);
} else if (attrName.equals(ENVIRONMENT_CURRENT_DATETIME)) {
! return handleDateTime(attributeType, issuer);
}
--- 153,161 ----
if (attrName.equals(ENVIRONMENT_CURRENT_TIME)) {
! return handleTime(attributeType, issuer, context);
} else if (attrName.equals(ENVIRONMENT_CURRENT_DATE)) {
! return handleDate(attributeType, issuer, context);
} else if (attrName.equals(ENVIRONMENT_CURRENT_DATETIME)) {
! return handleDateTime(attributeType, issuer, context);
}
***************
*** 164,168 ****
* Handles requests for the current Time.
*/
! private EvaluationResult handleTime(URI type, URI issuer) {
// make sure they're asking for a time attribute
if (! type.toString().equals(TimeAttribute.identifier))
--- 168,173 ----
* Handles requests for the current Time.
*/
! private EvaluationResult handleTime(URI type, URI issuer,
! EvaluationCtx context) {
// make sure they're asking for a time attribute
if (! type.toString().equals(TimeAttribute.identifier))
***************
*** 170,175 ****
createEmptyBag(type));
! // create the time data and send it back
! TimeAttribute attr = new TimeAttribute();
return makeBag(attr);
}
--- 175,187 ----
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);
}
***************
*** 178,182 ****
* Handles requests for the current Date.
*/
! private EvaluationResult handleDate(URI type, URI issuer) {
// make sure they're asking for a date attribute
if (! type.toString().equals(DateAttribute.identifier))
--- 190,195 ----
* Handles requests for the current Date.
*/
! private EvaluationResult handleDate(URI type, URI issuer,
! EvaluationCtx context) {
// make sure they're asking for a date attribute
if (! type.toString().equals(DateAttribute.identifier))
***************
*** 184,189 ****
createEmptyBag(type));
! // create the date data and send it back
! DateAttribute attr = new DateAttribute();
return makeBag(attr);
}
--- 197,209 ----
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);
}
***************
*** 192,196 ****
* Handles requests for the current DateTime.
*/
! private EvaluationResult handleDateTime(URI type, URI issuer) {
// make sure they're asking for a dateTime attribute
if (! type.toString().equals(DateTimeAttribute.identifier))
--- 212,217 ----
* Handles requests for the current DateTime.
*/
! private EvaluationResult handleDateTime(URI type, URI issuer,
! EvaluationCtx context) {
// make sure they're asking for a dateTime attribute
if (! type.toString().equals(DateTimeAttribute.identifier))
***************
*** 198,203 ****
createEmptyBag(type));
! // create the dateTime data and send it back
! DateTimeAttribute attr = new DateTimeAttribute();
return makeBag(attr);
}
--- 219,231 ----
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);
}
Index: SelectorModule.java
===================================================================
RCS file: /cvsroot/sunxacml/sunxacml/com/sun/xacml/finder/impl/SelectorModule.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** SelectorModule.java 13 Feb 2003 22:19:13 -0000 1.1.1.1
--- SelectorModule.java 11 Aug 2003 20:48:45 -0000 1.2
***************
*** 104,109 ****
* error occurred, an empty bag is returned.
*
! * @param contextPath the XPath expression to search against
! * @param attributeType the datatype of the attributes to find
* @param context the representation of the request data
*
--- 104,109 ----
* error occurred, an empty bag is returned.
*
! * @param path the XPath expression to search against
! * @param type the datatype of the attributes to find
* @param context the representation of the request data
*
|