LDAP Classes
Implements Java LDAP

Package com.novell.ldap.util

Provides utility classes for use by LDAP applications.

See:
          Description

Interface Summary
HttpRequestCallback  
LDAPReader Describes the interfaces used by applications to read LDAP messages from an input source.
LDAPWriter Describes the interfaces used by applications to write LDAP messages to an output destination.
 

Class Summary
Base64 The Base64 utility class performs base64 encoding and decoding.
DN A DN encapsulates a Distinguished Name (an ldap name with context).
DOMReader Reads pre-parsed DSML as LDAPMessages.
DOMWriter Writes LDAPMessages into a DOM structure as DSML batch requests and batch responses.
DSMLReader Reads, parses and converts DSML into LDAPMessages.
DSMLWriter Writes LDAPMessages into a Writer or outputStream as DSML batch requests and batch responses.
LDAPXMLHandler This class is used to handle the deserialization events emitted by SAXEventMultiplexer.
LDIFReader The class to process the inputStream object to read an LDIF file.
LDIFWriter LDIFWriter is used to write LDIF content records or LDIF change records to the OutputStream object.
RDN A RDN encapsulates a single object's name of a Distinguished Name(DN).
SAXEventMultiplexer This class forms the base for deserialization(readDSML) of the DSML Serialized classes.It pipes SAX events to LDAPXMLHandler which is implemented by each class that needs DSML serialization support.
ValueXMLhandler This class provides the implementation of the LDAPXMLHandler for the tag of DSML.
 

Package com.novell.ldap.util Description

Provides utility classes for use by LDAP applications. This package includes the DN class and RDN class supporting DN and RDN encapsulation respectively. The package also includes classes supporting the export and import of directory data via DSML v2.0 and LDIF version 1.

The import and export of directory data is accomplished by classes that implement the interfaces LDAPReader and LDAPWriter. The LDAPReader interface designates the framework used for reading modifications and entries from exported sources and applying them to the directory. The LDAPWriter interface designates the framework used for writing directory entries and modifications to a destination supporting an exported format.

LDIF supports two data types, content and change. DSML supports two corresponding data types, request and response. LDIF content represents only LDAP search response entries (i.e. the data returned from a search) and LDIF change data supports only add, delete, modify, and rename (modifyDN) LDAP requests. On the other hand, DSML represents all the LDAP requests and responses. Thus, LDIF content corresponds in a limited way to DSML response data and LDIF change data corresponds in a limited way to DSML request data. You cannot mix response data and request data.

To represent request data, additional classes have been added to the com.novell.ldap package. These classes are:

  • LDAPAbandonRequest
  • LDAPAddRequest
  • LDAPBindRequest
  • LDAPCompareRequest
  • LDAPDeleteRequest
  • LDAPExtendedRequest
  • LDAPModifyDNRequest
  • LDAPModifyRequest
  • LDAPSearchRequest
  • LDAPUnbindRequest

    Requests received from an exported source are decoded and read by calling the readMessage method of a class that implements the LDAPReader interface. This package provides three classes that implement the LDAPReader interface:

  • DOMReader
  • DSMLReader
  • LDIFReader
    The message is returned by readMessage to the application as one of the above request classes and can be applied to the directory using the sendRequest method of LDAPConnection.

    LDAP entries read from the directory as LDAPMessage objects or LDAPEntry objects are written to an export destination via the writeEntry or the writeMessage methods of classes that implement the LDAPWriter. interface. This package provides three classes that implement the LDAPWriter interface:

  • DOMWriter
  • DSMLWriter
  • LDIFWriter

    The following code snippet demonstrates reading exported request data, submitting the request to the directory, and writing the response to a destination.

                LDAPMessage inMessage, outMessage;
                inMessage = in.readMessage();  // Read first message
                while( inMessage != null ){
                    LDAPMessageQueue queue =
                        lc.sendRequest( inMessage, null, null); // Send to directory
                    while (( outMessage = queue.getResponse()) != null ) {
                        out.writeMessage( outMessage );  // Write and export
                    }
                    inMessage = in.readMessage(); // Read next message
                }
    

    There are several samples that demonstrate how to use this functionality.

  • DomDsml2Ldap.java
  • Dsml2Ldap.java
  • Ldap2Ldif.java
  • Ldif2Ldap.java

    The jldapsearch utility can display search results in DSML or LDIF format to standard output, which can be redirected to a file. The utilities are found in the bin directory of the API download.

    Package Specification

    This package is designed to work with LDAPv3 specifications.


    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