Package org.forgerock.opendj.ldif
Interface EntryWriter
-
- All Superinterfaces:
AutoCloseable,Closeable,Flushable
- All Known Implementing Classes:
ConnectionEntryWriter,LdifEntryWriter
public interface EntryWriter extends Closeable, Flushable
An interface for writing entries to a data source, typically an LDIF file.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Closes this entry writer, flushing it first.voidflush()Flushes this entry writer so that any buffered data is written immediately to underlying stream, flushing the stream if it is alsoFlushable.EntryWriterwriteComment(CharSequence comment)Writes a comment.EntryWriterwriteEntry(Entry entry)Writes an entry.
-
-
-
Method Detail
-
close
void close() throws IOExceptionCloses this entry writer, flushing it first. Closing a previously closed entry 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 entry 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.
-
writeComment
EntryWriter writeComment(CharSequence comment) throws IOException
Writes a comment.- Parameters:
comment- TheCharSequenceto be written as a comment.- Returns:
- A reference to this entry writer.
- Throws:
IOException- If an unexpected IO error occurred while writing the comment.NullPointerException- Ifcommentwasnull.
-
writeEntry
EntryWriter writeEntry(Entry entry) throws IOException
Writes an entry.- Parameters:
entry- TheEntryto be written.- Returns:
- A reference to this entry writer.
- Throws:
IOException- If an unexpected IO error occurred while writing the entry.NullPointerException- Ifentrywasnull.
-
-