@ThreadSafety(level=NOT_THREADSAFE) public final class TextFormattedAccessLogReader extends java.lang.Object implements AccessLogReader
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 and Description |
---|
TextFormattedAccessLogReader(java.io.File logFile)
Creates a new text-formatted access log reader that will read log messages
messages from the specified file.
|
TextFormattedAccessLogReader(java.io.InputStream inputStream)
Creates a new text-formatted access log reader that will read log messages
from the provided input stream.
|
TextFormattedAccessLogReader(java.lang.String logFilePath)
Creates a new text-formatted access log reader that will read log messages
from the specified file.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this log reader.
|
static TextFormattedAccessLogMessage |
parseMessage(java.lang.String messageString)
Parses the contents of the provided string as a JSON-formatted access log
message.
|
TextFormattedAccessLogMessage |
readMessage()
Reads a log message.
|
public TextFormattedAccessLogReader(@NotNull java.lang.String logFilePath) throws java.io.IOException
logFilePath
- The path to the log file from which the access log
messages will be read. It must not be null
.java.io.IOException
- If a problem occurs while opening the specified file
for reading.public TextFormattedAccessLogReader(@NotNull java.io.File logFile) throws java.io.IOException
logFile
- The log file from which the access log messages will be
read. It must not be null
.java.io.IOException
- If a problem occurs while opening the specified file
for reading.public TextFormattedAccessLogReader(@NotNull java.io.InputStream inputStream)
inputStream
- The input stream from which the access log messages
will be read. It must not be null
.@Nullable public TextFormattedAccessLogMessage readMessage() throws java.io.IOException, LogException
readMessage
in interface AccessLogReader
readMessage
in interface LogReader
null
if the end of the
log has been reached.java.io.IOException
- If a problem occurs while attempting to read from the
log. If this exception is thrown, then it will not
be possible to continue reading from the log, and the
reader will have been closed.LogException
- If a problem occurs while attempting to parse a
message that was read from the log. If this
exception is thrown, then you may continue
attempting to read from the log.@NotNull public static TextFormattedAccessLogMessage parseMessage(@NotNull java.lang.String messageString) throws LogException
messageString
- The string to parse as an access log message. It
must not be null
.LogException
- If the provided JSON object cannot be parsed as a
valid access log message.public void close() throws java.io.IOException