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

java.lang.Object
  extended by com.unboundid.ldap.sdk.unboundidds.logs.LogMessage
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AccessLogMessage, ErrorLogMessage

@NotExtensible
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public class LogMessage
extends java.lang.Object
implements java.io.Serializable

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 data structure that holds information about a log message contained in a Directory Server access or error log file.

See Also:
Serialized Form

Constructor Summary
protected LogMessage(LogMessage m)
          Creates a log message from the provided log message.
protected LogMessage(java.lang.String s)
          Parses the provided string as a log message.
 
Method Summary
 java.lang.String getNamedValue(java.lang.String name)
          Retrieves the value of the token with the specified name.
 java.lang.Boolean getNamedValueAsBoolean(java.lang.String name)
          Retrieves the value of the token with the specified name as a Boolean.
 java.lang.Double getNamedValueAsDouble(java.lang.String name)
          Retrieves the value of the token with the specified name as a Double.
 java.lang.Integer getNamedValueAsInteger(java.lang.String name)
          Retrieves the value of the token with the specified name as an Integer.
 java.lang.Long getNamedValueAsLong(java.lang.String name)
          Retrieves the value of the token with the specified name as a Long.
 java.util.Map<java.lang.String,java.lang.String> getNamedValues()
          Retrieves the set of named tokens for this log message, mapped from the name to the corresponding value.
 java.util.Date getTimestamp()
          Retrieves the timestamp for this log message.
 java.util.Set<java.lang.String> getUnnamedValues()
          Retrieves the set of unnamed tokens for this log message.
 boolean hasUnnamedValue(java.lang.String value)
          Indicates whether this log message has the specified unnamed value.
 java.lang.String toString()
          Retrieves a string representation of this log message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogMessage

protected LogMessage(LogMessage m)
Creates a log message from the provided log message.

Parameters:
m - The log message to use to create this log message.

LogMessage

protected LogMessage(java.lang.String s)
              throws LogException
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 Detail

getTimestamp

public final java.util.Date getTimestamp()
Retrieves the timestamp for this log message.

Returns:
The timestamp for this log message.

getNamedValues

public final java.util.Map<java.lang.String,java.lang.String> 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

public final java.lang.String getNamedValue(java.lang.String name)
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 null if there is no value with the specified name.

getNamedValueAsBoolean

public final java.lang.Boolean getNamedValueAsBoolean(java.lang.String name)
Retrieves the value of the token with the specified name as a Boolean.

Parameters:
name - The name of the token to retrieve.
Returns:
The value of the token with the specified name as a Boolean, or null if there is no value with the specified name or the value cannot be parsed as a Boolean.

getNamedValueAsDouble

public final java.lang.Double getNamedValueAsDouble(java.lang.String name)
Retrieves the value of the token with the specified name as a Double.

Parameters:
name - The name of the token to retrieve.
Returns:
The value of the token with the specified name as a Double, or null if there is no value with the specified name or the value cannot be parsed as a Double.

getNamedValueAsInteger

public final java.lang.Integer getNamedValueAsInteger(java.lang.String name)
Retrieves the value of the token with the specified name as an Integer.

Parameters:
name - The name of the token to retrieve.
Returns:
The value of the token with the specified name as an Integer, or null if there is no value with the specified name or the value cannot be parsed as an Integer.

getNamedValueAsLong

public final java.lang.Long getNamedValueAsLong(java.lang.String name)
Retrieves the value of the token with the specified name as a Long.

Parameters:
name - The name of the token to retrieve.
Returns:
The value of the token with the specified name as a Long, or null if there is no value with the specified name or the value cannot be parsed as a Long.

getUnnamedValues

public final java.util.Set<java.lang.String> getUnnamedValues()
Retrieves the set of unnamed tokens for this log message.

Returns:
The set of unnamed tokens for this log message.

hasUnnamedValue

public final boolean hasUnnamedValue(java.lang.String value)
Indicates whether this log message has the specified unnamed value.

Parameters:
value - The value for which to make the determination.
Returns:
true if this log message has the specified unnamed value, or false if not.

toString

public final java.lang.String toString()
Retrieves a string representation of this log message.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this log message.