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
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
begin
(RepositoryConnection conn) void
clear
(RepositoryConnection conn, Resource... contexts) void
void
close
(RepositoryConnection conn) void
commit
(RepositoryConnection conn) void
execute
(RepositoryConnection conn, QueryLanguage ql, String update, String baseURI, Update operation) protected String
boolean
boolean
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)
-
Constructor Details
-
DebugRepositoryConnectionListener
public DebugRepositoryConnectionListener() -
DebugRepositoryConnectionListener
-
-
Method Details
-
isPrinting
public boolean isPrinting() -
setPrinting
public void setPrinting(boolean printing) -
getStream
-
setStream
-
isDumpingStack
public boolean isDumpingStack() -
setDumpingStack
public void setDumpingStack(boolean dumpingStack) -
close
- Specified by:
close
in interfaceRepositoryConnectionListener
-
setAutoCommit
Deprecated.- Specified by:
setAutoCommit
in interfaceRepositoryConnectionListener
- Parameters:
conn
-autoCommit
-
-
commit
- Specified by:
commit
in interfaceRepositoryConnectionListener
-
rollback
- Specified by:
rollback
in interfaceRepositoryConnectionListener
-
add
public void add(RepositoryConnection conn, Resource subject, IRI predicate, Value object, Resource... contexts) - Specified by:
add
in interfaceRepositoryConnectionListener
-
remove
public void remove(RepositoryConnection conn, Resource subject, IRI predicate, Value object, Resource... contexts) - Specified by:
remove
in interfaceRepositoryConnectionListener
-
clear
- Specified by:
clear
in interfaceRepositoryConnectionListener
-
setNamespace
- Specified by:
setNamespace
in interfaceRepositoryConnectionListener
-
removeNamespace
- Specified by:
removeNamespace
in interfaceRepositoryConnectionListener
-
clearNamespaces
- Specified by:
clearNamespaces
in interfaceRepositoryConnectionListener
-
getConnectionID
-
execute
public void execute(RepositoryConnection conn, QueryLanguage ql, String update, String baseURI, Update operation) - Specified by:
execute
in interfaceRepositoryConnectionListener
-
begin
- Specified by:
begin
in interfaceRepositoryConnectionListener
-