com.cisco.services.tracing
Interface TraceManager

All Known Implementing Classes:
TraceManagerImpl

public interface TraceManager

The TraceManager interface defines the methods that allow applications trace management.

Typically, an application obtains only one TraceManager object. All Trace objects are created by default: Predefined Trace in accordance with Syslog definitions are:


 ContitionalTraces: INFORMATIONAL, DEBUGGING, NOTIFICATION, WARNING
 UnconditionalTraces: ERROR, CRITICAL, ALERTS, EMERGENCIES
 

Facilities/Sub-Facilities:

Facility: is a code consisting of two or more uppercase letters that indicate the facility to which the message refers. A facility can be a hardware device, a protocol, or a module of the system software

SubFacility:is a code consisting of two or more uppercase letters that indicate the sub-facility to which the message refers. A sub-facility can be a hardware device component, a protocol unit, or a sub-module of the system software

By default all 8 Conditional and UnConditional Traces are created for the Facility and 8 for each of the subFacilities In order to use the DEBUGGING trace for the parent FACILITY, for example, the application needs to use the getConditionalTrace( "DEBUGGING" ) method of this object.

In order to use the DEBUGGING trace for the SUBFACILITY, for example, the application needs to use the getConditionalTrace( SUBFACILITY + "_" + "DEBUGGING" ) method of this object or use the getConditionalTrace( SUBFACILITY , "DEBUGGING" ) method.

System wide TraceWriterManager is set through the setTraceWriterManager method provided by this interface.

The Trace Manager object also allows the application to enable or disable tracing for all trace through the enableAll() and disableAll() methods.

Version:
0.3

Method Summary
 void addSubFacilities(java.lang.String[] names)
          Sets a set of subFacilities for this TraceManager/Facility.
 void addSubFacility(java.lang.String name)
          Adds a single subFacility for this TraceManager/Facility.
 void disableAll()
          Disables tracing for all Trace objects managed by this TraceManager.
 void disableTimeStamp()
          Disables prefixing a time stamp for every message printed by this TraceManager.
 void enableAll()
          Enables tracing for all Trace objects managed by this TraceManager.
 void enableTimeStamp()
          Enables prefixing a time stamp for every message printed by this TraceManager.
 ConditionalTrace getConditionalTrace(int severity)
          Creates a new ConditionalTrace object or obtains an existing ConditionalTrace object for this condition.
 ConditionalTrace getConditionalTrace(java.lang.String subFacility, int severity)
          Creates a new ConditionalTrace object or obtains an existing ConditionalTrace object for this condition and subFacility
 java.lang.String getName()
          Returns the Facility name for this TraceManager.
 java.lang.String[] getSubFacilities()
          Returns the subFacility names for this TraceManager/Facility.
 java.util.Enumeration getTraces()
          Returns an enumeration of the Trace objects managed by this TraceManager.
 TraceWriterManager getTraceWriterManager()
          Returns the TraceWriter used by this TraceManager.
 UnconditionalTrace getUnconditionalTrace(int severity)
          Creates a new UnconditionalTrace object or obtains an existing UnconditionalTrace object for this condition.
 UnconditionalTrace getUnconditionalTrace(java.lang.String subFacility, int severity)
          Creates a new UnconditionalTrace object or obtains an existing UnconditionalTrace object for this condition and subFacility
 void removeTrace(Trace tc)
          Removes a Trace object given an object.
 void setSubFacilities(java.lang.String[] names)
          Deprecated. and replaced with TraceManager.addSubFacilities method
 void setSubFacility(java.lang.String name)
          Deprecated. and replaced with TraceManager.addSubFacility method
 void setTraceWriterManager(TraceWriterManager twm)
          Sets the TraceWriter to be used by this TraceManager.
 

Method Detail

getConditionalTrace

ConditionalTrace getConditionalTrace(int severity)
Creates a new ConditionalTrace object or obtains an existing ConditionalTrace object for this condition.


getConditionalTrace

ConditionalTrace getConditionalTrace(java.lang.String subFacility,
                                     int severity)
Creates a new ConditionalTrace object or obtains an existing ConditionalTrace object for this condition and subFacility


getUnconditionalTrace

UnconditionalTrace getUnconditionalTrace(int severity)
Creates a new UnconditionalTrace object or obtains an existing UnconditionalTrace object for this condition.


getUnconditionalTrace

UnconditionalTrace getUnconditionalTrace(java.lang.String subFacility,
                                         int severity)
Creates a new UnconditionalTrace object or obtains an existing UnconditionalTrace object for this condition and subFacility


getTraceWriterManager

TraceWriterManager getTraceWriterManager()
Returns the TraceWriter used by this TraceManager.


setTraceWriterManager

void setTraceWriterManager(TraceWriterManager twm)
Sets the TraceWriter to be used by this TraceManager.


removeTrace

void removeTrace(Trace tc)
Removes a Trace object given an object.


getTraces

java.util.Enumeration getTraces()
Returns an enumeration of the Trace objects managed by this TraceManager.


enableAll

void enableAll()
Enables tracing for all Trace objects managed by this TraceManager.


disableAll

void disableAll()
Disables tracing for all Trace objects managed by this TraceManager.


getName

java.lang.String getName()
Returns the Facility name for this TraceManager.


enableTimeStamp

void enableTimeStamp()
Enables prefixing a time stamp for every message printed by this TraceManager.


disableTimeStamp

void disableTimeStamp()
Disables prefixing a time stamp for every message printed by this TraceManager.


getSubFacilities

java.lang.String[] getSubFacilities()
Returns the subFacility names for this TraceManager/Facility.


setSubFacilities

void setSubFacilities(java.lang.String[] names)
Deprecated. and replaced with TraceManager.addSubFacilities method

Sets a set of subFacilities for this TraceManager/Facility.


addSubFacilities

void addSubFacilities(java.lang.String[] names)
Sets a set of subFacilities for this TraceManager/Facility.


setSubFacility

void setSubFacility(java.lang.String name)
Deprecated. and replaced with TraceManager.addSubFacility method

Adds a single subFacility for this TraceManager/Facility.


addSubFacility

void addSubFacility(java.lang.String name)
Adds a single subFacility for this TraceManager/Facility.