Class AccessLogReader
java.lang.Object
com.unboundid.ldap.sdk.unboundidds.logs.AccessLogReader
- All Implemented Interfaces:
Closeable,AutoCloseable
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class AccessLogReader
extends Object
implements Closeable
This class provides a mechanism for reading messages from a Directory Server
access 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
ConstructorsConstructorDescriptionAccessLogReader(File file) Creates a new access log reader that will read messages from the specified log file.AccessLogReader(Reader reader) Creates a new access log reader that will read messages using the providedReaderobject.AccessLogReader(String path) Creates a new access log reader that will read messages from the specified log file. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes this error log reader.static AccessLogMessageParses the provided string as an access log message.read()Reads the next access log message from the log file.
-
Constructor Details
-
AccessLogReader
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:
IOException- If a problem occurs while opening the file for reading.
-
AccessLogReader
Creates a new access log reader that will read messages from the specified log file.- Parameters:
file- The log file to read.- Throws:
IOException- If a problem occurs while opening the file for reading.
-
AccessLogReader
Creates a new access log reader that will read messages using the providedReaderobject.- Parameters:
reader- The reader to use to read log messages.
-
-
Method Details
-
read
Reads the next access log message from the log file.- Returns:
- The access log message read from the log file, or
nullif there are no more messages to be read. - Throws:
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
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
Closes this error log reader.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- If a problem occurs while closing the reader.
-