issrg.pba.rbac.policies
Class DITSubtree

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

public class DITSubtree
extends java.lang.Object
implements Subtree

This is the object that represents a subtree of entries in LDAP DIT. It can specify a subtree, excluding subtrees, and does object class match.

Version:
1.0
Author:
A Otenko

Field Summary
protected  Subtree[] exclusive
          This is an array of exclusion subtrees.
protected  int max
           
protected  int min
           
protected  java.lang.String[] objectclasses
          This is an array of object classes, allowed in this subtree.
protected  LDAPDNPrincipal subtree
          This is the subtree root node.
 
Constructor Summary
protected DITSubtree()
           
  DITSubtree(LDAPDNPrincipal subtree, int min, int max, java.lang.String[] objectClass, Subtree[] exclude)
          This constructor can build an object out of the full subtree specification.
 
Method Summary
 java.lang.Object clone()
           
 boolean contains(Entry e)
          This method checks whether this Subtree contains a given Entry.
 boolean contains(LDAPEntry entry)
          This method tests whether or not the given entry belongs to this subtree.
 void excludeEntry(Entry e)
          This method excludes the specified Entry from the Subtree, if it is an LDAPEntry; otherwise does nothing.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

subtree

protected LDAPDNPrincipal subtree
This is the subtree root node.


min

protected int min

max

protected int max

objectclasses

protected java.lang.String[] objectclasses
This is an array of object classes, allowed in this subtree. Can be null, if no restrictions on object class are applied.


exclusive

protected Subtree[] exclusive
This is an array of exclusion subtrees. Can be null, if no exclusion subtrees have been specified.

Constructor Detail

DITSubtree

protected DITSubtree()

DITSubtree

public DITSubtree(LDAPDNPrincipal subtree,
                  int min,
                  int max,
                  java.lang.String[] objectClass,
                  Subtree[] exclude)
This constructor can build an object out of the full subtree specification.

Parameters:
subtree - is the LDAP DN of the root node of the subtree; if null, means "any DN is a subtree": the World
min - is the integer lower margin of the subtree; cannot be less than 0; see also max
max - is the integer higher margin of the subtree; together with min they define the minimum and maximum length of the matching DN, relative to the subtree DN; value of -1 means "unlimited length", no other negative values are accepted for max
objectClass - is the array of LDAP object classes that the subtree entry can be of; if null, no restrictions on the objectClass are applied
exclude - is an array of subtrees that an entry cannot be a part of; if null, no subtrees are excluded
Method Detail

contains

public boolean contains(LDAPEntry entry)
This method tests whether or not the given entry belongs to this subtree. If the entry's DN maps below the subtree root node and its object class is at least one of the allowed object classes, and the entry is not an entry of any of the exclusion subtrees, the method returns true. It returns false otherwise.

Parameters:
entry - is the LDAPEntry; it can tell the DN and the objectClass of the entry
Returns:
true, if the entry is included in the subtree and is of one of the objectClasses, specified at the construction time, and it is not contained in any of the exclusion subtrees

contains

public boolean contains(Entry e)
This method checks whether this Subtree contains a given Entry. If the entry is not an LDAPEntry, returns false; otherwise returns the same result as contains(LDAPEntry e)

Specified by:
contains in interface Subtree
Parameters:
e - - the Entry to check
Returns:
true, if the Entry is contained in the Subtree; false otherwise

toString

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

excludeEntry

public void excludeEntry(Entry e)
This method excludes the specified Entry from the Subtree, if it is an LDAPEntry; otherwise does nothing.


clone

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