Module org.firebirdsql.jaybird
Package org.firebirdsql.management

# Class FBTraceManager

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

All Implemented Interfaces:
  `AttachmentProperties`, `BaseProperties`, `ServiceConnectionProperties`, `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
Description
`FBTraceManager()`
Create a new instance of `FBTraceManager` based on the default GDSType.
`FBTraceManager(String gdsType)`
Create a new instance of `FBTraceManager` based on a given GDSType.
`FBTraceManager(GDSType gdsType)`
Create a new instance of `FBTraceManager` based on a given GDSType.

## Method Summary

Modifier and Type
Method
Description
`Integer`
`getSessionId(String sessionName)`
Gets the sessionId for the given name.
`void`
`listTraceSessions()`
List all currently registered trace sessions
`void`
`resumeTraceSession(int traceSessionId)`
Resumes a trace session with the given trace session ID
`void`
`startTraceSession(String traceSessionName, 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, connectionPropertyValues, createRequestBuffer, executeServicesOperation, getAuthPlugins, getBooleanProperty, getCharSet, getDatabase, getDbCryptConfig, getExpectedDb, getHost, getIntProperty, getLogger, getPassword, getPort, getPortNumber, getProperty, getServerName, getServerVersion, getServiceName, getUser, getWireCrypt, getWireCryptAsEnum, isWireCompression, queueService, setAuthPlugins, setBooleanProperty, setCharSet, setDatabase, setDbCryptConfig, setExpectedDb, setHost, setIntProperty, setLogger, setPassword, setPort, setPortNumber, setProperty, setServerName, setServiceName, setType, setUser, setWireCompression, setWireCryptAsEnum`

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

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

### Methods inherited from interface org.firebirdsql.jaybird.props.AttachmentProperties

`getAuthPlugins, getCharSet, getConnectTimeout, getDbCryptConfig, getEnableProtocol, getEncoding, getParallelWorkers, getPassword, getPortNumber, getProcessId, getProcessName, getRoleName, getServerName, getSocketBufferSize, getSocketFactory, getSoTimeout, getType, getUser, getWireCrypt, isWireCompression, setAuthPlugins, setCharSet, setConnectTimeout, setDbCryptConfig, setEnableProtocol, setEncoding, setParallelWorkers, setPassword, setPortNumber, setProcessId, setProcessName, setRoleName, setServerName, setSocketBufferSize, setSocketFactory, setSoTimeout, setType, setUser, setWireCompression, setWireCrypt`

### Methods inherited from interface org.firebirdsql.jaybird.props.BaseProperties

`connectionPropertyValues, getBooleanProperty, getBooleanProperty, getIntProperty, getIntProperty, getProperty, getProperty, setBooleanProperty, setIntProperty, setProperty`

### Methods inherited from interface org.firebirdsql.jaybird.props.ServiceConnectionProperties

`getExpectedDb, getServiceName, setExpectedDb, setServiceName`

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

`getDatabase, getHost, getLogger, getPort, getServerVersion, getWireCryptAsEnum, setDatabase, setHost, setLogger, setPort, setWireCryptAsEnum`

## Constructor Details

### FBTraceManager

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

### FBTraceManager

public FBTraceManager(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 Details

### startTraceSession

public void startTraceSession(String traceSessionName, String configuration) throws 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:
  `SQLException`

### stopTraceSession

public void stopTraceSession(int traceSessionId) throws SQLException
Stops a trace session with the given trace session ID

Specified by:
  `stopTraceSession` in interface `TraceManager`
Parameters:
  `traceSessionId` - The trace session ID
Throws:
  `SQLException`

### suspendTraceSession

public void suspendTraceSession(int traceSessionId) throws SQLException
Suspends a trace session with the given trace session ID

Specified by:
  `suspendTraceSession` in interface `TraceManager`
Parameters:
  `traceSessionId` - The trace session ID
Throws:
  `SQLException`

### resumeTraceSession

public void resumeTraceSession(int traceSessionId) throws SQLException
Resumes a trace session with the given trace session ID

Specified by:
  `resumeTraceSession` in interface `TraceManager`
Parameters:
  `traceSessionId` - The trace session ID
Throws:
  `SQLException`

### listTraceSessions

public void listTraceSessions() throws SQLException
List all currently registered trace sessions

Specified by:
  `listTraceSessions` in interface `TraceManager`
Throws:
  `SQLException`

### getSessionId

public Integer getSessionId(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