public final class ConnectionEntryWriter extends Object implements EntryWriter
ConnectionEntryWriter is a bridge from Connections to
EntryWriters. A connection entry writer writes entries by sending Add
requests to an underlying connection.
All Add requests are performed synchronously, blocking until an Add result is
received. If an Add result indicates that an Add request has failed for some
reason then the error result is propagated to the caller using an
LdapException.
Note: comments are not supported by connection change record writers. Attempts to write comments will be ignored.
| Constructor and Description |
|---|
ConnectionEntryWriter(Connection connection)
Creates a new connection entry writer whose destination is the provided
connection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this connection entry writer, including the underlying connection.
|
void |
flush()
Connection entry writers do not require flushing, so this method has no
effect.
|
ConnectionEntryWriter |
writeComment(CharSequence comment)
Connection entry writers do not support comments, so the provided comment
will be ignored.
|
ConnectionEntryWriter |
writeEntry(Entry entry)
Writes an entry to the underlying connection using an Add request,
blocking until the request completes.
|
public ConnectionEntryWriter(Connection connection)
connection - The connection to use.NullPointerException - If connection was null.public void close()
close in interface Closeableclose in interface AutoCloseableclose in interface EntryWriterpublic void flush()
flush in interface Flushableflush in interface EntryWriterpublic ConnectionEntryWriter writeComment(CharSequence comment)
writeComment in interface EntryWritercomment - The CharSequence to be written as a comment.NullPointerException - If comment was null.public ConnectionEntryWriter writeEntry(Entry entry) throws LdapException
writeEntry in interface EntryWriterentry - The Entry to be written.LdapException - If the result code indicates that the request failed for some
reason.NullPointerException - If entry was null.Copyright © 2011-2015 ForgeRock AS. All Rights Reserved.