issrg.pba.rbac
Class AbsoluteValidityPeriod

java.lang.Object
  extended by issrg.pba.rbac.SubsetCredentials
      extended by issrg.pba.rbac.DefaultValidityPeriodBehaviour
          extended by issrg.pba.rbac.AbsoluteValidityPeriod
All Implemented Interfaces:
Credentials, ValidityPeriod, java.lang.Cloneable
Direct Known Subclasses:
AnyTimeValidityPeriod

public class AbsoluteValidityPeriod
extends DefaultValidityPeriodBehaviour

This class represents a validity period, specified as two margins in time: the notBefore and notAfter times. The times are absolute and are input as java.util.Date objects. The notAfter can be set to time before notBefore, but such a validity period will mean "invalid time" and cause the credential to be not accepted.

Author:
A.Otenko

Field Summary
protected  java.util.Date notAfter
           
protected  java.util.Date notBefore
           
 
Constructor Summary
AbsoluteValidityPeriod()
          This constructor creates an infinite validity period.
AbsoluteValidityPeriod(java.util.Date notBefore, java.util.Date notAfter)
          This constructor creates a validity period with the margins specified.
 
Method Summary
 java.lang.Object clone()
          This method creates a copy of the credentials object.
 java.util.Date getNotAfter()
          This method returns the Date of NotAfter, as specified in the constructor.
 java.util.Date getNotBefore()
          This method returns the Date of NotBefore, as specified in the constructor.
 java.lang.String toString()
           
 
Methods inherited from class issrg.pba.rbac.DefaultValidityPeriodBehaviour
contains, intersection
 
Methods inherited from class issrg.pba.rbac.SubsetCredentials
equals, union
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface issrg.pba.Credentials
union
 

Field Detail

notBefore

protected java.util.Date notBefore

notAfter

protected java.util.Date notAfter
Constructor Detail

AbsoluteValidityPeriod

public AbsoluteValidityPeriod()
This constructor creates an infinite validity period. This is equivalent to calling AbsoluteValidityPeriod(null, null);


AbsoluteValidityPeriod

public AbsoluteValidityPeriod(java.util.Date notBefore,
                              java.util.Date notAfter)
This constructor creates a validity period with the margins specified. If a margin is null, the period is infinite in that direction.

Parameters:
notBefore - is the date and time when the period starts; if null, it existed forever
notAfter - is the date and time when the period ends; if null, it lasts forever
Method Detail

getNotBefore

public java.util.Date getNotBefore()
This method returns the Date of NotBefore, as specified in the constructor. Can be null, if the validity period exists "since time immemorial"

Returns:
the Date corresponding to the start of the validity period, or null, if infinitely valid in the past

getNotAfter

public java.util.Date getNotAfter()
This method returns the Date of NotAfter, as specified in the constructor. Can be null, if the validity period lasts forever.

Returns:
the Date corresponding to the end of the validity period, or null, if infinitely valid in the future

clone

public java.lang.Object clone()
Description copied from class: SubsetCredentials
This method creates a copy of the credentials object. Requires overriding in implementations of subclasses.

Specified by:
clone in interface Credentials
Specified by:
clone in class SubsetCredentials
Returns:
a copy of the credentials object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object