Class DomainComponentTree


  • public class DomainComponentTree
    extends Object
    Represents the domain component index tree (dctree). A domain component tree is used to represent virtual domains as used in DNS. DCTree composes of a hiearchical tree of domain components (dc) and each dc node may/maynot associate with a organizational DIT (convergence tree as noted in nortel spec). Sample of a dctree that starts at dcroot of "o=internet" will look like this

                   o=internet
                       |
                  ------------------------------
                 |             |                |
               dc=com        dc=net           dc=edu
                  |
             ---------
             |        |
           dc=sun    dc=iplanet
             |            |
           dc=eng       dc=red
     
    DomainComponentTree allows the user to create a dc tree capturing virtual domain names in a network (hosted or enterprise) environment with each low level dc node being mapped to an organizational DIT.
    See Also:
    DomainComponent
    • Constructor Detail

      • DomainComponentTree

        public DomainComponentTree()
        Default constructor
      • DomainComponentTree

        public DomainComponentTree​(SSOToken token,
                                   Guid dcRoot)
                            throws InvalidDCRootException,
                                   UMSException
        Constructs a DomainComponentTree with an authenticated prinicipal and an identification of the root of the dc index tree.
        Parameters:
        token - Single sign on token of authenticated principal with priviledge for accessing the domain component index tree (dctree).
        dcRoot - Identification of root, a DN, of the dc tree such as o=internet.
        Throws:
        InvalidDCRootException - if invalid root specification.
        UMSException - if other read error occurred.
    • Method Detail

      • setDCRoot

        public void setDCRoot​(Guid root)
                       throws UMSException
        Sets the root of the domain component tree (dc tree). Needs an established authenticated principal before setting dcroot.
        Parameters:
        root - Identification of the root of the tree such as o=internet
        Throws:
        UMSException
      • getDCRoot

        public PersistentObject getDCRoot()
        Gets the root of the domain component tree (dc tree)
        Returns:
        PersistentObject representing the dctree root in the dctree DIT
      • addDomain

        public DomainComponent addDomain​(String domain)
                                  throws UMSException
        Add a virtual domain into the domain component tree.
        Parameters:
        domain - Fully qualified domain name
        Returns:
        Domain Componet entry just added to the dctree
        Throws:
        InvalidDCRootException - if dcroot is not defined
        UMSException - for write problem in adding domain to dctree
      • removeDomain

        public void removeDomain​(String domain)
                          throws UMSException
        Remove a virtual domain in the dctree
        Parameters:
        domain - Virtual domain name to be removed
        Throws:
        UMSException - upon failure to remove the corresponding dc entry in the dctree
      • setDomainMapping

        public void setDomainMapping​(String domain,
                                     PersistentObject org)
                              throws UMSException
        Set the domain mapping so that the dc entry maps to an organization in the the organization DIT hosting user data (the convergence tree in Nortel spec)
        Parameters:
        domain - Fully qualified domain name
        org - Organization entry to be mapped from dctree to organization DIT (the convergence tree in nortel spec)
        Throws:
        DomainNotFoundException - if domain id not defined
        UMSException - upon write failure
      • setDomainMapping

        public void setDomainMapping​(String domain,
                                     Guid orgGuid)
                              throws UMSException
        Set the domain mapping so that the dc entry maps to an organization in the convergence tree.
        Parameters:
        domain - Virtual domain name.
        orgGuid - Identifiication of Organization entry to be mapped from dctree to organization DIT (the convergence tree in nortel spec).
        Throws:
        UMSException - if write failed.
      • mapDomainToDN

        public String mapDomainToDN​(String domain)
        Given a fully qualified domain name, maps it to the corresponding DN in the DCtree
        Parameters:
        domain - Fully qualified domain name
        Returns:
        String representation of the Distinguished Name in the DC Tree
      • getDomainComponent

        public DomainComponent getDomainComponent​(String domain)
                                           throws DomainNotFoundException,
                                                  UMSException
        Given a virtual domain name such as "javasoft.sun.com", returns the domain component entry in the dc index tree. This entry lives under dc index tree and one can use the dc entry to get to the organization assoicated with the dc tree
        Parameters:
        domain - Virtual domain name such as "javasoft.sun.com"
        Returns:
        Domain componet entry representing the virtual domain in the domain component tree
        Throws:
        DomainNotFoundException - if given domain is not found in the dctree
        UMSException - upon read error
      • getOrganization

        public PersistentObject getOrganization​(String domain)
                                         throws DomainNotFoundException,
                                                UMSException
        Given a virtual domain name such as "javasoft.sun.com", return the organization, organizationalunit or any DIT entry that is assoicated from the domain compoent tree (dctree) to the customer oranization DIT (the convergence tree as outlined in nortel spec)
        Parameters:
        domain - Fully qualified virtual domain name
        Returns:
        Entry referred in the dc tree.
        Throws:
        DomainNotFoundException - if domain is not found
        UMSException - for reading problem in instantiating the mapped organization
      • getUser

        public User getUser​(String uid,
                            String domain)
                     throws DomainNotFoundException,
                            UMSException
        Given a uid for a user, lookup the user under a specified virtual domain name. For example,
         DomainComponentTree dctree = new DomainComponentTree(ctx, 
                                              "red.iplanet.com");
         
         User user = dctree.getUser("hman", 
                                              "red.iplanet.com");
         
        Parameters:
        uid - User id for the entry to be searched
        domain - Fully qualified domain name such as "red.iplanet.com"
        Returns:
        User object found
        Throws:
        DomainNotFoundException - if domain is not found
        UMSException - upon failure in instantiating the user object
      • getUser

        public User getUser​(String namingAttribute,
                            String value,
                            String domain)
                     throws DomainNotFoundException,
                            UMSException
        Given identification of a user with a naming attribute and value, lookup the user under a virtual domain specified. For example,
         DomainComponentTree dctree = new DomainComponentTree(ctx,
                                                   "red.iplanet.com");
         
         User user = dctree.getUser("cn", "Hin Man", 
                                                     "red.iplanet.com");
         
        Parameters:
        namingAttribute - Naming attribute for the user object such as "uid" or "mail". The naming attribute has to provide a unique identifier for the user.
        value - attribute value for the naming attribute
        domain - Fully qualified domain name such as "red.iplanet.com"
        Returns:
        User object if found
        Throws:
        DomainNotFoundException - if domain is not found
        UMSException - upon failure in instantiating the user object
      • mapDCToDomainName

        public String mapDCToDomainName​(DomainComponent dc)
        Given a domain component in a dctree, maps it to a virtual domain name
        Parameters:
        dc - A domain component that lives in the dctree
        Returns:
        Fully qualified domain name
      • getChildDomainIDs

        public Hashtable getChildDomainIDs()
                                    throws UMSException
        Get all virtual domains present in the dctree. Construct a hashtable of the found domain names and their associated organization in the customer organizational DIT (the convergence tree)

        This function can be used as a cache function for the complete DCTree. The returning hastable provides all the virtual domain name as keys that maps to organization mapping linked in the domain component dc nodes

        Returns:
        Hashtable of domain names and associated organizations. Each domain name is associated with one organization but muliple domain names can map to the same organization in the customer DIT.
        Throws:
        UMSException - upon failure in searching all mapped domains