Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.novell.nds.dirxml.shimhost
Class FileTraceImpl

    java.lang.Object
      com.novell.nds.dirxml.shimhost.FileTraceImpl

All Implemented Interfaces:
  TraceInterface

    public class FileTraceImpl

extends Object

An implementation of `com.novell.nds.dirxml.driver.TraceInterface` that can be registered with the `com.novell.nds.dirxml.driver.Trace` class.

Trace messages are output to a file specified via the `setFile()` method.

See Also:
  `Trace.registerImpl(java.lang.Class, double)`

Field Summary
`protected static String` | `DEFAULT_TIME_FORMAT` Default timestamp formatting string to use: "[MM/dd/yy HH:mm:ss.SS]: "
`protected static LocalizedMessageSource` | `messageSource` Source of localized message strings
`protected static PrintStream` | `printStream`
`protected static String` | `TAB` String used for indenting XML documents
`protected static SimpleDateFormat` | `timeFormat` Time formatter for timestamps.
`protected static String` | `timeFormatString` Time format string for timestamps.
`protected static String` | `TRACE_TIMEFORMAT`
`protected static int` | `traceLevel`

Constructor Summary
`FileTraceImpl()` Construct an instance.

Method Summary
`int` | `getLevel()` Return the current trace level.
`static void` | `setFile(File file)` Set the file to use for this class.
`static void` | `setFile(String filename)` Set the file name to use for this class.
`static void` | `setLevel(int newLevel)` Set the trace level for this class.
`protected static String` | `timeStampMessage(String message)` Prepend a timestamp to a String and return the result.
`void` | `trace(int level, String message)` Output a message string if the passed level is greater than or equal to the current trace level.
`void` | `trace(int level, XmlDocument document)` Serialize and output XML document if passed level is greater than or equal to the current trace level.
`protected void` | `traceAlways(Document document)` Output an XML `Document` regardless of level
`protected void` | `traceAlways(String message)` Output a message regardless of level.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### printStream

    protected static PrintStream printStream

### traceLevel

    protected static int traceLevel

### TAB

    protected static final String TAB

  String used for indenting XML documents

  See Also:
    Constant Field Values

### messageSource

    protected static LocalizedMessageSource messageSource

  Source of localized message strings

### timeFormatString

    protected static String timeFormatString

  Time format string for timestamps.

### timeFormat

    protected static SimpleDateFormat timeFormat

  Time formatter for timestamps.

### DEFAULT_TIME_FORMAT

    protected static final String DEFAULT_TIME_FORMAT

  Default timestamp formatting string to use: "[MM/dd/yy HH:mm:ss.SS]: "

  See Also:
    Constant Field Values

### TRACE_TIMEFORMAT

    protected static final String TRACE_TIMEFORMAT

See Also:
  Constant Field Values

Constructor Detail

### FileTraceImpl

    public FileTraceImpl()

  Construct an instance. This is designed to be called by the `com.novell.nds.dirxml.driver.Trace` class.

  See Also:
    `Trace.registerImpl(java.lang.Class, double)`

Method Detail

### setFile

    public static void setFile(File file)
                        throws IOException

  Set the file to use for this class. This must be performed before the `com.novell.nds.dirxml.driver.Trace` class creates an instance of this class.

  Parameters:
    `file` - `File` to receive trace information
  Throws:
    `IOException` - if an error occurs opening the file

### setFile

    public static void setFile(String filename)
                        throws IOException

  Set the file name to use for this class. This must be performed before the `com.novell.nds.dirxml.driver.Trace` class creates an instance of this class.

  Parameters:
    `filename` - name of file to receive trace information
  Throws:
    `IOException` - if an error occurs opening the file

### getLevel

    public int getLevel()

  Return the current trace level.

  Returns:
    current trace level.

### setLevel

    public static void setLevel(int newLevel)

  Set the trace level for this class.

  Parameters:
    `newLevel` - new trace level

### trace

    public void trace(int level,
                      String message)

  Output a message string if the passed level is greater than or equal to the current trace level.

  Specified by:
    `trace` in interface `TraceInterface`
  Parameters:
    `level` - trace level for message.
    `message` - `String` to output.

### trace

    public void trace(int level,
                      XmlDocument document)

  Serialize and output XML document if passed level is greater than or equal to the current trace level.

  Specified by:
    `trace` in interface `TraceInterface`
  Parameters:
    `level` - trace level for document.
    `document` - The XML document to output

### traceAlways

    protected void traceAlways(String message)

  Output a message regardless of level.

  Parameters:
    `message` - `String` to output

### traceAlways

    protected void traceAlways(Document document)

  Output an XML `Document` regardless of level

  Parameters:
    `document` - XML `Document`

### timeStampMessage

    protected static String timeStampMessage(String message)

  Prepend a timestamp to a String and return the result.

  Parameters:
    `message` - String to which to prepend timestamp.
  Returns:
    timestamped String.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD