Class LdifReader

All Implemented Interfaces:
ResourceAwareItemReaderItemStream<org.springframework.ldap.core.LdapAttributes>, ItemReader<org.springframework.ldap.core.LdapAttributes>, ItemStream, ItemStreamReader<org.springframework.ldap.core.LdapAttributes>, org.springframework.beans.factory.InitializingBean

public class LdifReader extends AbstractItemCountingItemStreamItemReader<org.springframework.ldap.core.LdapAttributes> implements ResourceAwareItemReaderItemStream<org.springframework.ldap.core.LdapAttributes>, org.springframework.beans.factory.InitializingBean
The LdifReader is an adaptation of the FlatFileItemReader built around an LdifParser.

Unlike the FlatFileItemReader, the LdifReader does not require a mapper. Instead, this version of the LdifReader simply returns an LdapAttributes object which can be consumed and manipulated as necessary by ItemProcessor or any output service. Alternatively, the RecordMapper interface can be implemented and set in a MappingLdifReader to map records to objects for return.

LdifReader usage is mimics that of the FlatFileItemReader for all intensive purposes. Adjustments have been made to process records instead of lines, however. As such, the recordsToSkip attribute indicates the number of records from the top of the file that should not be processed. Implementations of the RecordCallbackHandler interface can be used to execute operations on those skipped records.

As with the FlatFileItemReader, the strict option differentiates between whether or not to require the resource to exist before processing. In the case of a value set to false, a warning is logged instead of an exception being thrown.

Author:
Keith Barlow
  • Constructor Details

    • LdifReader

      public LdifReader()
  • Method Details