Class Hier

  • All Implemented Interfaces:
    Serializable

    public class Hier
    extends FortEntity
    implements Serializable
    All entities (User, Role, Permission, Policy, SDSet, etc...) are used to carry data between Fortress's layers starting with the (1) Manager layer down thru middle (2) Process layer and it's processing rules into (3) DAO layer where persistence with the LDAP server occurs. The clients must instantiate an Fortress entity before use and must provide enough information to uniquely identity target record for reads.

    Hierarchical Relationship Schema

    The Fortress ftHier Entity Class is used internal to Fortress and usually does not require manipulation by external program. The entity is a composite of 3 different LDAP Schema object classes:

    1. organizationalRole Structural Object Class is used to store basic attributes like cn and description.

     ------------------------------------------
     objectclass ( 2.5.6.8 NAME 'organizationalRole'
      DESC 'RFC2256: an organizational role'
      SUP top STRUCTURAL
      MUST cn
      MAY (
          x121Address $ registeredAddress $ destinationIndicator $
          preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $
          telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $
          seeAlso $ roleOccupant $ preferredDeliveryMethod $ street $
          postOfficeBox $ postalCode $ postalAddress $
          physicalDeliveryOfficeName $ ou $ st $ l $ description
      )
     )
     ------------------------------------------
     

    2. ftHier AUXILIARY Object Class is used to store parent to child relationships on target entity.

     ------------------------------------------
     Fortress Hierarchies Structural Object Class
     objectclass    ( 1.3.6.1.4.1.38088.2.7
     NAME 'ftHier'
     DESC 'Fortress Hierarchy Structural Object Class'
     SUP organizationalrole
     STRUCTURAL
     MUST (
          cn
      )
     MAY (
          ftRels $
          description
      )
     )
     

    3. ftMods AUXILIARY Object Class is used to store Fortress audit variables on target entity.

     ------------------------------------------
     Fortress Audit Modification Auxiliary Object Class
     objectclass ( 1.3.6.1.4.1.38088.3.4
      NAME 'ftMods'
      DESC 'Fortress Modifiers AUX Object Class'
      AUXILIARY
      MAY (
          ftModifier $
          ftModCode $
          ftModId
      )
     )
     ------------------------------------------
     
    Author:
    Apache Directory Project
    See Also:
    Serialized Form
    • Field Detail

      • op

        public Hier.Op op
        The operation
      • type

        public Hier.Type type
        The hierarchy type - ROLE, AROLE, USER, PERM
    • Constructor Detail

      • Hier

        public Hier()
        default constructor is used by internal components.
      • Hier

        public Hier​(List<Relationship> relationships)
        construct hierarchy given a list of parent-child relationships.
        Parameters:
        relationships - maps to 'ftRels' attribute on 'ftHier' object class.
      • Hier

        public Hier​(Hier.Type type)
        Construct entity given a hierarchy type - ROLE, AROLE, USER, PERM.
        Parameters:
        type - determines where the target node resides. For example the 'ROLE' type will specify the RBAC Role container as target.
      • Hier

        public Hier​(Hier.Type type,
                    String child,
                    String parent)
        Construct entity given a parent, child and a hierarchy type.
        Parameters:
        type - determines where the target node resides. For example the 'ROLE' type will specify the RBAC Role container as target.
        child - maps to the 'ftRels' attribute in 'ftHier' object class.
        parent - maps to the 'ftRels' attribute in 'ftHier' object class.
      • Hier

        public Hier​(String child,
                    String parent)
        Construct entity given a parent and child.
        Parameters:
        child - maps to the 'ftRels' attribute in 'ftHier' object class.
        parent - maps to the 'ftRels' attribute in 'ftHier' object class.
    • Method Detail

      • getOp

        public Hier.Op getOp()
        Return the operation to execute on behalf of this entity.
        Returns:
        Op value which maps to Add, Update or Delete attribute targets.
      • setOp

        public void setOp​(Hier.Op op)
        The the operation for which this entity is bound for. Add, Update or Delete.
        Parameters:
        op - type contains 'ADD', 'MOD', or 'REM'.
      • getType

        public Hier.Type getType()
        Return required the type of node this entity is bound to.
        Returns:
        variable specifies which directory node the hierarchy entity is bound to.
      • setType

        public void setType​(Hier.Type type)
        Set the required type which determines which directory node this entity is bound to.
        Parameters:
        type - variable specifies which directory node the hierarchy entity is bound to.
      • isRelationship

        public boolean isRelationship​(String role,
                                      String parent)
        Return true if child and parent represent a valid relationship that is contained within the collection of relationships.
        Parameters:
        role - attribute maps to the 'ftRels' attribute on 'ftHier' object class.
        parent - attribute maps to the 'ftRels' attribute on 'ftHier' object class.
      • setRelationship

        public void setRelationship​(String role,
                                    String parent)
        Set the child and parent into the collection of valid relationships stored in this entity.
        Parameters:
        role - attribute maps to the 'ftRels' attribute on 'ftHier' object class.
        parent - attribute maps to the 'ftRels' attribute on 'ftHier' object class.
      • setRelationship

        public void setRelationship​(Relationship rel)
        Set the relationship object into the collection of valid relationships stored in this entity.
        Parameters:
        rel - attribute maps to the 'ftRels' attribute on 'ftHier' object class.
      • removeRelationship

        public void removeRelationship​(String role,
                                       String parent)
        Remove the specified relationship from the collection of valid relationships stored in this entity.
        Parameters:
        role - attribute maps to the 'ftRels' attribute on 'ftHier' object class.
        parent - attribute maps to the 'ftRels' attribute on 'ftHier' object class.
      • getRelationships

        public List<Relationship> getRelationships()
        Return the list of relationships that are set in collection on this entity.
        Returns:
        List of relationships that map to the 'ftRels' attribute on the 'ftHier' object class.
      • setRelationships

        public void setRelationships​(List<Relationship> relationships)
        Set the list of relationships that are set in collection on this entity.
        Parameters:
        relationships - that map to the 'ftRels' attribute on the 'ftHier' object class.