issrg.pba.rbac
Class SubsetCredentials

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

public abstract class SubsetCredentials
extends java.lang.Object
implements Credentials

This abstract class defines some basic behaviour, taking into account that a SetOfSubsets class exists.

Version:
1.0
Author:
A Otenko

Constructor Summary
protected SubsetCredentials()
           
 
Method Summary
abstract  java.lang.Object clone()
          This method creates a copy of the credentials object.
 boolean contains(Credentials cred)
          This method tells if the given set of credentials is contained within this credentials object.
 boolean equals(java.lang.Object cred)
          This method compares two credentials for equality.
 Credentials intersection(Credentials cred)
          This method implements the basic intersection rule: the intersection is the biggest common part.
 Credentials union(Credentials cred)
          This method implements the default behaviour for the union operation: the union is the smallest set containing both objects.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubsetCredentials

protected SubsetCredentials()
Method Detail

contains

public boolean contains(Credentials cred)
This method tells if the given set of credentials is contained within this credentials object. If the credentials object is a SetOfSubsetsCredentials it deploys its partOf method. All of the subclasses should call this method, if they do not handle a SetOfSubsetsCredentials.

Specified by:
contains in interface Credentials
Parameters:
cred - is the credential to compare
Returns:
true if the given credential is contained within this credential
See Also:
SetOfSubsetsCredentials

equals

public boolean equals(java.lang.Object cred)
This method compares two credentials for equality. The result is equal to

contains(cred) && cred.contains(this),

if cred is a credentials object. The result is always false if cred is not a Credentials object.

Overrides:
equals in class java.lang.Object
Parameters:
cred - is the object to compare with

intersection

public Credentials intersection(Credentials cred)
This method implements the basic intersection rule: the intersection is the biggest common part. In particular, if this object contains the other object, then the intersection is that object; if this object is contained within the other object, then the intersection is this object. Otherwise the intersection is null.

Specified by:
intersection in interface Credentials
Parameters:
cred - is the credential to intersect with
Returns:
the Credential that is the intersection of the two

union

public Credentials union(Credentials cred)
This method implements the default behaviour for the union operation: the union is the smallest set containing both objects. In particular, if cred contains this object, then the result is cred; if this object contains cred, then the result is this. Otherwise the union is a SetOfSubsetsCredential, containing both.

Specified by:
union in interface Credentials
Parameters:
cred - is the credentials object to join with
Returns:
the Credentials object that is the union of the two

clone

public abstract java.lang.Object clone()
This method creates a copy of the credentials object. Requires overriding in implementations of subclasses.

Specified by:
clone in interface Credentials
Overrides:
clone in class java.lang.Object
Returns:
a copy of the credentials object