public final class ConnectionChangeRecordWriter extends Object implements ChangeRecordWriter
ConnectionChangeRecordWriter
is a bridge from Connection
s
to ChangeRecordWriter
s. 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 Closeable
close
in interface AutoCloseable
close
in interface ChangeRecordWriter
public void flush()
flush
in interface Flushable
flush
in interface ChangeRecordWriter
public ConnectionChangeRecordWriter writeChangeRecord(AddRequest change) throws LdapException
writeChangeRecord
in interface ChangeRecordWriter
change
- 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 ChangeRecordWriter
change
- 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 ChangeRecordWriter
change
- 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 ChangeRecordWriter
change
- 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 ChangeRecordWriter
change
- 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 ChangeRecordWriter
comment
- The CharSequence
to be written as a comment.NullPointerException
- If comment
was null
.Copyright © 2010-2018, ForgeRock All Rights Reserved.