Package org.forgerock.opendj.ldif
Interface ChangeRecordWriter
- All Superinterfaces:
AutoCloseable,Closeable,Flushable
- All Known Implementing Classes:
ConnectionChangeRecordWriter,LDIFChangeRecordWriter
An interface for writing change records to a data source, typically an LDIF
file.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this change record writer, flushing it first.voidflush()Flushes this change record writer so that any buffered data is written immediately to underlying stream, flushing the stream if it is alsoFlushable.writeChangeRecord(AddRequest change) Writes anAddchange record.writeChangeRecord(DeleteRequest change) Writes aDeletechange record.writeChangeRecord(ModifyDNRequest change) Writes aModifyDNchange record.writeChangeRecord(ModifyRequest change) Writes aModifychange record.writeChangeRecord(ChangeRecord change) Writes a change record.writeComment(CharSequence comment) Writes a comment.
-
Method Details
-
close
Closes this change record writer, flushing it first. Closing a previously closed change record writer has no effect.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- If an unexpected IO error occurred while closing.
-
flush
Flushes this change record writer so that any buffered data is written immediately to underlying stream, flushing the stream if it is alsoFlushable.If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
- Specified by:
flushin interfaceFlushable- Throws:
IOException- If an unexpected IO error occurred while flushing.
-
writeChangeRecord
Writes anAddchange record.- Parameters:
change- TheAddRequestto be written as anAddchange record.- Returns:
- A reference to this change record writer.
- Throws:
IOException- If an unexpected IO error occurred while writing the change record.NullPointerException- Ifchangewasnull.
-
writeChangeRecord
Writes a change record.- Parameters:
change- TheChangeRecordto be written.- Returns:
- A reference to this change record writer.
- Throws:
IOException- If an unexpected IO error occurred while writing the change record.NullPointerException- Ifchangewasnull.
-
writeChangeRecord
Writes aDeletechange record.- Parameters:
change- TheDeleteRequestto be written as anDeletechange record.- Returns:
- A reference to this change record writer.
- Throws:
IOException- If an unexpected IO error occurred while writing the change record.NullPointerException- Ifchangewasnull.
-
writeChangeRecord
Writes aModifyDNchange record.- Parameters:
change- TheModifyDNRequestto be written as anModifyDNchange record.- Returns:
- A reference to this change record writer.
- Throws:
IOException- If an unexpected IO error occurred while writing the change record.NullPointerException- Ifchangewasnull.
-
writeChangeRecord
Writes aModifychange record.- Parameters:
change- TheModifyRequestto be written as anModifychange record.- Returns:
- A reference to this change record writer.
- Throws:
IOException- If an unexpected IO error occurred while writing the change record.NullPointerException- Ifchangewasnull.
-
writeComment
Writes a comment.- Parameters:
comment- TheCharSequenceto be written as a comment.- Returns:
- A reference to this change record writer.
- Throws:
IOException- If an unexpected IO error occurred while writing the comment.NullPointerException- Ifcommentwasnull.
-