Class SchemaManager

  • All Implemented Interfaces:
    IUMSConstants, Serializable

    public class SchemaManager
    extends Object
    implements Serializable, IUMSConstants
    The class manages the schema in the LDAP directory server.

    Examples:

    To add/delete schema definitions

     // Gets the schema manager associated with the login Context
     SchemaManager mgr = SchemaManager.getSchemaManager(principal);
     
     // Adds a new attribute type to the schema
     mgr.addAttribute("newAttributeType", 
             "1.2.3.4.5.6.5.4.3.2.1",
             "A new attribute type", 
             SchmeaManager.ATTRIBUTE_SYNTAX_CIS, true, null,
             null);
     
     // Removes a attribute type from the schema
     mgr.removeAttribute("newAttributeType");
     
     // Adds a new object class to the schema
     mgr.addObjectClass("newObjectClass", 
             "1.1.2.2.1.1.2.2", null,
             "A new object class", required, optional);
     
     // Removes a object class from the schema
     mgr.removeObjectClass("newObjectClass");
     
     
    See Also:
    Serialized Form
    • Field Detail

      • AUXILIARY

        public static final int AUXILIARY
        Auxiliary object class type
        See Also:
        Constant Field Values
    • Method Detail

      • getSchemaManager

        public static SchemaManager getSchemaManager​(SSOToken token)
                                              throws UMSException
        Returns the schema manager assosciated with the given authenticated Principal.
        Parameters:
        token - Authenticated principal's single sign on token.
        Returns:
        Schema manager associated with the given principal.
        Throws:
        UMSException - if failed to get schema manager.
      • getSchemaManager

        public static SchemaManager getSchemaManager​(Principal principal)
                                              throws UMSException
        Returns the schema manager assosciated with the given authenticated Principal.
        Parameters:
        principal - Authenticated principal.
        Returns:
        Schema manager associated with the given principal.
        Throws:
        UMSException - if failed to get schema manager.
      • getObjectClasses

        public Collection<String> getObjectClasses​(String attrName)
                                            throws UMSException
        Gets a collection of the names of the object classes for this attribute
        Parameters:
        attrName - Name of the attribute
        Returns:
        A collection of the names of the object classes for this attribute
        Throws:
        UMSException - failure
      • getAttributes

        public Collection<String> getAttributes​(String objClassName)
                                         throws UMSException
        Returns a collection of the names of the required and optional attributes for this object class.
        Parameters:
        objClassName - Name of the object class.
        Returns:
        A collection of the names of the required and optional attributes for this object class.
        Throws:
        UMSException - if failed to get attribute names.