issrg.pba.rbac.policies
Class ComplexSubtree

java.lang.Object
  extended by issrg.pba.rbac.policies.ComplexSubtree
All Implemented Interfaces:
Subtree

public class ComplexSubtree
extends java.lang.Object
implements Subtree

This class stands for a subtree that has several roots: a union of several simple subtrees.

Version:
1.0
Author:
A Otenko

Field Summary
protected  Subtree[] dits
          This is an array of all roots of this union of subtrees.
protected  java.lang.String[] objectClasses
          This is an array of additional Object Classes restrictions (in addition to those specified within the dits).
 
Constructor Summary
ComplexSubtree()
          This constructor builds a ComplexSubtree with no components.
ComplexSubtree(Subtree[] dits, java.lang.String[] objectClasses)
          This constructor builds the union of the array of DIT subtrees, with additional object classes restriction, so even if the object class will be allowed by a certain subtree, it still can be sieved away by this object class specification.
ComplexSubtree(java.util.Vector dits, java.util.Vector objectClasses)
          Does the same as the ComplexSubtree(Subtree [], String[]) constructor, but gets the arrays of subtrees and objectClasses as vectors.
 
Method Summary
 java.lang.Object clone()
           
 boolean contains(Entry what)
          This method tells whether or not the given entry belongs to this subtree.
 Subtree[] getSubtrees()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dits

protected Subtree[] dits
This is an array of all roots of this union of subtrees.


objectClasses

protected java.lang.String[] objectClasses
This is an array of additional Object Classes restrictions (in addition to those specified within the dits).

Constructor Detail

ComplexSubtree

public ComplexSubtree()
This constructor builds a ComplexSubtree with no components.


ComplexSubtree

public ComplexSubtree(Subtree[] dits,
                      java.lang.String[] objectClasses)
This constructor builds the union of the array of DIT subtrees, with additional object classes restriction, so even if the object class will be allowed by a certain subtree, it still can be sieved away by this object class specification.

Parameters:
dits - is the array of subtrees to join together; if null, or an empty array, then no entries belong to it; pass it an array of one Subtree based on null DN for this subtree to contain the whole world
objectClasses - is the array of objectClasses that the entries must be of (must match all of the objectClasses); if it is null, entries with any object Classes are accepted, if they match the subtree specification

ComplexSubtree

public ComplexSubtree(java.util.Vector dits,
                      java.util.Vector objectClasses)
Does the same as the ComplexSubtree(Subtree [], String[]) constructor, but gets the arrays of subtrees and objectClasses as vectors. Note that each of the elements should be of type Subtree and String respectively.

Parameters:
dits - is a Vector of Subtree objects, a union of which will be represented by this object; this array can be null
objectClasses - is a vector of Strings, each representing the object class of acceptable entries; this array can be null
Method Detail

getSubtrees

public Subtree[] getSubtrees()
Returns:
the array of Subtrees that this Complex Subtree is a union of

contains

public boolean contains(Entry what)
This method tells whether or not the given entry belongs to this subtree. It is redefined to go through the whole array of Subtree objects that has been passed to the constructor, and if the given Entry is contained in either of them, and it satisfies the additional object class constraints, it returns true. Otherwise, it returns false.

Specified by:
contains in interface Subtree
Parameters:
what - is the Entry that is tested; if ComplexSubtree is built with ObjectClasses, it will expect only LDAPEntry on input here (returns false otherwise)
Returns:
true, if the given Entry is included in the subtree; false otherwise

toString

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

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object