SunTM's XACML Implementation for JavaTM

com.sun.xacml.finder.impl
Class CurrentEnvModule

java.lang.Object
  extended bycom.sun.xacml.finder.AttributeFinderModule
      extended bycom.sun.xacml.finder.impl.CurrentEnvModule

public class CurrentEnvModule
extends AttributeFinderModule

Supports the current date, time, and dateTime values. The XACML 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.

This class uses the caching functions of EvaluationCtx to make sure that values are constant within an evaluation, if that is the desired behavior.

Since:
1.0

Field Summary
static String ENVIRONMENT_CURRENT_DATE
          Standard environment variable that represents the current date
static String ENVIRONMENT_CURRENT_DATETIME
          Standard environment variable that represents the current date and time
static String ENVIRONMENT_CURRENT_TIME
          Standard environment variable that represents the current time
 
Constructor Summary
CurrentEnvModule()
           
 
Method Summary
 EvaluationResult findAttribute(URI attributeType, URI attributeId, URI issuer, URI subjectCategory, EvaluationCtx context, int designatorType)
          Used to get the current time, date, or dateTime.
 Set getSupportedDesignatorTypes()
          Returns a Set with a single Integer specifying that environment attributes are supported by this module.
 boolean isDesignatorSupported()
          Returns true always because this module supports designators.
 
Methods inherited from class com.sun.xacml.finder.AttributeFinderModule
findAttribute, getIdentifier, getSupportedIds, invalidateCache, isSelectorSupported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENVIRONMENT_CURRENT_TIME

public static final String ENVIRONMENT_CURRENT_TIME
Standard environment variable that represents the current time

See Also:
Constant Field Values

ENVIRONMENT_CURRENT_DATE

public static final String ENVIRONMENT_CURRENT_DATE
Standard environment variable that represents the current date

See Also:
Constant Field Values

ENVIRONMENT_CURRENT_DATETIME

public static final String ENVIRONMENT_CURRENT_DATETIME
Standard environment variable that represents the current date and time

See Also:
Constant Field Values
Constructor Detail

CurrentEnvModule

public CurrentEnvModule()
Method Detail

isDesignatorSupported

public boolean isDesignatorSupported()
Returns true always because this module supports designators.

Overrides:
isDesignatorSupported in class AttributeFinderModule
Returns:
true always

getSupportedDesignatorTypes

public Set getSupportedDesignatorTypes()
Returns a Set with a single Integer specifying that environment attributes are supported by this module.

Overrides:
getSupportedDesignatorTypes in class AttributeFinderModule
Returns:
a Set with AttributeDesignator.ENVIRONMENT_TARGET included

findAttribute

public EvaluationResult findAttribute(URI attributeType,
                                      URI attributeId,
                                      URI issuer,
                                      URI subjectCategory,
                                      EvaluationCtx context,
                                      int designatorType)
Used to get the current time, date, or dateTime. If one of those values isn't being asked for, or if the types are wrong, then an empty bag is returned.

Overrides:
findAttribute in class AttributeFinderModule
Parameters:
attributeType - the datatype of the attributes to find, which must be time, date, or dateTime for this module to resolve a value
attributeId - the identifier of the attributes to find, which must be one of the three ENVIRONMENT_* fields for this module to resolve a value
issuer - the issuer of the attributes, or null if unspecified
subjectCategory - the category of the attribute or null, which ignored since this only handles non-subjects
context - the representation of the request data
designatorType - the type of designator, which must be ENVIRONMENT_TARGET for this module to resolve a value
Returns:
the result of attribute retrieval, which will be a bag with a single attribute, an empty bag, or an error

Sun's XACML Implementation Version 1.2

Copyright 2003-2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

Sun, Sun Microsystems, the Sun Logo, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.