Class LDAPObjectClassSchema
- java.lang.Object
-
- netscape.ldap.LDAPSchemaElement
-
- netscape.ldap.LDAPObjectClassSchema
-
- All Implemented Interfaces:
java.io.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 theLDAPObjectClassSchema
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, anLDAPObjectClassSchema
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
, andgetDescription
methods inherited from the abstract classLDAPSchemaElement
. Optional and custom qualifiers are accessed withgetQualifier
andgetQualifierNames
fromLDAPSchemaElement
.To add or remove this object class definition from the schema, use the
add
andremove
methods, which this class inherits from theLDAPSchemaElement
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:
LDAPSchemaElement
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
ABSTRACT
static int
AUXILIARY
static int
STRUCTURAL
-
Fields inherited from class netscape.ldap.LDAPSchemaElement
aliases, attrName, binary, binaryString, ces, cesString, cis, cisString, description, dn, dnString, integer, intString, name, novalsTable, OBSOLETE, oid, properties, rawValue, SUPERIOR, SYNTAX, telephone, telephoneString, unknown
-
-
Constructor Summary
Constructors Modifier Constructor Description LDAPObjectClassSchema(java.lang.String raw)
Constructs an object class definition based on a description in the ObjectClassDescription format.LDAPObjectClassSchema(java.lang.String name, java.lang.String oid, java.lang.String[] superiors, java.lang.String description, java.lang.String[] required, java.lang.String[] optional, int type, java.lang.String[] aliases)
Constructs an object class definition, using the specified information.LDAPObjectClassSchema(java.lang.String name, java.lang.String oid, java.lang.String superior, java.lang.String description, java.lang.String[] required, java.lang.String[] optional)
Constructs an object class definition, using the specified information.protected
LDAPObjectClassSchema(java.lang.String name, java.lang.String oid, java.lang.String superior, java.lang.String description, java.lang.String[] required, java.lang.String[] optional, java.lang.String[] aliases)
Constructs an object class definition, using the specified information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Enumeration<java.lang.String>
getOptionalAttributes()
Gets an enumeration of names of optional attributes allowed in this object class.java.util.Enumeration<java.lang.String>
getRequiredAttributes()
Gets an enumeration of the names of the required attributes for this object class.java.lang.String
getSuperior()
Gets the name of the object class from which this class inherits.java.lang.String[]
getSuperiors()
Gets the names of all object classes that this class inherits from.int
getType()
Gets the type of the object class.java.lang.String
toString()
Gets the definition of the object class in a user friendly format.protected java.lang.String
typeToString(int type)
Returns the object class type as a Stringprotected java.lang.String
vectorToList(java.util.Vector<java.lang.String> vals)
Creates a list within parentheses, with $ as delimiter-
Methods inherited from class netscape.ldap.LDAPSchemaElement
add, add, getAliases, getCustomValues, getDescription, getID, getName, getOID, getOptionalValues, getQualifier, getQualifierNames, getValue, isObsolete, modify, modify, parseValue, remove, remove, setQualifier, setQualifier, update, update, update
-
-
-
-
Field Detail
-
STRUCTURAL
public static final int STRUCTURAL
- See Also:
- Constant Field Values
-
ABSTRACT
public static final int ABSTRACT
- See Also:
- Constant Field Values
-
AUXILIARY
public static final int AUXILIARY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LDAPObjectClassSchema
public LDAPObjectClassSchema(java.lang.String name, java.lang.String oid, java.lang.String superior, java.lang.String description, java.lang.String[] required, java.lang.String[] optional)
Constructs an object class definition, using the specified information. The type of the object class will be STRUCTURAL.- Parameters:
name
- name of the object classoid
- object identifier (OID) of the object class in dotted-string format (for example, "1.2.3.4")description
- description of the object classsuperior
- name of the parent object class (the object class that the new object class inherits from)required
- array of names of attributes required in this object classoptional
- array of names of optional attributes allowed in this object class
-
LDAPObjectClassSchema
public LDAPObjectClassSchema(java.lang.String name, java.lang.String oid, java.lang.String[] superiors, java.lang.String description, java.lang.String[] required, java.lang.String[] optional, int type, java.lang.String[] aliases)
Constructs an object class definition, using the specified information.- Parameters:
name
- name of the object classoid
- object identifier (OID) of the object class in dotted-string format (for example, "1.2.3.4")description
- description of the object classsuperiors
- names of parent object classes (the object classes that this object class inherits from)required
- array of names of attributes required in this object classoptional
- array of names of optional attributes allowed in this object classtype
- either ABSTRACT, STRUCTURAL, or AUXILIARYaliases
- names which are to be considered aliases for this object class;null
if there are no aliases
-
LDAPObjectClassSchema
protected LDAPObjectClassSchema(java.lang.String name, java.lang.String oid, java.lang.String superior, java.lang.String description, java.lang.String[] required, java.lang.String[] optional, java.lang.String[] aliases)
Constructs an object class definition, using the specified information. The type of the object class will be STRUCTURAL.- Parameters:
name
- name of the object classoid
- object identifier (OID) of the object class in dotted-string format (for example, "1.2.3.4")description
- description of the object classsuperior
- name of the parent object class (the object class that the new object class inherits from)required
- array of names of attributes required in this object classoptional
- array of names of optional attributes allowed in this object class
-
LDAPObjectClassSchema
public LDAPObjectClassSchema(java.lang.String raw)
Constructs an object class definition based on a description in the ObjectClassDescription format. For information on this format, (see RFC 2252, Lightweight Directory Access Protocol (v3): Attribute Syntax Definitions. This is the format that LDAP servers and clients use to exchange schema information. (For example, when you search an LDAP server for its schema, the server returns an entry with the attributes "objectclasses" and "attributetypes". The values of the "objectclasses" attribute are object class descriptions in this format.)- Parameters:
raw
- definition of the object in the ObjectClassDescription format
-
-
Method Detail
-
getSuperior
public java.lang.String getSuperior()
Gets the name of the object class from which this class inherits.- Returns:
- the name of the object class from which this class inherits. If it inherits from more than one class, only one is returned.
- See Also:
getSuperiors()
-
getSuperiors
public java.lang.String[] getSuperiors()
Gets the names of all object classes that this class inherits from. Typically only one, but RFC 2252 allows multiple inheritance.- Returns:
- the names of the object classes from which this class inherits.
-
getRequiredAttributes
public java.util.Enumeration<java.lang.String> getRequiredAttributes()
Gets an enumeration of the names of the required attributes for this object class.- Returns:
- an enumeration of the names of the required attributes for this object class.
-
getOptionalAttributes
public java.util.Enumeration<java.lang.String> getOptionalAttributes()
Gets an enumeration of names of optional attributes allowed in this object class.- Returns:
- an enumeration of the names of optional attributes allowed in this object class.
-
getType
public int getType()
Gets the type of the object class.- Returns:
- STRUCTURAL, ABSTRACT, or AUXILIARY.
-
toString
public java.lang.String toString()
Gets the definition of the object class in a user friendly format. This is the format that the object class definition uses when you print the object class or the schema.- Overrides:
toString
in classjava.lang.Object
- Returns:
- definition of the object class in a user friendly format.
-
vectorToList
protected java.lang.String vectorToList(java.util.Vector<java.lang.String> vals)
Creates a list within parentheses, with $ as delimiter- Parameters:
vals
- values for list- Returns:
- a String with a list of values.
-
typeToString
protected java.lang.String typeToString(int type)
Returns the object class type as a String- Parameters:
type
- one of STRUCTURAL, ABSTRACT, or AUXILIARY- Returns:
- one of "STRUCTURAL", "ABSTRACT", "AUXILIARY", or
null
-
-