Package netscape.ldap

Class LDAPObjectClassSchema

java.lang.Object
netscape.ldap.LDAPSchemaElement
netscape.ldap.LDAPObjectClassSchema
All Implemented Interfaces:
Serializable

public class LDAPObjectClassSchema extends LDAPSchemaElement
The definition of an object class in the schema. RFC 2252, Lightweight Directory Access Protocol (v3): Attribute Syntax Definitions covers the types of information that need to be specified in the definition of an object class. According to the RFC, the description of an object class can include the following information:

  • an OID identifying the object class
  • a name identifying the object class
  • a description of the object class
  • the name of the parent object class
  • the list of attribute types that are required in this object class
  • the list of attribute types that are allowed (optional) in this object class

When you construct an LDAPObjectSchema object, you can specify these types of information as arguments to the constructor or in the ObjectClassDescription format specified in RFC 2252. When an LDAP client searches an LDAP server for the schema, the server returns schema information as an object with attribute values in this format.

RFC 2252 also notes that you can specify whether or not an object class is abstract, structural, or auxiliary in the object description. Abstract object classes are used only to derive other object classes. Entries cannot belong to an abstract object class. top is an abstract object class. Entries must belong to a structural object class, so most object classes are structural object classes. Objects of the LDAPObjectClassSchema class are structural object classes by default. Auxiliary object classes can be used to add attributes to entries of different types. For example, an auxiliary object class might be used to specify personal preference attributes. An entry can not contain just that object class, but may include it along with a structural object class, for example inetOrgPerson. If the definition of an object (in ObjectClassDescription format) specifies the AUXILIARY keyword, an LDAPObjectClassSchema object created from that description represents an auxiliary object class.

You can get the name, OID, and description of this object class definition by using the getName, getOID, and getDescription methods inherited from the abstract class LDAPSchemaElement. Optional and custom qualifiers are accessed with getQualifier and getQualifierNames from LDAPSchemaElement.

To add or remove this object class definition from the schema, use the add and remove methods, which this class inherits from the LDAPSchemaElement abstract class.

RFC 2252 defines ObjectClassDescription as follows:

    ObjectClassDescription = "(" whsp
        numericoid whsp      ; ObjectClass identifier
        [ "NAME" qdescrs ]
        [ "DESC" qdstring ]
        [ "OBSOLETE" whsp ]
        [ "SUP" oids ]       ; Superior ObjectClasses
        [ ( "ABSTRACT" / "STRUCTURAL" / "AUXILIARY" ) whsp ]
                             ; default structural
        [ "MUST" oids ]      ; AttributeTypes
        [ "MAY" oids ]       ; AttributeTypes
    whsp ")"
 
Version:
1.0
See Also: