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

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

@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class AccessLogReader
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 access log.


Constructor Summary
AccessLogReader(java.io.File file)
          Creates a new access log reader that will read messages from the specified log file.
AccessLogReader(java.io.Reader reader)
          Creates a new access log reader that will read messages using the provided Reader object.
AccessLogReader(java.lang.String path)
          Creates a new access log reader that will read messages from the specified log file.
 
Method Summary
 void close()
          Closes this error log reader.
static AccessLogMessage parse(java.lang.String s)
          Parses the provided string as an access log message.
 AccessLogMessage read()
          Reads the next access 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

AccessLogReader

public AccessLogReader(java.lang.String path)
                throws java.io.IOException
Creates a new access 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.

AccessLogReader

public AccessLogReader(java.io.File file)
                throws java.io.IOException
Creates a new access 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.

AccessLogReader

public AccessLogReader(java.io.Reader reader)
Creates a new access 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 AccessLogMessage read()
                      throws java.io.IOException,
                             LogException
Reads the next access log message from the log file.

Returns:
The access 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.

parse

public static AccessLogMessage parse(java.lang.String s)
                              throws LogException
Parses the provided string as an access log message.

Parameters:
s - The string to parse as an access log message.
Returns:
The parsed access log message.
Throws:
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.