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 void
close()
Closes this entry writer, flushing it first.void
flush()
Flushes this entry writer so that any buffered data is written immediately to underlying stream, flushing the stream if it is alsoFlushable
.EntryWriter
writeComment(CharSequence comment)
Writes a comment.EntryWriter
writeEntry(Entry entry)
Writes an entry.
-
-
-
Method Detail
-
close
void close() throws IOException
Closes this entry writer, flushing it first. Closing a previously closed entry 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 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:
flush
in interfaceFlushable
- Throws:
IOException
- If an unexpected IO error occurred while flushing.
-
writeComment
EntryWriter writeComment(CharSequence comment) throws IOException
Writes a comment.- Parameters:
comment
- TheCharSequence
to 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
- Ifcomment
wasnull
.
-
writeEntry
EntryWriter writeEntry(Entry entry) throws IOException
Writes an entry.- Parameters:
entry
- TheEntry
to be written.- Returns:
- A reference to this entry writer.
- Throws:
IOException
- If an unexpected IO error occurred while writing the entry.NullPointerException
- Ifentry
wasnull
.
-
-