issrg.pba.rbac
Class ExpirableCredentials

java.lang.Object
  extended by issrg.pba.rbac.SubsetCredentials
      extended by issrg.pba.rbac.ExpirableCredentials
All Implemented Interfaces:
Credentials, java.lang.Cloneable

public class ExpirableCredentials
extends SubsetCredentials

This class is intended to provide expiration service, so that any given Credentials are constrained in the time dimension. The objects can embed any Credentials, and ExpirableCredentials will perform expiration checks when intersecting the credentials.

Note that the methods call the inherited methods to ensure that the other types of Credentials are handled correctly, e.g. SetOfSubsetsCredentials are intersected correctly.


Field Summary
protected  Credentials expirable
           
protected  ValidityPeriod when
           
 
Constructor Summary
protected ExpirableCredentials()
           
  ExpirableCredentials(Credentials expirable, ValidityPeriod vp)
          This constructor builds a credential with Validity Period.
 
Method Summary
 java.lang.Object clone()
          This method creates a copy of the credentials object.
 boolean contains(Credentials c)
          This method checks if this ExpirableCredentials contains the other Credentials.
 Credentials getExpirable()
          This method returns the Credentials embedded inside this object and associated with the ValidityPeriod.
 ValidityPeriod getValidityPeriod()
          This method returns the ValidityPeriod associated with the embedded Credentials.
 Credentials intersection(Credentials c)
          This method builds an intersection of this ExpirableCredentials with the given Credentials.
 java.lang.String toString()
           
 
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
 

Field Detail

expirable

protected Credentials expirable

when

protected ValidityPeriod when
Constructor Detail

ExpirableCredentials

protected ExpirableCredentials()

ExpirableCredentials

public ExpirableCredentials(Credentials expirable,
                            ValidityPeriod vp)
This constructor builds a credential with Validity Period. If the credential is used outside the specified period, it will be ignored.

Parameters:
expirable - - the Credentials with which the Validity Period is associated
vp - - the ValidityPeriod of the Credentials; should not be null
Method Detail

contains

public boolean contains(Credentials c)
This method checks if this ExpirableCredentials contains the other Credentials. If it is an ExpirableCredentials, then their embedded Credentials are tested, and the ValidityPeriods are tested separately; otherwise the inherited behaviour of the method determines the result.

Specified by:
contains in interface Credentials
Overrides:
contains in class SubsetCredentials
Parameters:
c - - the Credentials that must be contained in this one
Returns:
true, if the embedded Credentials and the ValidityPeriod of this ExpirableCredentials contain the corresponding components of the given Credentials, if it is ExpirableCredentials; otherwise the inherited contains method is called to test if this ExpirableCredentials contains the given Credentials
See Also:
SetOfSubsetsCredentials

intersection

public Credentials intersection(Credentials c)
This method builds an intersection of this ExpirableCredentials with the given Credentials. If it is an ExpirableCredentials, then the result is the ExpirableCredentials, consisting of the intersection of the embedded Credentials and their ValidityPeriods. Otherwise the inherited intersection method determines the result.

Specified by:
intersection in interface Credentials
Overrides:
intersection in class SubsetCredentials
Parameters:
c - - the Credentials to intersect with
Returns:
Credentials that is the result of intersecting the embedded Credentials and the ValidityPeriods if the given Credentials is an ExpirableCredentials; otherwise, the inherited intersection method determines the result.

getValidityPeriod

public ValidityPeriod getValidityPeriod()
This method returns the ValidityPeriod associated with the embedded Credentials.


getExpirable

public Credentials getExpirable()
This method returns the Credentials embedded inside this object and associated with the ValidityPeriod.


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