9.2. Reading LDIF

OpenDJ LDAP SDK provides ChangeRecordReaders to read requests to modify directory data, and EntryReaders to read entries from a data source such as a file or other source. Both of these are interfaces.

  • The ConnectionEntryReader class offers methods to iterate through entries and references returned by a search.

  • The LDIFChangeRecordReader and LDIFEntryReader classes offer methods to handle LDIF as strings or from an input stream.

    Both classes give you some methods to filter content. You can also use the LDIF static methods to filter content.

The following short excerpt shows a reader that takes LDIF change records from standard input.

InputStream ldif = System.in;
final LDIFChangeRecordReader reader = new LDIFChangeRecordReader(ldif);