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 void
close()
Closes this change record writer, flushing it first.void
flush()
Flushes this change record writer so that any buffered data is written immediately to underlying stream, flushing the stream if it is alsoFlushable
.ChangeRecordWriter
writeChangeRecord(AddRequest change)
Writes anAdd
change record.ChangeRecordWriter
writeChangeRecord(DeleteRequest change)
Writes aDelete
change record.ChangeRecordWriter
writeChangeRecord(ModifyDnRequest change)
Writes aModifyDN
change record.ChangeRecordWriter
writeChangeRecord(ModifyRequest change)
Writes aModify
change record.ChangeRecordWriter
writeChangeRecord(ChangeRecord change)
Writes a change record.ChangeRecordWriter
writeComment(CharSequence comment)
Writes a comment.
-
-
-
Method Detail
-
close
void close() throws IOException
Closes this change record writer, flushing it first. Closing a previously closed change record writer has no effect.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
- If an unexpected IO error occurred while closing.
-
flush
void flush() throws IOException
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:
flush
in interfaceFlushable
- Throws:
IOException
- If an unexpected IO error occurred while flushing.
-
writeChangeRecord
ChangeRecordWriter writeChangeRecord(AddRequest change) throws IOException
Writes anAdd
change record.- Parameters:
change
- TheAddRequest
to be written as anAdd
change record.- Returns:
- A reference to this change record writer.
- Throws:
IOException
- If an unexpected IO error occurred while writing the change record.NullPointerException
- Ifchange
wasnull
.
-
writeChangeRecord
ChangeRecordWriter writeChangeRecord(ChangeRecord change) throws IOException
Writes a change record.- Parameters:
change
- TheChangeRecord
to be written.- Returns:
- A reference to this change record writer.
- Throws:
IOException
- If an unexpected IO error occurred while writing the change record.NullPointerException
- Ifchange
wasnull
.
-
writeChangeRecord
ChangeRecordWriter writeChangeRecord(DeleteRequest change) throws IOException
Writes aDelete
change record.- Parameters:
change
- TheDeleteRequest
to be written as anDelete
change record.- Returns:
- A reference to this change record writer.
- Throws:
IOException
- If an unexpected IO error occurred while writing the change record.NullPointerException
- Ifchange
wasnull
.
-
writeChangeRecord
ChangeRecordWriter writeChangeRecord(ModifyDnRequest change) throws IOException
Writes aModifyDN
change record.- Parameters:
change
- TheModifyDNRequest
to be written as anModifyDN
change record.- Returns:
- A reference to this change record writer.
- Throws:
IOException
- If an unexpected IO error occurred while writing the change record.NullPointerException
- Ifchange
wasnull
.
-
writeChangeRecord
ChangeRecordWriter writeChangeRecord(ModifyRequest change) throws IOException
Writes aModify
change record.- Parameters:
change
- TheModifyRequest
to be written as anModify
change record.- Returns:
- A reference to this change record writer.
- Throws:
IOException
- If an unexpected IO error occurred while writing the change record.NullPointerException
- Ifchange
wasnull
.
-
writeComment
ChangeRecordWriter writeComment(CharSequence comment) throws IOException
Writes a comment.- Parameters:
comment
- TheCharSequence
to 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
- Ifcomment
wasnull
.
-
-