org.firebirdsql.management

## Class FBTraceManager

- java.lang.Object
- - org.firebirdsql.management.FBServiceManager
  - - org.firebirdsql.management.FBTraceManager

- All Implemented Interfaces:
    ServiceManager, TraceManager

      public class FBTraceManager
      extends FBServiceManager
      implements TraceManager

  Implements the Trace/Audit API available new in Firebird 2.5
  Author:
    Thomas Steinmaurer

- - ### Field Summary

    - ### Fields inherited from class org.firebirdsql.management.FBServiceManager

      `BUFFER_SIZE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FBTraceManager()` Create a new instance of `FBTraceManager` based on the default GDSType.
    `FBTraceManager(GDSType gdsType)` Create a new instance of `FBTraceManager` based on a given GDSType.
    `FBTraceManager(java.lang.String gdsType)` Create a new instance of `FBTraceManager` based on a given GDSType.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Integer` | `getSessionId(java.lang.String sessionName)` Gets the sessionId for the given name.
    `void` | `listTraceSessions()` List all currently registered trace sessions
    `java.lang.String` | `loadConfigurationFromFile(java.lang.String fileName)` Deprecated.
    `void` | `resumeTraceSession(int traceSessionId)` Resumes a trace session with the given trace session ID
    `void` | `startTraceSession(java.lang.String traceSessionName, java.lang.String configuration)` Starts a trace session with an optional trace session name and configuration
    `void` | `stopTraceSession(int traceSessionId)` Stops a trace session with the given trace session ID
    `void` | `suspendTraceSession(int traceSessionId)` Suspends a trace session with the given trace session ID

    - ### Methods inherited from class org.firebirdsql.management.FBServiceManager

      `attachDatabase, attachServiceManager, createRequestBuffer, executeServicesOperation, executeServicesOperation, getCharSet, getDatabase, getDbCryptConfig, getHost, getLogger, getPassword, getPort, getServerVersion, getServiceName, getUser, getWireCrypt, queueService, setCharSet, setDatabase, setDbCryptConfig, setHost, setLogger, setPassword, setPort, setUser, setWireCrypt`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.firebirdsql.management.ServiceManager

      `getCharSet, getDatabase, getDbCryptConfig, getHost, getLogger, getPassword, getPort, getServerVersion, getUser, getWireCrypt, setCharSet, setDatabase, setDbCryptConfig, setHost, setLogger, setPassword, setPort, setUser, setWireCrypt`

- - ### Constructor Detail

    - #### FBTraceManager

          public FBTraceManager()

      Create a new instance of `FBTraceManager` based on the default GDSType.

    - #### FBTraceManager

          public FBTraceManager(java.lang.String gdsType)

      Create a new instance of `FBTraceManager` based on a given GDSType.
      Parameters:
        `gdsType` - type must be PURE_JAVA, EMBEDDED, or NATIVE

    - #### FBTraceManager

          public FBTraceManager(GDSType gdsType)

      Create a new instance of `FBTraceManager` based on a given GDSType.
      Parameters:
        `gdsType` - type must be PURE_JAVA, EMBEDDED, or NATIVE

  - ### Method Detail

    - #### startTraceSession

          public void startTraceSession(java.lang.String traceSessionName,
                               java.lang.String configuration)
                                 throws java.sql.SQLException

      Starts a trace session with an optional trace session name and configuration
      Specified by:
        `startTraceSession` in interface `TraceManager`
      Parameters:
        `traceSessionName` - The trace session name (optional)
        `configuration` - The trace configuration. For an example, look into fbtrace.conf in the root directory of your Firebird installation
      Throws:
        `java.sql.SQLException`

    - #### stopTraceSession

          public void stopTraceSession(int traceSessionId)
                                throws java.sql.SQLException

      Stops a trace session with the given trace session ID
      Specified by:
        `stopTraceSession` in interface `TraceManager`
      Parameters:
        `traceSessionId` - The trace session ID
      Throws:
        `java.sql.SQLException`

    - #### suspendTraceSession

          public void suspendTraceSession(int traceSessionId)
                                   throws java.sql.SQLException

      Suspends a trace session with the given trace session ID
      Specified by:
        `suspendTraceSession` in interface `TraceManager`
      Parameters:
        `traceSessionId` - The trace session ID
      Throws:
        `java.sql.SQLException`

    - #### resumeTraceSession

          public void resumeTraceSession(int traceSessionId)
                                  throws java.sql.SQLException

      Resumes a trace session with the given trace session ID
      Specified by:
        `resumeTraceSession` in interface `TraceManager`
      Parameters:
        `traceSessionId` - The trace session ID
      Throws:
        `java.sql.SQLException`

    - #### listTraceSessions

          public void listTraceSessions()
                                 throws java.sql.SQLException

      List all currently registered trace sessions
      Specified by:
        `listTraceSessions` in interface `TraceManager`
      Throws:
        `java.sql.SQLException`

    - #### getSessionId

          public java.lang.Integer getSessionId(java.lang.String sessionName)

      Gets the sessionId for the given name.

      Returns null if the sessionName does not exist or hasn't been initialized yet.

      If multiple sessions are started with the same name, the last one is returned.

      Specified by:
        `getSessionId` in interface `TraceManager`
      Parameters:
        `sessionName` - Name of the session
      Returns:
        Id of the session or null otherwise

    - #### loadConfigurationFromFile

          @Deprecated
          public java.lang.String loadConfigurationFromFile(java.lang.String fileName)
                                                     throws java.io.IOException

      Deprecated.
      Description copied from interface: `TraceManager`
      Loads a configuration from the specified fileName using the default character set.
      Specified by:
        `loadConfigurationFromFile` in interface `TraceManager`
      Parameters:
        `fileName` - File name
      Throws:
        `java.io.IOException`

Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.