Package org.forgerock.opendj.ldif
Class ConnectionChangeRecordWriter
java.lang.Object
org.forgerock.opendj.ldif.ConnectionChangeRecordWriter
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,ChangeRecordWriter
A
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 Summary
ConstructorsConstructorDescriptionConnectionChangeRecordWriter(Connection connection) Creates a new connection change record writer whose destination is the provided connection. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this connection change record writer, including the underlying connection.voidflush()Connection change record writers do not require flushing, so this method has no effect.writeChangeRecord(AddRequest change) Writes the provided Add request to the underlying connection, blocking until the request completes.writeChangeRecord(DeleteRequest change) Writes the provided Delete request to the underlying connection, blocking until the request completes.writeChangeRecord(ModifyDNRequest change) Writes the provided ModifyDN request to the underlying connection, blocking until the request completes.writeChangeRecord(ModifyRequest change) Writes the provided Modify request to the underlying connection, blocking until the request completes.writeChangeRecord(ChangeRecord change) Writes the provided change record to the underlying connection, blocking until the request completes.writeComment(CharSequence comment) Connection change record writers do not support comments, so the provided comment will be ignored.
-
Constructor Details
-
ConnectionChangeRecordWriter
Creates a new connection change record writer whose destination is the provided connection.- Parameters:
connection- The connection to use.- Throws:
NullPointerException- Ifconnectionwasnull.
-
-
Method Details
-
close
Closes this connection change record writer, including the underlying connection. Closing a previously closed change record writer has no effect.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChangeRecordWriter- Specified by:
closein interfaceCloseable
-
flush
Connection change record writers do not require flushing, so this method has no effect.- Specified by:
flushin interfaceChangeRecordWriter- Specified by:
flushin interfaceFlushable
-
writeChangeRecord
Writes the provided Add request to the underlying connection, blocking until the request completes.- Specified by:
writeChangeRecordin interfaceChangeRecordWriter- Parameters:
change- TheAddRequestto be written.- Returns:
- A reference to this connection change record writer.
- Throws:
LdapException- If the result code indicates that the request failed for some reason.NullPointerException- Ifchangewasnull.
-
writeChangeRecord
Writes the provided change record to the underlying connection, blocking until the request completes.- Specified by:
writeChangeRecordin interfaceChangeRecordWriter- Parameters:
change- The change record to be written.- Returns:
- A reference to this connection change record writer.
- Throws:
LdapException- If the result code indicates that the request failed for some reason.NullPointerException- Ifchangewasnull.
-
writeChangeRecord
Writes the provided Delete request to the underlying connection, blocking until the request completes.- Specified by:
writeChangeRecordin interfaceChangeRecordWriter- Parameters:
change- TheDeleteRequestto be written.- Returns:
- A reference to this connection change record writer.
- Throws:
LdapException- If the result code indicates that the request failed for some reason.NullPointerException- Ifchangewasnull.
-
writeChangeRecord
Writes the provided ModifyDN request to the underlying connection, blocking until the request completes.- Specified by:
writeChangeRecordin interfaceChangeRecordWriter- Parameters:
change- TheModifyDNRequestto be written.- Returns:
- A reference to this connection change record writer.
- Throws:
LdapException- If the result code indicates that the request failed for some reason.NullPointerException- Ifchangewasnull.
-
writeChangeRecord
Writes the provided Modify request to the underlying connection, blocking until the request completes.- Specified by:
writeChangeRecordin interfaceChangeRecordWriter- Parameters:
change- TheModifyRequestto be written.- Returns:
- A reference to this connection change record writer.
- Throws:
LdapException- If the result code indicates that the request failed for some reason.NullPointerException- Ifchangewasnull.
-
writeComment
Connection change record writers do not support comments, so the provided comment will be ignored.- Specified by:
writeCommentin interfaceChangeRecordWriter- Parameters:
comment- TheCharSequenceto be written as a comment.- Returns:
- A reference to this connection change record writer.
- Throws:
NullPointerException- Ifcommentwasnull.
-