net.larsan.norna.service.log
Interface LogHandle

All Superinterfaces:
ServiceHandle

public interface LogHandle
extends ServiceHandle

The log handle is what the Norna framework publishes as log service to it's members. The logging service is guaranteed to be available by the framework.

All methods in this interface may be subject to security check using the LogPermission permission.

The norna log service has a fixed Namespace ID, "/norna/log", which is also a static identifier in this class.

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

Field Summary
static java.lang.String NAMESPACE_ID
          The fixed namespace ID, "/norna/log"
 
Method Summary
 void addFilter(Filter filter)
          Add a log filter to the handle.
 boolean checkAccess(Level level)
          Check if the handle would accept a log record based on a level.
 boolean checkAccess(Level level, Type type)
          Check if the handle would accept a log record with a level and type.
 void flush()
          Flush this log handle to make sure no log records are cached.
 void log(Record record)
          Log a record.
 void removeFilter(Filter filter)
          Remove a log filter to the handle.
 
Methods inherited from interface net.larsan.norna.base.ServiceHandle
getStatus
 

Field Detail

NAMESPACE_ID

public static final java.lang.String NAMESPACE_ID
The fixed namespace ID, "/norna/log"

See Also:
Constant Field Values
Method Detail

checkAccess

public boolean checkAccess(Level level,
                           Type type)
Check if the handle would accept a log record with a level and type. This thin check should be used as a preliminary before any log records are actually created in order to improve speed.

Parameters:
level - Log level to check
type - Log record type
Returns:
true If the handle would accept records of given type and level

checkAccess

public boolean checkAccess(Level level)
Check if the handle would accept a log record based on a level. This thin check should be used as a preliminary before any log records are actually created in order to improve speed.

Parameters:
level - Log level to check
Returns:
true If the handle would accept records of given level

log

public void log(Record record)
Log a record. This method is never guarrantied to actually commit the record to store. Only if the record is of level and types that the log implementation accepts and the record passes the log filter chain will it be recorded.

Parameters:
record - Log record, must not be null

addFilter

public void addFilter(Filter filter)
Add a log filter to the handle. The filter will be added to the bottom of the chain if this method succeed. Should the caller not have permission to add filters a security exception will be raised.

Parameters:
filter - Log filter to add to chain, must not be null

removeFilter

public void removeFilter(Filter filter)
Remove a log filter to the handle. Should the caller not have permission to remove filters a security exception will be raised.

Parameters:
filter - Log filter to remove from chain, must not be null

flush

public void flush()
Flush this log handle to make sure no log records are cached. This method should throw a security exception if the caller does not have right to change the log.