public final class ConnectionChangeRecordWriter extends Object implements ChangeRecordWriter
ConnectionChangeRecordWriter is a bridge from Connections
to ChangeRecordWriters. A connection change record writer writes
change records by sending appropriate update requests (Add, Delete, Modify,
or ModifyDN) to an underlying connection.
All update requests are performed synchronously, blocking until an update
result is received. If an update result indicates that an update 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 |
|---|
ConnectionChangeRecordWriter(Connection connection)
Creates a new connection change record writer whose destination is the
provided connection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this connection change record writer, including the underlying
connection.
|
void |
flush()
Connection change record writers do not require flushing, so this method
has no effect.
|
ConnectionChangeRecordWriter |
writeChangeRecord(AddRequest change)
Writes the provided Add request to the underlying connection, blocking
until the request completes.
|
ConnectionChangeRecordWriter |
writeChangeRecord(ChangeRecord change)
Writes the provided change record to the underlying connection, blocking
until the request completes.
|
ConnectionChangeRecordWriter |
writeChangeRecord(DeleteRequest change)
Writes the provided Delete request to the underlying connection, blocking
until the request completes.
|
ConnectionChangeRecordWriter |
writeChangeRecord(ModifyDNRequest change)
Writes the provided ModifyDN request to the underlying connection,
blocking until the request completes.
|
ConnectionChangeRecordWriter |
writeChangeRecord(ModifyRequest change)
Writes the provided Modify request to the underlying connection, blocking
until the request completes.
|
ConnectionChangeRecordWriter |
writeComment(CharSequence comment)
Connection change record writers do not support comments, so the provided
comment will be ignored.
|
public ConnectionChangeRecordWriter(Connection connection)
connection - The connection to use.NullPointerException - If connection was null.public void close()
close in interface Closeableclose in interface AutoCloseableclose in interface ChangeRecordWriterpublic void flush()
flush in interface Flushableflush in interface ChangeRecordWriterpublic ConnectionChangeRecordWriter writeChangeRecord(AddRequest change) throws LdapException
writeChangeRecord in interface ChangeRecordWriterchange - The AddRequest to be written.LdapException - If the result code indicates that the request failed for some
reason.NullPointerException - If change was null.public ConnectionChangeRecordWriter writeChangeRecord(ChangeRecord change) throws LdapException
writeChangeRecord in interface ChangeRecordWriterchange - The change record to be written.LdapException - If the result code indicates that the request failed for some
reason.NullPointerException - If change was null.public ConnectionChangeRecordWriter writeChangeRecord(DeleteRequest change) throws LdapException
writeChangeRecord in interface ChangeRecordWriterchange - The DeleteRequest to be written.LdapException - If the result code indicates that the request failed for some
reason.NullPointerException - If change was null.public ConnectionChangeRecordWriter writeChangeRecord(ModifyDNRequest change) throws LdapException
writeChangeRecord in interface ChangeRecordWriterchange - The ModifyDNRequest to be written.LdapException - If the result code indicates that the request failed for some
reason.NullPointerException - If change was null.public ConnectionChangeRecordWriter writeChangeRecord(ModifyRequest change) throws LdapException
writeChangeRecord in interface ChangeRecordWriterchange - The ModifyRequest to be written.LdapException - If the result code indicates that the request failed for some
reason.NullPointerException - If change was null.public ConnectionChangeRecordWriter writeComment(CharSequence comment)
writeComment in interface ChangeRecordWritercomment - The CharSequence to be written as a comment.NullPointerException - If comment was null.Copyright © 2011-2015 ForgeRock AS. All Rights Reserved.