com.unboundid.ldap.sdk.unboundidds.logs
Class ErrorLogReader

java.lang.Object
  extended by com.unboundid.ldap.sdk.unboundidds.logs.ErrorLogReader

@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class ErrorLogReader
extends java.lang.Object

NOTE: This class is part of the Commercial Edition of the UnboundID LDAP SDK for Java. It is not available for use in applications that include only the Standard Edition of the LDAP SDK, and is not supported for use in conjunction with non-UnboundID products.
This class provides a mechanism for reading message from a Directory Server error log.


Constructor Summary
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
 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.

Throws:
java.io.IOException - If a problem occurs while closing the reader.