LDAP Classes
Implements Java LDAP

com.novell.ldap
Class LDAPSchema

java.lang.Object
  extended bycom.novell.ldap.LDAPEntry
      extended bycom.novell.ldap.LDAPSchema
All Implemented Interfaces:
java.lang.Comparable, java.io.Externalizable, java.io.Serializable

public class LDAPSchema
extends LDAPEntry

Represents a schema entry that controls one or more entries held by a Directory Server.

LDAPSchema Contains methods to parse schema attributes into individual schema definitions, represented by subclasses of LDAPSchemaElement. Schema may be retrieved from a Directory server with the fetchSchema method of LDAPConnection or by creating an LDAPEntry containing schema attributes. The following sample code demonstrates how to retrieve schema elements from LDAPSchema


      .
      .
      .
      LDAPSchema schema;
      LDAPSchemaElement element;

      // connect to the server
      lc.connect( ldapHost, ldapPort );
      lc.bind( ldapVersion, loginDN, password );

      // read the schema from the directory
      schema = lc.fetchSchema( lc.getSchemaDN() );

      // retrieve the definition of common name
      element = schema.getAttributeSchema( "cn" );
      System.out.println("The attribute cn has an oid of " + element.getID());
      .
      .
      .
 

Other sample code:

Adding and deleting Schema.
ExtendSchema.java
Modifing an existing schema element
MakeContainer.java
Listing schema in a GUI
ListSchema.java
ListAttributeSchema.java
ListObjectClassSchema.java

See Also:
LDAPSchemaElement, LDAPConnection.fetchSchema(java.lang.String), LDAPConnection.getSchemaDN(), Serialized Form

Field Summary
 
Fields inherited from class com.novell.ldap.LDAPEntry
attrs, dn
 
Constructor Summary
LDAPSchema()
          This constructor was added to support default Serialization
LDAPSchema(LDAPEntry ent)
          Constructs an LDAPSchema object from attributes of an LDAPEntry.
 
Method Summary
 java.util.Enumeration getAttributeNames()
          Returns an enumeration of attribute names.
 LDAPAttributeSchema getAttributeSchema(java.lang.String name)
          Returns a particular attribute definition, or null if not found.
 java.util.Enumeration getAttributeSchemas()
          Returns an enumeration of attribute definitions.
 java.util.Enumeration getDITContentRuleNames()
          Returns an enumeration of DIT content rule names.
 LDAPDITContentRuleSchema getDITContentRuleSchema(java.lang.String name)
          Returns a particular DIT content rule definition, or null if not found.
 java.util.Enumeration getDITContentRuleSchemas()
          Returns an enumeration of DIT content rule definitions.
 java.util.Enumeration getDITStructureRuleNames()
          Returns an enumeration of DIT structure rule names.
 LDAPDITStructureRuleSchema getDITStructureRuleSchema(int ID)
          Returns a particular DIT structure rule definition, or null if not found.
 LDAPDITStructureRuleSchema getDITStructureRuleSchema(java.lang.String name)
          Returns a particular DIT structure rule definition, or null if not found.
 java.util.Enumeration getDITStructureRuleSchemas()
          Returns an enumeration of DIT structure rule definitions.
 java.util.Enumeration getMatchingRuleNames()
          Returns an enumeration of matching rule names.
 LDAPMatchingRuleSchema getMatchingRuleSchema(java.lang.String name)
          Returns a particular matching rule definition, or null if not found.
 java.util.Enumeration getMatchingRuleSchemas()
          Returns an enumeration of matching rule definitions.
 java.util.Enumeration getMatchingRuleUseNames()
          Returns an enumeration of matching rule use names.
 LDAPMatchingRuleUseSchema getMatchingRuleUseSchema(java.lang.String name)
          Returns a particular matching rule use definition, or null if not found.
 java.util.Enumeration getMatchingRuleUseSchemas()
          Returns an enumeration of matching rule use definitions.
 java.util.Enumeration getNameFormNames()
          Returns an enumeration of name form names.
 LDAPNameFormSchema getNameFormSchema(java.lang.String name)
          Returns a particular name form definition, or null if not found.
 java.util.Enumeration getNameFormSchemas()
          Returns an enumeration of name form definitions.
 java.util.Enumeration getObjectClassNames()
          Returns an enumeration of object class names.
 LDAPObjectClassSchema getObjectClassSchema(java.lang.String name)
          Returns a particular object class definition, or null if not found.
 java.util.Enumeration getObjectClassSchemas()
          Returns an enumeration of object class definitions.
 LDAPSyntaxSchema getSyntaxSchema(java.lang.String oid)
          Returns a particular syntax definition, or null if not found.
 java.util.Enumeration getSyntaxSchemas()
          Returns an enumeration of syntax definitions.
static java.lang.Object readDSML(java.io.InputStream input)
          This method is used to deserialize the DSML encoded representation of this class.
 
Methods inherited from class com.novell.ldap.LDAPEntry
compareTo, getAttribute, getAttributeSet, getAttributeSet, getDN, readExternal, toString, writeDSML, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LDAPSchema

public LDAPSchema()
This constructor was added to support default Serialization


LDAPSchema

public LDAPSchema(LDAPEntry ent)
Constructs an LDAPSchema object from attributes of an LDAPEntry.

The object is empty if the entry parameter contains no schema attributes. The recognized schema attributes are the following:


          "attributeTypes", "objectClasses", "ldapSyntaxes",
          "nameForms", "dITContentRules", "dITStructureRules",
          "matchingRules","matchingRuleUse"
 

Parameters:
ent - An LDAPEntry containing schema information.
Method Detail

getAttributeSchema

