issrg.pba.rbac
Class DefaultValidityPeriodBehaviour

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

public abstract class DefaultValidityPeriodBehaviour
extends SubsetCredentials
implements ValidityPeriod

This class implements the default behaviour of the ValidityPeriod when computing intersections of two periods.


Constructor Summary
protected DefaultValidityPeriodBehaviour()
           
 
Method Summary
 boolean contains(Credentials c)
          This method checks if this ValidityPeriod contains the given Credentials.
 Credentials intersection(Credentials c)
          This method computes an intersection of this ValidityPeriod with the given Credentials.
 
Methods inherited from class issrg.pba.rbac.SubsetCredentials
clone, equals, union
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface issrg.pba.rbac.ValidityPeriod
getNotAfter, getNotBefore
 
Methods inherited from interface issrg.pba.Credentials
clone, union
 

Constructor Detail

DefaultValidityPeriodBehaviour

protected DefaultValidityPeriodBehaviour()
Method Detail

contains

public boolean contains(Credentials c)
This method checks if this ValidityPeriod contains the given Credentials. It makes sense to pass only ValidityPeriod to this method, but it can handle other Credentials, too. Bascially, it checks that the notBefore of the given ValidityPeriod is not earlier than notBefore of this ValidityPeriod, and that notAfter is not later than notAfter of this ValidityPeriod. If the given Credentials is not a ValidityPeriod, the contains method of the superclass is called.

Specified by:
contains in interface Credentials
Overrides:
contains in class SubsetCredentials
Parameters:
c - - the Credentials object that must be contained in this ValidityPeriod
Returns:
true, if the given Credentials is a ValidityPeriod and is fully contained in this ValidityPeriod; if it is not a ValidityPeriod, the behaviour is defined by the superclass (calls the contains method of the superclass); otherwise it is false.
See Also:
SetOfSubsetsCredentials

intersection

public Credentials intersection(Credentials c)
This method computes an intersection of this ValidityPeriod with the given Credentials. It makes sense only to intersect the ValidityPeriod with other ValidityPeriods, but other Credentials are supported. Basically, it ensures that the result of intersection provides a stricter ValidityPeriod than this ValidityPeriod and the provided ValidityPeriod.

Specified by:
intersection in interface Credentials
Overrides:
intersection in class SubsetCredentials
Parameters:
c - - the ValidityPeriod to intersect with; if it is not a ValidityPeriod, the result is determined by the inherited intersection method
Returns:
the ValidityPeriod that is the intersection of this and the given ValidityPeriod