Complete Contents |
Chapter 1 Understanding LDAP
Chapter 2 Using the Netscape Directory SDK for Java
Chapter 3 Quick Start
Chapter 4 Writing an LDAP Client
Chapter 5 Using the LDAP Java Classes
Chapter 6 Searching the Directory
Chapter 7 Using Filter Configuration Files
Chapter 8 Adding, Updating, and Deleting Entries
Chapter 9 Comparing Values in Entries
Chapter 10 Working with LDAP URLs
Chapter 11 Getting Server Information
Chapter 12 Connecting Over SSL
Chapter 13 Working with LDAP Controls
Chapter 14 Using SASL Authentication
Chapter 15 Using Netscape's JNDI Service Provider
Chapter 16 Working with Extended Operations
Chapter 17 Using the Asynchronous Interface
A DSE is a DSA-specific entry in the directory. (A DSA is a directory system agent, which is an X.500 term for a directory server.) A DSE contains information specific to the server.
In a directory tree, the root of the tree is the root DSE. It is not part of any naming context (for example, it is above "o=Airius.com" in the directory tree).
(Note that the root DSE is specified as part of the LDAP v3 protocol. LDAP v2 servers do not necessarily have a root DSE.)
The root DSE can contain the following information:
|Getting the Root DSE|
The root DSE for an LDAP server specifies information about the server. The following table lists the types of information available in different attributes of the root DSE.
Turn off automatic referral handling and connect to the LDAP server (see "Creating a Connection and Setting Preferences", "Connecting to the LDAP Server", and "Enabling or Disabling Referral Handling" for details).
|Determining If the Server Supports LDAP v3|
You can determine what version an LDAP server supports by getting the supportedLDAPVersion attribute from the root DSE. This attribute should contain the value 3. (It may also contain other values, such as 2, so you may want to check through the values of this attribute.)
Note that you do not need to authenticate or bind (see "Binding and Authenticating to an LDAP Server" for details) before searching the directory. Unlike the LDAP v2 protocol, the LDAP v3 protocol states that clients do not need to bind to the server before performing LDAP operations.
The following section of code connects to an LDAP server and determines whether or not that server supports the LDAP v3 protocol.
|Getting Schema Information|
In the LDAP v3 protocol, you can get and modify the schema for an LDAP server over the LDAP protocol. This section discusses the classes and methods that you can use to do this.
An entry can specify the schema that defines the object classes, attributes, and matching rules used by the directory. This entry is called the subschema entry. To find the DN of the subschema entry, get the subschemaSubentry operational attribute from the root DSE or from any entry. (See "Specifying the Attributes to Retrieve" for details.) For example, in the root DSE for the Netscape Directory Server 4.1, the subschemaSubentry attribute specifies the location of the subschema entry. The subschema entry itself can have the following attributes:
To get the schema for an LDAP v3 server, construct a new LDAPSchema object. Then, invoke the fetchSchema method passing in an LDAPConnection object. For example:
...Working with Object Class Descriptions
In the LDAP Java classes, the object class descriptions in a schema are represented by objects of the LDAPObjectClassSchema class. To get the object class descriptions from the schema, you can invoke one of the following methods:
In the LDAP Java classes, the attribute type descriptions in a schema are represented by objects of the LDAPAttributeSchema class. To get the attribute type descriptions from the schema, you can invoke one of the following methods:
In the LDAP Java classes, the matching rule descriptions and matching rule "use" descriptions in a schema are represented by objects of the LDAPMatchingRuleSchema class. To get the matching rule descriptions from the schema, you can invoke one of the following methods:
The following section of code illustrates how to get the schema and how to add object classes and attribute types.