net.larsan.norna.service.log
Interface Record


public interface Record

A log record for the log service. This record represents a mutable set of attributes. The record might be mutated or silently dropped by the framework.

A log record consists of: A optional Level (severity) and Type of the record, an textual overview, an optional Throwable triggering the record, and an optional set of string properties related to the record.

Version:
Alpha-0.2 / 2002-10-06 21:37
Author:
Lars J. Nilsson
See Also:
LogHandle

Method Summary
 java.lang.String getId()
          Get record id.
 Level getLevel()
          Get the severity level of the record.
 java.util.Properties getProperties()
          Get a set of record properties.
 java.lang.String getText()
          Get the record overview message.
 java.lang.Throwable getThrowable()
          Get the throwable that triggered this record.
 Type getType()
          Get the type of the record.
 void setId(java.lang.String id)
          Set the record.
 void setLevel(Level level)
          Set the severity level.
 void setText(java.lang.String msg)
          Set the record overview.
 void setThrowable(java.lang.Throwable error)
          Set throwable that caused the record.
 void setType(Type type)
          Set the record type.
 

Method Detail

getType

public Type getType()
Get the type of the record. This method is allowed to return null, which counts as equals to a Type.UNKNOWN.

Returns:
A Record type object, may be null

setType

public void setType(Type type)
Set the record type. This method must handle a null argument.

Parameters:
type - Record type object, may be null

getId

public java.lang.String getId()
Get record id. May return null.

Returns:
The record id

setId

public void setId(java.lang.String id)
Set the record. May be null.

Parameters:
id - Record id

getLevel

public Level getLevel()
Get the severity level of the record. If this method returns null it is up to the framework to decide which severity level to asign top the record.

Returns:
A severity level object, may be null

setLevel

public void setLevel(Level level)
Set the severity level. This method must handle a null argument.

Parameters:
level - Severity level object, may be null

getText

public java.lang.String getText()
Get the record overview message. This is equals the the message in ordinary log packages. May retur null if no overview exists.

Returns:
A text message for the record

setText

public void setText(java.lang.String msg)
Set the record overview. May be null.

Parameters:
msg - Record overview message

getThrowable

public java.lang.Throwable getThrowable()
Get the throwable that triggered this record. This record may return null if no throwable is available.

Returns:
A throwable that caused the record

setThrowable

public void setThrowable(java.lang.Throwable error)
Set throwable that caused the record. May be null.

Parameters:
error - A throwable that triggered the record

getProperties

public java.util.Properties getProperties()
Get a set of record properties. This method will never return null.

Returns:
Record properties, never null