Class ConfigManagerUMS

  • All Implemented Interfaces:
    Serializable

    public class ConfigManagerUMS
    extends Object
    implements Serializable
    Configuration Manager is responsible for getting configuration parameters for UMS. ConfigManager is implemented as a singleton and the configurations can be accessed as follows:

      ConfigManager cm = ConfigManager.getConfigManager(); 
         AttrSet tempAtts=
                 cm.getTemplate("o=foo,o=isp", "BasicUser"); 
         Set hs =
         cm.getEntity("o=foo,o=isp", 
                  "com.iplanet.ums.PeopleContainer" );
         String [] sTemplateNames = 
             cm.getCreationTemplateNames("o=foo, o=isp"); *
     
    ConfigManager obsoletes the use of previous Config class which opens up resource file and reading whenever a configuation is needed. ConfigManager speeds up the retrieval in caching the configurations at start up time once as a singleton and share it among the ums package. ConfigManager uses the default PROXY as AuthPrincipal for this instance of the server.

    See Also:
    Serialized Form
    • Method Detail

      • getEntity

        public Set getEntity​(Guid guid,
                             String name)
                      throws ConfigManagerException
        Returns the Attribute Key-Value set of a Structure Template entry. It searches for all entries and returns the entry for which the "class" Attribute matches the provided name.
        Parameters:
        guid - GUI specifies the starting location for ConfigManager to begin searching for DIT information (for structural entities).
        name - Class name of the object for which the DIT information applies.
        Returns:
        Collection of attrSets pertaining to the structure templates in the DIT.
        Throws:
        ConfigManagerException
      • getSearchTemplate

        public AttrSet getSearchTemplate​(Guid guid,
                                         String templateName,
                                         int lookup)
                                  throws ConfigManagerException
        Returns the Attribute Key-Value set of a Search or Creation Template entry. It searches for all entries and returns the entry for which the "name" Attribute matches the provided name.
        Parameters:
        guid - Specifies the starting location for ConfigManager to begin searching for DIT information (for structural entities).
        templateName - Template name.
        lookup -
        Returns:
        AttrSet value pertaining to the structural template in the DIT. Usage:
                 AttrSet a = CM.getSearchTemplateForClass(
                      principal, "o=foo,o=org", "BasicUserSearch");
                 
        Converts the guid to /iDA/foo/org (for internal SMS representation). Looks for Search Template with attribute "name" matching BasicUserSearch and returns the first one matched. If found in cache, it returns that. Else it looks it up in the Directory through SMS (traverses the tree if need be).
        Throws:
        ConfigManagerException
      • getCreationTemplate

        public AttrSet getCreationTemplate​(Guid guid,
                                           String templateName,
                                           int lookup)
                                    throws ConfigManagerException
        Returns Attribute Key-Value set of a CreationTemplate entry. It searches for all entries and returns the entry for which the "name" Attribute matches the provided name.
        Parameters:
        guid - Specifies the starting location for ConfigManager to begin searching for DIT information (for structural entities).
        templateName - Template name.
        lookup -
        Returns:
        AttrSet value pertaining to the structural template in the DIT. Usage:
                 AttrSet a = CM.getCreationTemplateForClass(
                      principal, "o=foo,o=org", "BasicUser");
                 
        Converts the guid to /iDA/foo/org (for internal SMS representation). Looks for Search Template with attribute "name" matching BasicUser and returns the first one matched. If found in cache, it returns that. Else it looks it up in the Directory through SMS (traverses the tree if need be)
        Throws:
        ConfigManagerException
      • getCreationTemplateForClass

        public AttrSet getCreationTemplateForClass​(Guid guid,
                                                   String className,
                                                   int lookup)
                                            throws ConfigManagerException
        Returns the Attribute key-value pair of Creation templates under the given organization by matching the the javaclass attribute to the name provided. If no templates are listed under the current organization then it traverses the org tree till it finds one, or returns null.
        Parameters:
        guid - Organization DN.
        className - Name of javaclass Attribute to be matched.
        lookup -
        Returns:
        Attribute key-value pair of Creation templates. Usage:
                 AttrSet a = CM.getCreationTemplateForClass(
                      principal, "o=foo,o=org", "com.iplanet.ums.BasicUser");
                 
        Converts the guid to /iDA/org. Looks under CreationTemplates/templates/org for nodes where attribute "class" matches com.iplanet.ums.BasicUser. First looks up cache, if not found in cache, then looks up in Directory.
        Throws:
        ConfigManagerException
      • getCreationTemplateNames

        public Set getCreationTemplateNames​(Guid guid)
                                     throws ConfigManagerException
        Returns an array of the Creation Template names under the given organization. If there are no Creation Templates under the given organization then it traveres the organization tree upwards till it finds one, or returns null.
        Parameters:
        guid - Organization to look under.
        Returns:
        Set of Creation Template names.
        Throws:
        ConfigManagerException
      • getSearchTemplateNames

        public Set getSearchTemplateNames​(Guid guid)
                                   throws ConfigManagerException
        Returns a set of the Search Template names under the given organization. If there are no Search Templates under the given organization then it traveres the organization tree upwards till it finds one, or returns null.
        Parameters:
        guid - Organization to look under.
        Returns:
        Set of template name.
        Throws:
        ConfigManagerException
      • getClassResolver

        public String[][] getClassResolver()
                                    throws ConfigManagerException
        Gets the mapping between ldap entry objectclasses and the UMS Java class. This is an array of objectclass, java class pairs. The Objectclass/Javaclass pair for a superclass should be defined before that of a subclass. This method returns a double-subscripted array for the component "ObjectResolver" under the root tree. This component will not exist under any other organization except the root.
        Returns:
        an array of Objectclass/Javaclass pairs.
        Throws:
        ConfigManagerException
      • replaceCreationTemplate

        public void replaceCreationTemplate​(Guid guid,
                                            String templateName,
                                            AttrSet attrSet)
                                     throws ConfigManagerException
        Replaces an existing template.
        Parameters:
        guid - the GUID it is looking under.
        templateName - Name of the template.
        attrSet - attribute-values pair to be replaced.
        Throws:
        ConfigManagerException