JBoss port of sunxacml 2.0.5-redhat-1

org.jboss.security.xacml.sunxacml.cond
Class TimeInRangeFunction

java.lang.Object
  extended by org.jboss.security.xacml.sunxacml.cond.FunctionBase
      extended by org.jboss.security.xacml.sunxacml.cond.TimeInRangeFunction
All Implemented Interfaces:
Expression, Function

public class TimeInRangeFunction
extends FunctionBase

This class implements the time-in-range function, which takes three time values and returns true if the first value falls between the second and the third value. This function was introduced in XACML 2.0.

Note that this function allows any time ranges less than 24 hours. In other words, it is not bound by normal day boundries (midnight GMT), but by the minimum time in the range. This means that ranges like 9am-5pm are supported, as are ranges like 5pm-9am.

Since:
2.0
Author:
seth proctor

Field Summary
static long MILLIS_PER_DAY
          The number of milliseconds in a day
static long MILLIS_PER_MINUTE
          The number of milliseconds in a minute
static String NAME
          The identifier for this function
 
Fields inherited from class org.jboss.security.xacml.sunxacml.cond.FunctionBase
FUNCTION_NS, FUNCTION_NS_2
 
Constructor Summary
TimeInRangeFunction()
          Default constructor.
 
Method Summary
 EvaluationResult evaluate(List inputs, EvaluationCtx context)
          Evaluates the time-in-range function, which takes three TimeAttribute values.
 
Methods inherited from class org.jboss.security.xacml.sunxacml.cond.FunctionBase
checkInputs, checkInputsNoBag, encode, encode, evalArgs, getFunctionId, getFunctionName, getIdentifier, getReturnType, getReturnTypeAsString, getType, makeProcessingError, returnsBag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
The identifier for this function

See Also:
Constant Field Values

MILLIS_PER_MINUTE

public static final long MILLIS_PER_MINUTE
The number of milliseconds in a minute

See Also:
Constant Field Values

MILLIS_PER_DAY

public static final long MILLIS_PER_DAY
The number of milliseconds in a day

See Also:
Constant Field Values
Constructor Detail

TimeInRangeFunction

public TimeInRangeFunction()
Default constructor.

Method Detail

evaluate

public EvaluationResult evaluate(List inputs,
                                 EvaluationCtx context)
Evaluates the time-in-range function, which takes three TimeAttribute values. This function return true if the first value falls between the second and third values (ie., on or after the second time and on or before the third time). If no time zone is specified for the second and/or third time value, then the timezone from the first time value is used. This lets you say time-in-range(current-time, 9am, 5pm) and always have the evaluation happen in your current-time timezone.

Parameters:
inputs - a List of Evaluatable objects representing the arguments passed to the function
context - the respresentation of the request
Returns:
an EvaluationResult containing true or false

JBoss port of sunxacml 2.0.5-redhat-1

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.