Package org.forgerock.opendj.ldif
Interface ChangeRecordReader
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
LDIFChangeRecordReader
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
Modifier and TypeMethodDescriptionvoidclose()Closes this change record reader if it not already closed.booleanhasNext()Returnstrueif 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.Reads the next change record, blocking if necessary until a change record is available.
-
Method Details
-
close
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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- If an unexpected IO error occurred while closing.
-
hasNext
Returnstrueif 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:
trueif this reader contains another change record.- Throws:
IOException- If an unexpected IO error occurred.
-
readChangeRecord
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 anAddchange 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.
-