Defining a New Class
When you define a new class, specify the legal parent classes of the new class, that is, the classes that can contain instances of your new class. The legal parent classes are specified in the possSuperiors and systemPossSuperiors attributes of the new class, as well as in the possible superiors inherited from its superclasses, but not from auxiliary classes.
Be specific when defining the legal parent classes for the new class. Decide where you want users to create instances of your class. For example, specifying "container" as a legal parent will enable the user create instances under any of the standard containers (container, organizationalUnit, and so on), while specifying "computer" would enable instances to be created only under instances of the computer object.
To Create a Class
- Choose a name for the class. For more information about composing a common-name and an LDAP display name for a new class, see Naming Attributes and Classes.
- Obtain an object identifier (OID) for the class. For more information, see Obtaining an Object Identifier.
- Choose a "default object category" for the class. For more information, see Object Class and Object Category.
- Choose an "object class category" for the class. This indicates whether the class is abstract, structural, or auxiliary. For more information, see Structural, Abstract, and Auxiliary Classes.
- Create a new classSchema object. Many attributes can be set for an classSchema object. The following attributes are critical to the definition of a new class:
- Classes from which the new class inherits: subClassOf, auxiliaryClass, and systemAuxiliaryClass
- Names and identifiers for the new class: cn, lDAPDisplayName, adminDisplayName, schemaIDGUID, governsID
- Possible attributes of the new class: mustContain, systemMustContain, mayContain, systemMayContain
- Possible parents of the new class: possSuperiors, systemPossSuperiors
- description (optional)
For more information, and descriptions of these attributes, see Characteristics of Object Classes.
Be aware that the classes specified in subClassOf, possSuperiors, systemPossSuperiors, auxiliaryClass, and systemAuxiliaryClass, must exist when the new class is written to the directory; otherwise, the classSchema object will fail to be added to the directory. Similarly, the attributes specified in mustContain, systemMustContain, mayContain, and systemMayContain, must exist or the class creation operation will fail.
- Write the new classSchema object to the directory.
To add an attribute to the mayContain property
- Obtain the classSchema object for the class to modify.
- Add the new attribute to the mayContain multi-valued property.
- Write the changed classSchema object back to the directory.
New attributes can be created at the same time as new classes; the order of creating the new attributes and classes is important. For more information, see What the Installation Must Do.
To add new attributes and new classes at the same time
- Define all of the new attributes first. For more information, see Defining a New Attribute.
- Update the Schema Cache before defining any new classes. For more information, see Updating the Schema Cache.
- Create the new classes.
- Add the desired attributes to the new classes.
- Update the Schema Cache again.