issrg.pba.rbac
Class Clock

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

public abstract class Clock
extends Time

This is the abstract class that provides the RelativeValidityPeriod and decision with current time. The simplest implementation just gets the system time. You may wish to provide a secure clock, obtaining the time from a time-stamping authority.

The latch method is used to get current time that will be used in subsequent calls to getTime method. This use ensures that the time will remain the same during long calculations. This is needed when making decisions to ensure that "current time" is the same during the whole process.

Author:
A.Otenko

Field Summary
 
Fields inherited from class issrg.pba.rbac.Time
TIME_TYPE
 
Constructor Summary
Clock()
           
 
Method Summary
 int[] getEvaluationTime()
          This method calls getTime() and converts it into the array of integers, so it can be compared by the TimeInterpreter.
abstract  java.util.Date getTime()
          This method returns the time returned by the last call to latch, so all calculations will be consistent.
abstract  java.util.Date latch()
          This method gets the actual time and keeps it for later reference.
 
Methods inherited from class issrg.pba.rbac.Time
register
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Clock

public Clock()
Method Detail

latch

public abstract java.util.Date latch()
This method gets the actual time and keeps it for later reference. Subsequent calls to getTime will return the same value (needed in operations extended in time).

Returns:
the current time

getTime

public abstract java.util.Date getTime()
This method returns the time returned by the last call to latch, so all calculations will be consistent.

Returns:
the time returned by the last call to latch

getEvaluationTime

public int[] getEvaluationTime()
This method calls getTime() and converts it into the array of integers, so it can be compared by the TimeInterpreter.

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)

Overrides:
getEvaluationTime in class Time
Returns:
array of integers, each element standing for y,m,d,h,m,s