Interface EntryReader

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
ConnectionEntryReader, EntryGenerator, LdifEntryReader

public interface EntryReader extends Closeable
An interface for reading entries from a data source, typically an LDIF file.

Implementations must specify the following:

  • Whether it is possible for the implementation to encounter malformed change records and, if it is possible, how they are handled.
  • Any synchronization limitations.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Closes this entry reader if it is not already closed.
    boolean
    Returns true if this reader contains another entry, blocking if necessary until either the next entry is available or the end of the stream is reached.
    Reads the next entry, blocking if necessary until an entry is available.
  • Method Details

    • close

      default void close() throws IOException
      Closes this entry reader if it is not already closed. Note that this method does not need to be called if a previous call of readEntry() has returned null.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException - If an unexpected IO error occurred while closing.
    • hasNext

      boolean hasNext() throws IOException
      Returns true if this reader contains another entry, blocking if necessary until either the next entry is available or the end of the stream is reached.
      Returns:
      true if this reader contains another entry.
      Throws:
      IOException - If an unexpected IO error occurred.
    • readEntry

      Entry readEntry() throws IOException
      Reads the next entry, blocking if necessary until an entry is available.
      Returns:
      The next entry.
      Throws:
      IOException - If an unexpected IO error occurred while reading the entry.
      NoSuchElementException - If this reader does not contain any more entries.