|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.xacml.cond.FunctionBase
eu.xtreemos.xosd.security.vops.xacml.utils.TimeInRangeFunction
public class TimeInRangeFunction
This class implements the proposed 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 is not currently a standard XACML function, though it has been proposed to the TC and is being considered for XACML 2.0 (inclusion is quite likely). If approved, this function is likely to be "standard" than the 2.0 release, since this has been proposed as an errata item (this functionality was supposed to be handled in 1.0). This function is not currently in the standard XACML namespace, but will be moved there as soon as it has been approved.
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.
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 java.lang.String |
NAME
The identifier for this function |
Fields inherited from class com.sun.xacml.cond.FunctionBase |
---|
FUNCTION_NS |
Constructor Summary | |
---|---|
TimeInRangeFunction()
Default constructor. |
Method Summary | |
---|---|
com.sun.xacml.cond.EvaluationResult |
evaluate(java.util.List inputs,
com.sun.xacml.EvaluationCtx context)
Evaluates the time-in-range function, which takes three TimeAttribute values. |
private long |
handleWrap(long time)
Private helper method that handles when a time value wraps no more than 24 hours either above 23:59:59 or below 00:00:00. |
private long |
resolveTime(com.sun.xacml.attr.TimeAttribute middleTime,
com.sun.xacml.attr.TimeAttribute otherTime)
Private helper method that is used to resolve the correct values for min and max. |
Methods inherited from class com.sun.xacml.cond.FunctionBase |
---|
checkInputs, checkInputsNoBag, evalArgs, getFunctionId, getFunctionName, getIdentifier, getReturnType, getReturnTypeAsString, makeProcessingError, returnsBag |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NAME
public static final long MILLIS_PER_MINUTE
public static final long MILLIS_PER_DAY
Constructor Detail |
---|
public TimeInRangeFunction()
Method Detail |
---|
public com.sun.xacml.cond.EvaluationResult evaluate(java.util.List inputs, com.sun.xacml.EvaluationCtx context)
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.
inputs
- a List
of Evaluatable
objects representing the arguments passed to the functioncontext
- the respresentation of the request
EvaluationResult
containing true or falseprivate long resolveTime(com.sun.xacml.attr.TimeAttribute middleTime, com.sun.xacml.attr.TimeAttribute otherTime)
private long handleWrap(long time)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |