issrg.pba.rbac
Class AdjustedValidityPeriod
java.lang.Object
issrg.pba.rbac.SubsetCredentials
issrg.pba.rbac.DefaultValidityPeriodBehaviour
issrg.pba.rbac.RelativeValidityPeriod
issrg.pba.rbac.AdjustedValidityPeriod
- All Implemented Interfaces:
- Credentials, ValidityPeriod, java.lang.Cloneable
- Direct Known Subclasses:
- AdjustedPeriodCollection
public class AdjustedValidityPeriod
- extends RelativeValidityPeriod
This class represents a validity period with run-time rules. It
builds the margins updated according to the rules and the given
ValidityPeriod.
If the given validity period has NotAfter time between MinSpan and
MaxSpan, and
NotBefore time later than Age, then the unchanged validity period is
returned. Otherwise
an Invalid Period is returned (null length).
If no validity period is provided, it returns "now" for both notBefore
and notAfter times.
- Author:
- A.Otenko
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
maxSpan
protected RelativeDate maxSpan
minSpan
protected RelativeDate minSpan
age
protected RelativeDate age
AdjustedValidityPeriod
protected AdjustedValidityPeriod()
AdjustedValidityPeriod
public AdjustedValidityPeriod(RelativeDate age,
RelativeDate minSpan,
RelativeDate maxSpan)
- This constructor builds a AdjustedValidityPeriod given the Age, Min life
span, and Max life span. Note that if Min life span is longer than Max
life span, any ValidityPeriod will be invalid. Any or all of these
parameters can be null,
meaning that the ValidityPeriods will not be constrained in that respect.
- Parameters:
age
- - the maximum age of the ValidityPeriod; a RelativeDate showing
the earliest point in the past when the ValidityPeriod can start; if it
starts earlier, it is fully invalidminSpan
- - the minimum life span required of the ValidityPeriod; a
RelativeDate showing the earliest point in the future when the
ValidityPeriod can end; if it ends earlier, it is fully invalidmaxSpan
- - the maximum life span required of the ValidityPeriod; a
RelativeDate showing the latest point in the future when the
ValidityPeriod can end; if it ends later, it is fully invalid
adjust
public ValidityPeriod adjust(ValidityPeriod vp)
- This method returns the given ValidityPeriod adjusted according to the
constraints provided at construction time. See description of the
logic of the constraints in the constructor.
- Parameters:
vp
- - the ValidityPeriod to be constrained
intersection
public Credentials intersection(Credentials c)
- This method redefines how intersection rule works. Effectively, it applies
the adjust method to compute intersections, if the given Credentials is a
ValidityPeriod.
- Specified by:
intersection
in interface Credentials
- Overrides:
intersection
in class DefaultValidityPeriodBehaviour
- Parameters:
c
- - a Credentials to intersect with; makes sense only if it is a
ValidityPeriod, but supports intersections with other Credentials
- Returns:
- the ValidityPeriod that is the intersection of this and the given
ValidityPeriod
toString
public java.lang.String toString()
- Overrides:
toString
in class RelativeValidityPeriod