Package org.forgerock.opendj.ldif
Interface EntryReader
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
ConnectionEntryReader
,EntryGenerator
,LdifEntryReader
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 TypeMethodDescriptiondefault void
close()
Closes this entry reader if it is not already closed.boolean
hasNext()
Returnstrue
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
Closes this entry reader if it is not already closed. Note that this method does not need to be called if a previous call ofreadEntry()
has returnednull
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
- If an unexpected IO error occurred while closing.
-
hasNext
Returnstrue
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
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.
-