Class LDAPResultWriter
- java.lang.Object
-
- com.unboundid.ldap.sdk.unboundidds.tools.LDAPResultWriter
-
- Direct Known Subclasses:
ColumnBasedLDAPResultWriter
,DNsOnlyLDAPResultWriter
,JSONLDAPResultWriter
,LDIFLDAPResultWriter
,ValuesOnlyLDAPResultWriter
@InternalUseOnly @NotExtensible @ThreadSafety(level=INTERFACE_NOT_THREADSAFE) public abstract class LDAPResultWriter extends java.lang.Object
This class provides an API that may be implemented by classes that format and output the results for LDAP-related tools.
NOTE: This class, and other classes within the
com.unboundid.ldap.sdk.unboundidds
package structure, are only supported for use against Ping Identity, UnboundID, and Nokia/Alcatel-Lucent 8661 server products. These classes provide support for proprietary functionality or for external specifications that are not considered stable or mature enough to be guaranteed to work in an interoperable way with other types of LDAP servers.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LDAPResultWriter(java.io.OutputStream outputStream)
Creates a new LDAP result writer that will write to the provided output stream.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
flush()
Flushes any buffered output.protected java.io.PrintStream
getPrintStream()
Retrieves the print stream that may be used to write output.protected void
print(java.lang.String string)
Writes the provided string to the associated print stream without a subsequent newline.protected void
println()
Writes a blank line to the associated print stream.protected void
println(java.lang.String string)
Writes the provided string to the associated print stream with a subsequent newline.void
updateOutputStream(java.io.OutputStream outputStream)
Updates the output stream to which output will be written.abstract void
writeComment(java.lang.String comment)
Writes the provided comment to the output.abstract void
writeHeader()
Formats and writes a header that describes the way in which the data will be formatted.abstract void
writeResult(LDAPResult result)
Formats and writes the provided LDAP result.abstract void
writeSearchResultEntry(SearchResultEntry entry)
Formats and writes the provided search result entry.abstract void
writeSearchResultReference(SearchResultReference ref)
Formats and writes the provided search result reference.abstract void
writeUnsolicitedNotification(LDAPConnection connection, ExtendedResult notification)
Formats and writes the provided unsolicited notification.
-
-
-
Constructor Detail
-
LDAPResultWriter
protected LDAPResultWriter(@NotNull java.io.OutputStream outputStream)
Creates a new LDAP result writer that will write to the provided output stream.- Parameters:
outputStream
- The output stream to which the output will be written. It must not benull
.
-
-
Method Detail
-
updateOutputStream
public final void updateOutputStream(@NotNull java.io.OutputStream outputStream)
Updates the output stream to which output will be written.- Parameters:
outputStream
- The output stream to which the output will be written. It must not benull
.
-
println
protected void println()
Writes a blank line to the associated print stream.
-
print
protected void print(@NotNull java.lang.String string)
Writes the provided string to the associated print stream without a subsequent newline.- Parameters:
string
- The string to be written. It must not benull
.
-
println
protected void println(@NotNull java.lang.String string)
Writes the provided string to the associated print stream with a subsequent newline.- Parameters:
string
- The string to be written. It must not benull
.
-
getPrintStream
@NotNull protected final java.io.PrintStream getPrintStream()
Retrieves the print stream that may be used to write output.- Returns:
- The print stream that may be used to write output.
-
flush
public final void flush()
Flushes any buffered output.
-
writeComment
public abstract void writeComment(@NotNull java.lang.String comment)
Writes the provided comment to the output.- Parameters:
comment
- The comment to be written. It must not benull
.
-
writeHeader
public abstract void writeHeader()
Formats and writes a header that describes the way in which the data will be formatted. This will be displayed at the beginning of the output (including at the beginning of each file, if output should be spread across multiple files).
-
writeSearchResultEntry
public abstract void writeSearchResultEntry(@NotNull SearchResultEntry entry)
Formats and writes the provided search result entry.- Parameters:
entry
- The search result entry to be processed.
-
writeSearchResultReference
public abstract void writeSearchResultReference(@NotNull SearchResultReference ref)
Formats and writes the provided search result reference.- Parameters:
ref
- The search result reference to be processed.
-
writeResult
public abstract void writeResult(@NotNull LDAPResult result)
Formats and writes the provided LDAP result.- Parameters:
result
- The LDAP result to be processed. It may or may not be a search result.
-
writeUnsolicitedNotification
public abstract void writeUnsolicitedNotification(@NotNull LDAPConnection connection, @NotNull ExtendedResult notification)
Formats and writes the provided unsolicited notification.- Parameters:
connection
- The connection on which the unsolicited notification was received.notification
- The unsolicited notification that was received.
-
-