public LDAPAttributeSchema getAttributeSchema(java.lang.String name)
Returns a particular attribute definition, or null if not found.

Parameters:
name - Name or OID of the attribute for which a definition is to be returned.
Returns:
The attribute definition, or null if not found.

getDITContentRuleSchema

public LDAPDITContentRuleSchema getDITContentRuleSchema(java.lang.String name)
Returns a particular DIT content rule definition, or null if not found.

Parameters:
name - The name of the DIT content rule use for which a definition is to be returned.
Returns:
The DIT content rule definition, or null if not found.

getDITStructureRuleSchema

public LDAPDITStructureRuleSchema getDITStructureRuleSchema(java.lang.String name)
Returns a particular DIT structure rule definition, or null if not found.

Parameters:
name - The name of the DIT structure rule use for which a definition is to be returned.
Returns:
The DIT structure rule definition, or null if not found.

getDITStructureRuleSchema

public LDAPDITStructureRuleSchema getDITStructureRuleSchema(int ID)
Returns a particular DIT structure rule definition, or null if not found.

Parameters:
ID - The ID of the DIT structure rule use for which a definition is to be returned.
Returns:
The DIT structure rule definition, or null if not found.

getMatchingRuleSchema

public LDAPMatchingRuleSchema getMatchingRuleSchema(java.lang.String name)
Returns a particular matching rule definition, or null if not found.

Parameters:
name - The name of the matching rule for which a definition is to be returned.
Returns:
The matching rule definition, or null if not found.

getMatchingRuleUseSchema

public LDAPMatchingRuleUseSchema getMatchingRuleUseSchema(java.lang.String name)
Returns a particular matching rule use definition, or null if not found.

Parameters:
name - The name of the matching rule use for which a definition is to be returned.
Returns:
The matching rule use definition, or null if not found.

getNameFormSchema

public LDAPNameFormSchema getNameFormSchema(java.lang.String name)
Returns a particular name form definition, or null if not found.

Parameters:
name - The name of the name form for which a definition is to be returned.
Returns:
The name form definition, or null if not found.

getObjectClassSchema

public LDAPObjectClassSchema getObjectClassSchema(java.lang.String name)
Returns a particular object class definition, or null if not found.

Parameters:
name - The name or OID of the object class for which a definition is to be returned.
Returns:
The object class definition, or null if not found.

getSyntaxSchema

public LDAPSyntaxSchema getSyntaxSchema(java.lang.String oid)
Returns a particular syntax definition, or null if not found.

Parameters:
oid - The oid of the syntax for which a definition is to be returned.
Returns:
The syntax definition, or null if not found.

getAttributeSchemas

public java.util.Enumeration getAttributeSchemas()
Returns an enumeration of attribute definitions.

Returns:
An enumeration of attribute definitions.

getDITContentRuleSchemas

public java.util.Enumeration getDITContentRuleSchemas()
Returns an enumeration of DIT content rule definitions.

Returns:
An enumeration of DIT content rule definitions.

getDITStructureRuleSchemas

public java.util.Enumeration getDITStructureRuleSchemas()
Returns an enumeration of DIT structure rule definitions.

Returns:
An enumeration of DIT structure rule definitions.

getMatchingRuleSchemas

public java.util.Enumeration getMatchingRuleSchemas()
Returns an enumeration of matching rule definitions.

Returns:
An enumeration of matching rule definitions.

getMatchingRuleUseSchemas

public java.util.Enumeration getMatchingRuleUseSchemas()
Returns an enumeration of matching rule use definitions.

Returns:
An enumeration of matching rule use definitions.

getNameFormSchemas

public java.util.Enumeration getNameFormSchemas()
Returns an enumeration of name form definitions.

Returns:
An enumeration of name form definitions.

getObjectClassSchemas

public java.util.Enumeration getObjectClassSchemas()
Returns an enumeration of object class definitions.

Returns:
An enumeration of object class definitions.

getSyntaxSchemas

public java.util.Enumeration getSyntaxSchemas()
Returns an enumeration of syntax definitions.

Returns:
An enumeration of syntax definitions.

getAttributeNames

public java.util.Enumeration getAttributeNames()
Returns an enumeration of attribute names.

Returns:
An enumeration of attribute names.

getDITContentRuleNames

public java.util.Enumeration getDITContentRuleNames()
Returns an enumeration of DIT content rule names.

Returns:
An enumeration of DIT content rule names.

getDITStructureRuleNames

public java.util.Enumeration getDITStructureRuleNames()
Returns an enumeration of DIT structure rule names.

Returns:
An enumeration of DIT structure rule names.

getMatchingRuleNames

public java.util.Enumeration getMatchingRuleNames()
Returns an enumeration of matching rule names.

Returns:
An enumeration of matching rule names.

getMatchingRuleUseNames

public java.util.Enumeration getMatchingRuleUseNames()
Returns an enumeration of matching rule use names.

Returns:
An enumeration of matching rule use names.

getNameFormNames

public java.util.Enumeration getNameFormNames()
Returns an enumeration of name form names.

Returns:
An enumeration of name form names.

getObjectClassNames

public java.util.Enumeration getObjectClassNames()
Returns an enumeration of object class names.

Returns:
An enumeration of object class names.

readDSML

public static java.lang.Object readDSML(java.io.InputStream input)
                                 throws java.io.IOException
This method is used to deserialize the DSML encoded representation of this class.

Parameters:
input - InputStream for the DSML formatted data.
Returns:
Deserialized form of this class.
Throws:
java.io.IOException - when serialization fails.

LDAP Classes
Implements Java LDAP

Copyright © 2002 Novell, Inc. All Rights Reserved.
Novell, Inc.
1800 South Novell Place
Provo, Ut 84606
Phone: (801) 861-5000