public final class ConnectionEntryWriter extends Object implements EntryWriter
ConnectionEntryWriter
is a bridge from Connection
s to
EntryWriter
s. 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 Closeable
close
in interface AutoCloseable
close
in interface EntryWriter
public void flush()
flush
in interface Flushable
flush
in interface EntryWriter
public ConnectionEntryWriter writeComment(CharSequence comment)
writeComment
in interface EntryWriter
comment
- The CharSequence
to be written as a comment.NullPointerException
- If comment
was null
.public ConnectionEntryWriter writeEntry(Entry entry) throws LdapException
writeEntry
in interface EntryWriter
entry
- The Entry
to be written.LdapException
- If the result code indicates that the request failed for some
reason.NullPointerException
- If entry
was null
.Copyright 2010-2022 ForgeRock AS.