Package org.forgerock.opendj.ldif
Interface ChangeRecordWriter
-
- All Superinterfaces:
AutoCloseable,Closeable,Flushable
- All Known Implementing Classes:
ConnectionChangeRecordWriter,LDIFChangeRecordWriter
public interface ChangeRecordWriter extends Closeable, Flushable
An interface for writing change records to a data source, typically an LDIF file.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()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.ChangeRecordWriterwriteChangeRecord(AddRequest change)Writes anAddchange record.ChangeRecordWriterwriteChangeRecord(DeleteRequest change)Writes aDeletechange record.ChangeRecordWriterwriteChangeRecord(ModifyDNRequest change)Writes aModifyDNchange record.ChangeRecordWriterwriteChangeRecord(ModifyRequest change)Writes aModifychange record.ChangeRecordWriterwriteChangeRecord(ChangeRecord change)Writes a change record.ChangeRecordWriterwriteComment(CharSequence comment)Writes a comment.
-
-
-
Method Detail
-
close
void close() throws IOExceptionCloses 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
void flush() throws IOExceptionFlushes 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
ChangeRecordWriter writeChangeRecord(AddRequest change) throws IOException
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
ChangeRecordWriter writeChangeRecord(ChangeRecord change) throws IOException
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
ChangeRecordWriter writeChangeRecord(DeleteRequest change) throws IOException
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
ChangeRecordWriter writeChangeRecord(ModifyDNRequest change) throws IOException
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
ChangeRecordWriter writeChangeRecord(ModifyRequest change) throws IOException
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
ChangeRecordWriter writeComment(CharSequence comment) throws IOException
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.
-
-