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 voidclose()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.ChangeRecordreadChangeRecord()Reads the next change record, blocking if necessary until a change record is available.
-
-
-
Method Detail
-
close
void close() throws IOExceptionCloses 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
boolean hasNext() throws IOExceptionReturnstrueif 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
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 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.
-
-