Package oracle.jdbc.diagnostics

## Class CommonDiagnosable

- java.lang.Object
- - oracle.jdbc.diagnostics.AbstractDiagnosable
  - - oracle.jdbc.diagnostics.CommonDiagnosable

All Implemented Interfaces:
  `Diagnosable`, `PropertyChangeListener`

    public final class CommonDiagnosable
    extends AbstractDiagnosable

This is a common diagnosable class for all those JDBC classes that are not tied to a particular connection, all such classes should use this common diagnosable for logging.

These classes should implement Diagnosable interface and override its getDiagnosable() method which should return an instance of this class. This is a singleton class which means all classes using common diagnosable share same diagnosable instance.

Below example shows how to use this Common Diagnosable for logging:

      {@code
        class XYZ implements Diagnosable {

### Field Summary

### Fields inherited from class oracle.jdbc.diagnostics.AbstractDiagnosable

`diagnostic, IS_VALID_BOOLEAN_STRING, IS_VALID_BUFFER_SIZE, IS_VALID_LOGGER_NAME`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`java.lang.String` `getDiagnosticLoggerName()`
`static Diagnosable` `getInstance()` Returns the singleton instance of common diagnosable.
`protected TraceAttributes` `getTraceAttributes()`
`boolean` `isDebugEnabled()` Returns true if debug is enabled.
`boolean` `isDiagnoseFirstFailureEnabled()` Returns true if Diagnose First Failure is enabled.
`protected boolean` `isSensitivePermitted()`
`void` `propertyChange​(PropertyChangeEvent event)` This method gets called when a MBean operation is invoked.
`void` `setDebugEnabled​(boolean enabled)`
`void` `setDiagnoseFirstFailureEnabled​(boolean enabled)`

### Methods inherited from class oracle.jdbc.diagnostics.AbstractDiagnosable

`abstractPropertyChange, begin, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debugp, enableDiagnoseFirstFailureDump, enableGlobalDebug, enableMetrics, enableWriteLogsToDiagnoseFirstFailure, end, getSystemProperty, isGlobalDebugEnabled, isLoggable, isMetricsEnabled, isSensitiveEnabled, isWriteLogsToDiagnoseFirstFailureEnabled, onClose, onConfigFileChange, resumeLogging, secure, setSensitiveEnabled, suspendLogging, trace, tracep`

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

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

### Methods inherited from interface oracle.jdbc.diagnostics.Diagnosable

`beginCurrentSql, endCurrentSql, format, getDiagnosable`

### Method Detail

#### getInstance

    public static Diagnosable getInstance()

Returns the singleton instance of common diagnosable.

Returns:
  singleton common diagnosable instance

#### setDebugEnabled

    public final void setDebugEnabled​(boolean enabled)

Specified by:
  `setDebugEnabled` in class `AbstractDiagnosable`

#### setDiagnoseFirstFailureEnabled

    public final void setDiagnoseFirstFailureEnabled​(boolean enabled)

Specified by:
  `setDiagnoseFirstFailureEnabled` in class `AbstractDiagnosable`

#### isSensitivePermitted

    protected boolean isSensitivePermitted()

Specified by:
  `isSensitivePermitted` in class `AbstractDiagnosable`

#### getDiagnosticLoggerName

    public java.lang.String getDiagnosticLoggerName()

Specified by:
  `getDiagnosticLoggerName` in class `AbstractDiagnosable`

#### getTraceAttributes

    protected TraceAttributes getTraceAttributes()

Specified by:
  `getTraceAttributes` in class `AbstractDiagnosable`

#### propertyChange

    public void propertyChange​(PropertyChangeEvent event)

Description copied from interface: `Diagnosable`
This method gets called when a MBean operation is invoked.

Parameters:
  `event` - A PropertyChangeEvent object describing the event source and the property that has changed.

#### isDebugEnabled

    public final boolean isDebugEnabled()

Description copied from interface: `Diagnosable`
Returns true if debug is enabled.

Returns:
  true if debug is enabled.

#### isDiagnoseFirstFailureEnabled

    public final boolean isDiagnoseFirstFailureEnabled()

Description copied from interface: `Diagnosable`
Returns true if Diagnose First Failure is enabled.

Returns:
  true if Diagnose First Failure is enabled.