org.opends.server.loggers.debug
Class TraceSettings

java.lang.Object
  extended by org.opends.server.loggers.debug.TraceSettings
All Implemented Interfaces:
ConfigurationChangeListener<DebugTargetCfg>

public class TraceSettings
extends java.lang.Object
implements ConfigurationChangeListener<DebugTargetCfg>

This class encapsulates the trace settings in effect at a given traceing scope.


Field Summary
static TraceSettings DISABLED
          A TraceSettings object representing a fully disabled trace state.
 
Constructor Summary
TraceSettings(DebugTargetCfg config)
          Construct a new trace settings from the provided configuration.
TraceSettings(LogLevel level)
          Construct new trace settings at the specified log level.
TraceSettings(LogLevel level, java.util.Set<LogCategory> includeCategories)
          Construct new trace settings at the specified log level and including the categories.
TraceSettings(LogLevel level, java.util.Set<LogCategory> includeCategories, boolean noArgs, boolean noRetVal)
          Construct new trace settings at the specified log level and including the categories.
TraceSettings(LogLevel level, java.util.Set<LogCategory> includeCategories, boolean noArgs, boolean noRetVal, int stackDepth, boolean includeCause)
          Construct new trace settings at the specified log level and including the categories.
 
Method Summary
 ConfigChangeResult applyConfigurationChange(DebugTargetCfg config)
          Applies the configuration changes to this change listener.
 boolean isConfigurationChangeAcceptable(DebugTargetCfg config, java.util.List<Message> unacceptableReasons)
          Indicates whether the proposed change to the configuration is acceptable to this change listener.
protected static TraceSettings parseTraceSettings(java.lang.String value)
          Parse trace settings from the string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISABLED

public static final TraceSettings DISABLED
A TraceSettings object representing a fully disabled trace state.

Constructor Detail

TraceSettings

public TraceSettings(LogLevel level)
Construct new trace settings at the specified log level.

Parameters:
level - the log level for this setting.

TraceSettings

public TraceSettings(LogLevel level,
                     java.util.Set<LogCategory> includeCategories)
Construct new trace settings at the specified log level and including the categories.

Parameters:
level - the log level for this setting.
includeCategories - the categories to include in this setting.

TraceSettings

public TraceSettings(LogLevel level,
                     java.util.Set<LogCategory> includeCategories,
                     boolean noArgs,
                     boolean noRetVal)
Construct new trace settings at the specified log level and including the categories. Optionally turn off arguments and return value in entry and exit messages.

Parameters:
level - the log level for this setting.
includeCategories - the categories to include in this setting.
noArgs - whether to include arguments in the log messages.
noRetVal - whether to include return values in the log messages.

TraceSettings

public TraceSettings(LogLevel level,
                     java.util.Set<LogCategory> includeCategories,
                     boolean noArgs,
                     boolean noRetVal,
                     int stackDepth,
                     boolean includeCause)
Construct new trace settings at the specified log level and including the categories. Optionally turn off arguments, return value in entry and exit messages, and specifying the depth of stack traces and whether to include the cause of exceptions.

Parameters:
level - the log level for this setting.
includeCategories - the categories to include in this setting.
noArgs - whether to include arguments in the log messages.
noRetVal - whether to include return values in the log messages.
stackDepth - the stack depth to display in log messages.
includeCause - whether to include the cause of exceptions.

TraceSettings

public TraceSettings(DebugTargetCfg config)
Construct a new trace settings from the provided configuration.

Parameters:
config - The debug target configuration that contains the information to use to initialize this trace setting.
Method Detail

isConfigurationChangeAcceptable

public boolean isConfigurationChangeAcceptable(DebugTargetCfg config,
                                               java.util.List<Message> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable to this change listener.

Specified by:
isConfigurationChangeAcceptable in interface ConfigurationChangeListener<DebugTargetCfg>
Parameters:
config - The new configuration containing the changes.
unacceptableReasons - A list that can be used to hold messages about why the provided configuration is not acceptable.
Returns:
Returns true if the proposed change is acceptable, or false if it is not.

applyConfigurationChange

public ConfigChangeResult applyConfigurationChange(DebugTargetCfg config)
Applies the configuration changes to this change listener.

Specified by:
applyConfigurationChange in interface ConfigurationChangeListener<DebugTargetCfg>
Parameters:
config - The new configuration containing the changes.
Returns:
Returns information about the result of changing the configuration.

parseTraceSettings

protected static TraceSettings parseTraceSettings(java.lang.String value)
Parse trace settings from the string representation.

Parameters:
value - the trace settings string to be parsed.
Returns:
the trace settings parsed from the string.