org.iges.anagram
Class Privilege

java.lang.Object
  |
  +--org.iges.anagram.Setting
        |
        +--org.iges.anagram.Privilege

public class Privilege
extends Setting

An extension of Setting which represents a set of privileges that can be associated with a given request.


Field Summary
protected  java.util.SortedSet allowTags
           
protected  java.util.SortedSet denyTags
           
protected  java.lang.String name
           
protected  Privilege parent
           
 
Fields inherited from class org.iges.anagram.Setting
xml
 
Constructor Summary
Privilege(java.lang.String name, org.w3c.dom.Element xml)
          Creates a privilege set with the given name, based on the XML tag provided.
 
Method Summary
protected  boolean allowIsMostRecent(java.lang.String path)
           
 boolean allows(java.lang.String path)
          Returns true if this privilege set permits access to the catalog path given.
protected  boolean checkForAllowedSubPath(java.lang.String path)
           
 boolean everAllows(java.lang.String path)
          Returns true if there is any possibility that the privilege set will permit access to a sub-path of the path given.
protected  java.lang.String getAllowMatch(java.lang.String path)
           
 java.lang.String getAttribute(java.lang.String name, java.lang.String defaultValue)
          Returns the value of the named attribute of this tag.
protected  java.lang.String getClosestMatch(java.lang.String parentMatch, java.util.SortedSet pathSet, java.lang.String path)
           
protected  java.lang.String getDenyMatch(java.lang.String path)
           
 java.lang.String getName()
          Returns the name of this privilege set.
 long getNumAttribute(java.lang.String name, long defaultValue)
          Returns the numerical value of the named attribute of this tag.
protected  Privilege getParent()
           
protected  java.util.SortedSet sortPathTags(java.lang.String tagName)
           
 java.lang.String toString()
           
 
Methods inherited from class org.iges.anagram.Setting
getAttribute, getSubSettings, getSubSettings, getUniqueSubSetting, getXML, uniqueElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

allowTags

protected java.util.SortedSet allowTags

denyTags

protected java.util.SortedSet denyTags

name

protected java.lang.String name

parent

protected Privilege parent
Constructor Detail

Privilege

public Privilege(java.lang.String name,
                 org.w3c.dom.Element xml)
Creates a privilege set with the given name, based on the XML tag provided.

Method Detail

getParent

protected Privilege getParent()

getName

public java.lang.String getName()
Returns the name of this privilege set.

Overrides:
getName in class Setting

toString

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

getAttribute

public java.lang.String getAttribute(java.lang.String name,
                                     java.lang.String defaultValue)
Description copied from class: Setting
Returns the value of the named attribute of this tag.

Overrides:
getAttribute in class Setting
Parameters:
defaultValue - Returned if the tag has no such attribute.

getNumAttribute

public long getNumAttribute(java.lang.String name,
                            long defaultValue)
Description copied from class: Setting
Returns the numerical value of the named attribute of this tag.

Overrides:
getNumAttribute in class Setting
Parameters:
defaultValue - Returned if the tag has no such attribute, or the attribute's value is non-numeric.

allows

public boolean allows(java.lang.String path)
Returns true if this privilege set permits access to the catalog path given.


everAllows

public boolean everAllows(java.lang.String path)
Returns true if there is any possibility that the privilege set will permit access to a sub-path of the path given.


checkForAllowedSubPath

protected boolean checkForAllowedSubPath(java.lang.String path)

allowIsMostRecent

protected boolean allowIsMostRecent(java.lang.String path)

sortPathTags

protected java.util.SortedSet sortPathTags(java.lang.String tagName)

getAllowMatch

protected java.lang.String getAllowMatch(java.lang.String path)

getDenyMatch

protected java.lang.String getDenyMatch(java.lang.String path)

getClosestMatch

protected java.lang.String getClosestMatch(java.lang.String parentMatch,
                                           java.util.SortedSet pathSet,
                                           java.lang.String path)