Package org.forgerock.opendj.ldif
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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default 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.Entry
readEntry()
Reads the next entry, blocking if necessary until an entry is available.
-
-
-
Method Detail
-
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 ofreadEntry()
has returnednull
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
- If an unexpected IO error occurred while closing.
-
hasNext
boolean hasNext() throws IOException
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
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.
-
-