Package org.opends.server.types
Class AdditionalLogItem
- java.lang.Object
-
- org.opends.server.types.AdditionalLogItem
-
public final class AdditionalLogItem extends Object
An additional log item for an operation which may be processed in the access log.Log items comprise of a source class, a key, and an optional value. If no value is present then only the key will be displayed in the log, otherwise both the key and value will usually be displayed using the format
key=value. Log item values areObjectinstances whose string representation will be derived using the object'stoString()method.Log implementations may use the source class and/or key in order to filter out unwanted log items.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetKey()Returns the log item key.Class<?>getSource()Returns the class which generated the additional log item.ObjectgetValue()Returns the log item value, ornullif this log item does not have a value.static AdditionalLogItemkeyOnly(Class<?> source, String key)Creates a new additional log item using the provided source and key and a value equal to the booleantrue.static AdditionalLogItemkeyValue(Class<?> source, String key, long value)Creates a new additional log item using the provided source, key, and value.static AdditionalLogItemkeyValue(Class<?> source, String key, CharSequence value)Creates a new additional log item using the provided source, key, and value.StringtoString()StringBuildertoString(StringBuilder builder)Appends the string representation of this additional log item to the provided string builder.
-
-
-
Method Detail
-
keyOnly
public static AdditionalLogItem keyOnly(Class<?> source, String key)
Creates a new additional log item using the provided source and key and a value equal to the booleantrue.- Parameters:
source- The class which generated the additional log item.key- The log item key.- Returns:
- The new additional log item.
-
keyValue
public static AdditionalLogItem keyValue(Class<?> source, String key, CharSequence value)
Creates a new additional log item using the provided source, key, and value. The value will be surrounded by quotes when serialized as a string.- Parameters:
source- The class which generated the additional log item.key- The log item key.value- The not-nulllog item value that will be converted to a String. Null is not accepted because it cannot be distinguished from "not present" using mining tools- Returns:
- The new additional log item.
-
keyValue
public static AdditionalLogItem keyValue(Class<?> source, String key, long value)
Creates a new additional log item using the provided source, key, and value. The value will not be surrounded by quotes when serialized as a string.- Parameters:
source- The class which generated the additional log item.key- The log item key.value- The log item value.- Returns:
- The new additional log item.
-
getKey
public String getKey()
Returns the log item key.- Returns:
- The log item key.
-
getSource
public Class<?> getSource()
Returns the class which generated the additional log item.- Returns:
- The class which generated the additional log item.
-
getValue
public Object getValue()
Returns the log item value, ornullif this log item does not have a value.
-
toString
public StringBuilder toString(StringBuilder builder)
Appends the string representation of this additional log item to the provided string builder.- Parameters:
builder- The string builder- Returns:
- A reference to the updated string builder.
-
-