issrg.pba.rbac
Class Time

java.lang.Object
  extended byissrg.pba.rbac.Time
Direct Known Subclasses:
Clock

public class Time
extends java.lang.Object

This is an extension for evaluating Time expressions in the XML Policy.

The Policy must contain Const values of type "Time". The values must conform to the following syntax: "ccyy-mm-ddThh:mm:ss" (like in Validity elements in XML Policy). Thus the time can be specified up to the seconds. The year should always have 4 digits. Other fields do not need to have 2 digits, if they represent numbers less than 10. "*" asterisc can be used as a wildcard to represent "any value" at that position. Trailing fields can be omitted and their values will be considered 0.

Examples:

<Constant Type="Time" Value="*-*-*T8:20" />

The example matches 08:20:00 in the morning any day

<Constant Type="Time" Value="*-*-*T8:20:*" />

The above matches any second after 08:20:00 and before 08:21:00 in the morning any day. This is different from the above example in that it matches ANY second, i.e. the whole minute up to 8:21, whilst the previous example specifies exact time of day (8:20:00).

<Constant Type="Time" Value="*-1-*T20" />

This example matches 8pm any day throughout January.

<Constant Type="Time" Value="*-1" />

This example matches midnight any day through January.

The extension has been provided in PBA v1.1.


Field Summary
static java.lang.String TIME_TYPE
           
 
Constructor Summary
protected Time()
           
  Time(java.lang.String timeString)
          This constructor builds a Time object out of its string representation
 
Method Summary
 int[] getEvaluationTime()
          Returns an array of integers representing the year, month, day hour, minute, second.
static void register()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIME_TYPE

public static final java.lang.String TIME_TYPE
See Also:
Constant Field Values
Constructor Detail

Time

protected Time()

Time

public Time(java.lang.String timeString)
     throws java.lang.IllegalArgumentException
This constructor builds a Time object out of its string representation

Parameters:
timeString - - the String in the format explained above.
Method Detail

register

public static void register()

getEvaluationTime

public int[] getEvaluationTime()
Returns an array of integers representing the year, month, day hour, minute, second. If the value of the array element is -1, then the value is not specified ("don't care" when comparing)

Returns:
array of integers, each element standing for y,m,d,h,m,s