Class LDAPResultWriter

java.lang.Object
com.unboundid.ldap.sdk.unboundidds.tools.LDAPResultWriter
Direct Known Subclasses:
ColumnBasedLDAPResultWriter, DNsOnlyLDAPResultWriter, JSONLDAPResultWriter, LDIFLDAPResultWriter, ValuesOnlyLDAPResultWriter

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 Details

    • LDAPResultWriter

      protected LDAPResultWriter(@NotNull 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 be null.
  • Method Details

    • updateOutputStream

      public final void updateOutputStream(@NotNull 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 be null.
    • println

      protected void println()
      Writes a blank line to the associated print stream.
    • print

      protected void print(@NotNull 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 be null.
    • println

      protected void println(@NotNull 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 be null.
    • getPrintStream

      @NotNull protected final 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 String comment)
      Writes the provided comment to the output.
      Parameters:
      comment - The comment to be written. It must not be null.
    • 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

      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.