Class ErrorLogReader

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    @NotMutable
    @ThreadSafety(level=COMPLETELY_THREADSAFE)
    public final class ErrorLogReader
    extends java.lang.Object
    implements java.io.Closeable
    This class provides a mechanism for reading messages from a Directory Server error log.
    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 
      Constructor Description
      ErrorLogReader​(java.io.File file)
      Creates a new error log reader that will read messages from the specified log file.
      ErrorLogReader​(java.io.Reader reader)
      Creates a new error log reader that will read messages using the provided Reader object.
      ErrorLogReader​(java.lang.String path)
      Creates a new error log reader that will read messages from the specified log file.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes this error log reader.
      ErrorLogMessage read()
      Reads the next error log message from the log file.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ErrorLogReader

        public ErrorLogReader​(java.lang.String path)
                       throws java.io.IOException
        Creates a new error log reader that will read messages from the specified log file.
        Parameters:
        path - The path of the log file to read.
        Throws:
        java.io.IOException - If a problem occurs while opening the file for reading.
      • ErrorLogReader

        public ErrorLogReader​(java.io.File file)
                       throws java.io.IOException
        Creates a new error log reader that will read messages from the specified log file.
        Parameters:
        file - The log file to read.
        Throws:
        java.io.IOException - If a problem occurs while opening the file for reading.
      • ErrorLogReader

        public ErrorLogReader​(java.io.Reader reader)
        Creates a new error log reader that will read messages using the provided Reader object.
        Parameters:
        reader - The reader to use to read log messages.
    • Method Detail

      • read

        public ErrorLogMessage read()
                             throws java.io.IOException,
                                    LogException
        Reads the next error log message from the log file.
        Returns:
        The error log message read from the log file, or null if there are no more messages to be read.
        Throws:
        java.io.IOException - If an error occurs while trying to read from the file.
        LogException - If an error occurs while trying to parse the log message.
      • close

        public void close()
                   throws java.io.IOException
        Closes this error log reader.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException - If a problem occurs while closing the reader.