Class LogMessage
java.lang.Object
com.unboundid.ldap.sdk.unboundidds.logs.LogMessage
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AccessLogMessage,ErrorLogMessage
@NotExtensible
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public class LogMessage
extends Object
implements Serializable
This class provides a data structure that holds information about a log
message contained in a Directory Server access or error log file.
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.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a log message from the provided log message.protectedLogMessage(String s) Parses the provided string as a log message. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringgetNamedValue(String name) Retrieves the value of the token with the specified name.final BooleangetNamedValueAsBoolean(String name) Retrieves the value of the token with the specified name as aBoolean.final DoublegetNamedValueAsDouble(String name) Retrieves the value of the token with the specified name as aDouble.final IntegergetNamedValueAsInteger(String name) Retrieves the value of the token with the specified name as anInteger.final LonggetNamedValueAsLong(String name) Retrieves the value of the token with the specified name as aLong.Retrieves the set of named tokens for this log message, mapped from the name to the corresponding value.final DateRetrieves the timestamp for this log message.Retrieves the set of unnamed tokens for this log message.final booleanhasUnnamedValue(String value) Indicates whether this log message has the specified unnamed value.final StringtoString()Retrieves a string representation of this log message.
-
Constructor Details
-
LogMessage
Creates a log message from the provided log message.- Parameters:
m- The log message to use to create this log message.
-
LogMessage
Parses the provided string as a log message.- Parameters:
s- The string to be parsed as a log message.- Throws:
LogException- If the provided string cannot be parsed as a valid log message.
-
-
Method Details
-
getTimestamp
Retrieves the timestamp for this log message.- Returns:
- The timestamp for this log message.
-
getNamedValues
Retrieves the set of named tokens for this log message, mapped from the name to the corresponding value.- Returns:
- The set of named tokens for this log message.
-
getNamedValue
Retrieves the value of the token with the specified name.- Parameters:
name- The name of the token to retrieve.- Returns:
- The value of the token with the specified name, or
nullif there is no value with the specified name.
-
getNamedValueAsBoolean
Retrieves the value of the token with the specified name as aBoolean.- Parameters:
name- The name of the token to retrieve.- Returns:
- The value of the token with the specified name as a
Boolean, ornullif there is no value with the specified name or the value cannot be parsed as aBoolean.
-
getNamedValueAsDouble
Retrieves the value of the token with the specified name as aDouble.- Parameters:
name- The name of the token to retrieve.- Returns:
- The value of the token with the specified name as a
Double, ornullif there is no value with the specified name or the value cannot be parsed as aDouble.
-
getNamedValueAsInteger
Retrieves the value of the token with the specified name as anInteger.- Parameters:
name- The name of the token to retrieve.- Returns:
- The value of the token with the specified name as an
Integer, ornullif there is no value with the specified name or the value cannot be parsed as anInteger.
-
getNamedValueAsLong
Retrieves the value of the token with the specified name as aLong.- Parameters:
name- The name of the token to retrieve.- Returns:
- The value of the token with the specified name as a
Long, ornullif there is no value with the specified name or the value cannot be parsed as aLong.
-
getUnnamedValues
Retrieves the set of unnamed tokens for this log message.- Returns:
- The set of unnamed tokens for this log message.
-
hasUnnamedValue
Indicates whether this log message has the specified unnamed value.- Parameters:
value- The value for which to make the determination.- Returns:
trueif this log message has the specified unnamed value, orfalseif not.
-
toString
Retrieves a string representation of this log message.
-