Package org.forgerock.opendj.ldif
Interface ChangeRecordReader
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
LdifChangeRecordReader
public interface ChangeRecordReader extends Closeable
An interface for reading change records 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 Modifier and Type Method Description void
close()
Closes this change record reader if it not already closed.boolean
hasNext()
Returnstrue
if this reader contains another change record, blocking if necessary until either the next change record is available or the end of the stream is reached.ChangeRecord
readChangeRecord()
Reads the next change record, blocking if necessary until a change record is available.
-
-
-
Method Detail
-
close
void close() throws IOException
Closes this change record reader if it not already closed. Note that this method does not need to be called if a previous call ofreadChangeRecord()
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 change record, blocking if necessary until either the next change record is available or the end of the stream is reached.- Returns:
true
if this reader contains another change record.- Throws:
IOException
- If an unexpected IO error occurred.
-
readChangeRecord
ChangeRecord readChangeRecord() throws IOException
Reads the next change record, blocking if necessary until a change record is available. If the next change record does not contain a change type then it will be treated as anAdd
change record.- Returns:
- The next change record.
- Throws:
IOException
- If an unexpected IO error occurred while reading the change record.NoSuchElementException
- If this reader does not contain any more change records.
-
-