org.eclipse.rdf4j.repository.event.util

## Class DebugRepositoryConnectionListener

- java.lang.Object
- - org.eclipse.rdf4j.repository.event.util.DebugRepositoryConnectionListener

- All Implemented Interfaces:
    RepositoryConnectionListener

      public class DebugRepositoryConnectionListener
      extends Object
      implements RepositoryConnectionListener

  Utility class that prints all events to a PrintStream (default: System.err), optionally with a stacktrace.

  System.err is chosen as default because Thread.dumpStack() also prints to System.err. Consequently, println's and stacktraces remain properly aligned. When printing to System.out instead, environments such as Eclipse's Console may mess up the order of println's and stacktraces, probably due to the use of separate line buffers below the surface that get flushed to the UI at different times.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DebugRepositoryConnectionListener()`
    `DebugRepositoryConnectionListener(PrintStream stream)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(RepositoryConnection conn, Resource subject, IRI predicate, Value object, Resource... contexts)`
    `void` | `begin(RepositoryConnection conn)`
    `void` | `clear(RepositoryConnection conn, Resource... contexts)`
    `void` | `clearNamespaces(RepositoryConnection conn)`
    `void` | `close(RepositoryConnection conn)`
    `void` | `commit(RepositoryConnection conn)`
    `void` | `execute(RepositoryConnection conn, QueryLanguage ql, String update, String baseURI, Update operation)`
    `protected String` | `getConnectionID(RepositoryConnection conn)`
    `PrintStream` | `getStream()`
    `boolean` | `isDumpingStack()`
    `boolean` | `isPrinting()`
    `void` | `remove(RepositoryConnection conn, Resource subject, IRI predicate, Value object, Resource... contexts)`
    `void` | `removeNamespace(RepositoryConnection conn, String prefix)`
    `void` | `rollback(RepositoryConnection conn)`
    `void` | `setAutoCommit(RepositoryConnection conn, boolean autoCommit)` Deprecated.
    `void` | `setDumpingStack(boolean dumpingStack)`
    `void` | `setNamespace(RepositoryConnection conn, String prefix, String name)`
    `void` | `setPrinting(boolean printing)`
    `void` | `setStream(PrintStream stream)`

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

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

- - ### Constructor Detail

    - #### DebugRepositoryConnectionListener

          public DebugRepositoryConnectionListener()

    - #### DebugRepositoryConnectionListener

          public DebugRepositoryConnectionListener(PrintStream stream)

  - ### Method Detail

    - #### isPrinting

          public boolean isPrinting()

    - #### setPrinting

          public void setPrinting(boolean printing)

    - #### getStream

          public PrintStream getStream()

    - #### setStream

          public void setStream(PrintStream stream)

    - #### isDumpingStack

          public boolean isDumpingStack()

    - #### setDumpingStack

          public void setDumpingStack(boolean dumpingStack)

    - #### close

          public void close(RepositoryConnection conn)

      Specified by:
        `close` in interface `RepositoryConnectionListener`

    - #### setAutoCommit

          @Deprecated
          public void setAutoCommit(RepositoryConnection conn,
                                                boolean autoCommit)

      Deprecated.
      Specified by:
        `setAutoCommit` in interface `RepositoryConnectionListener`

    - #### commit

          public void commit(RepositoryConnection conn)

      Specified by:
        `commit` in interface `RepositoryConnectionListener`

    - #### rollback

          public void rollback(RepositoryConnection conn)

      Specified by:
        `rollback` in interface `RepositoryConnectionListener`

    - #### add

          public void add(RepositoryConnection conn,
                          Resource subject,
                          IRI predicate,
                          Value object,
                          Resource... contexts)

      Specified by:
        `add` in interface `RepositoryConnectionListener`

    - #### remove

          public void remove(RepositoryConnection conn,
                             Resource subject,
                             IRI predicate,
                             Value object,
                             Resource... contexts)

      Specified by:
        `remove` in interface `RepositoryConnectionListener`

    - #### clear

          public void clear(RepositoryConnection conn,
                            Resource... contexts)

      Specified by:
        `clear` in interface `RepositoryConnectionListener`

    - #### setNamespace

          public void setNamespace(RepositoryConnection conn,
                                   String prefix,
                                   String name)

      Specified by:
        `setNamespace` in interface `RepositoryConnectionListener`

    - #### removeNamespace

          public void removeNamespace(RepositoryConnection conn,
                                      String prefix)

      Specified by:
        `removeNamespace` in interface `RepositoryConnectionListener`

    - #### clearNamespaces

          public void clearNamespaces(RepositoryConnection conn)

      Specified by:
        `clearNamespaces` in interface `RepositoryConnectionListener`

    - #### getConnectionID

          protected String getConnectionID(RepositoryConnection conn)

    - #### execute

          public void execute(RepositoryConnection conn,
                              QueryLanguage ql,
                              String update,
                              String baseURI,
                              Update operation)

      Specified by:
        `execute` in interface `RepositoryConnectionListener`

    - #### begin

          public void begin(RepositoryConnection conn)

      Specified by:
        `begin` in interface `RepositoryConnectionListener`

Copyright © 2015-2021 Eclipse Foundation. All Rights Reserved.