|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openrdf.repository.base.RepositoryConnectionBase
org.openrdf.repository.base.RepositoryConnectionWrapper
org.openrdf.repository.event.base.InterceptingRepositoryConnectionWrapper
public class InterceptingRepositoryConnectionWrapper
Wrapper that notifies interceptors of events on RepositoryConnections before they happen. Any interceptor can block the operation by returning true from the relevant notification method. To do so will also cause the notification process to stop, i.e. no other interceptors will be notified. The order in which interceptors are notified is unspecified.
InterceptingRepositoryWrapper| Field Summary |
|---|
| Fields inherited from class org.openrdf.repository.base.RepositoryConnectionBase |
|---|
logger |
| Constructor Summary | |
|---|---|
InterceptingRepositoryConnectionWrapper(Repository repository,
RepositoryConnection connection)
|
|
| Method Summary | |
|---|---|
void |
addRepositoryConnectionInterceptor(RepositoryConnectionInterceptor interceptor)
Registers a RepositoryConnectionInterceptor that will receive notifications of operations that are performed on this connection. |
void |
addWithoutCommit(Resource subject,
URI predicate,
Value object,
Resource... contexts)
|
void |
clear(Resource... contexts)
Removes all statements from a specific contexts in the repository. |
void |
clearNamespaces()
Removes all namespace declarations from the repository. |
void |
close()
Closes the connection, freeing resources. |
void |
commit()
Commits all updates that have been performed as part of this connection sofar. |
protected boolean |
isDelegatingAdd()
If true then each add method will call RepositoryConnectionWrapper.addWithoutCommit(Resource, URI, Value, Resource[]). |
protected boolean |
isDelegatingRemove()
If true then each remove method will call RepositoryConnectionWrapper.removeWithoutCommit(Resource, URI, Value, Resource[]). |
void |
removeNamespace(String prefix)
Removes a namespace declaration by removing the association between a prefix and a namespace name. |
void |
removeRepositoryConnectionInterceptor(RepositoryConnectionInterceptor interceptor)
Removes a registered RepositoryConnectionInterceptor from this connection. |
void |
removeWithoutCommit(Resource subject,
URI predicate,
Value object,
Resource... contexts)
|
void |
rollback()
Rolls back all updates that have been performed as part of this connection sofar. |
void |
setAutoCommit(boolean autoCommit)
Enables or disables auto-commit mode for the connection. |
void |
setNamespace(String prefix,
String name)
Sets the prefix for a namespace. |
| Methods inherited from class org.openrdf.repository.base.RepositoryConnectionWrapper |
|---|
add, add, add, add, add, add, add, add, exportStatements, exportStatements, getContextIDs, getDelegate, getNamespace, getNamespaces, getStatements, hasStatement, hasStatement, isAutoCommit, isDelegatingRead, isEmpty, isOpen, prepareBooleanQuery, prepareGraphQuery, prepareQuery, prepareTupleQuery, remove, remove, remove, remove, setDelegate, size |
| Methods inherited from class org.openrdf.repository.base.RepositoryConnectionBase |
|---|
addInputStreamOrReader, addWithoutCommit, autoCommit, export, finalize, getRepository, prepareBooleanQuery, prepareGraphQuery, prepareQuery, prepareTupleQuery, removeWithoutCommit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.openrdf.repository.RepositoryConnection |
|---|
add, add, add, add, add, add, add, add, export, exportStatements, getContextIDs, getNamespace, getNamespaces, getRepository, getStatements, hasStatement, hasStatement, isAutoCommit, isEmpty, isOpen, prepareBooleanQuery, prepareBooleanQuery, prepareGraphQuery, prepareGraphQuery, prepareQuery, prepareQuery, prepareTupleQuery, prepareTupleQuery, remove, remove, remove, remove, size |
| Constructor Detail |
|---|
public InterceptingRepositoryConnectionWrapper(Repository repository,
RepositoryConnection connection)
| Method Detail |
|---|
public void addRepositoryConnectionInterceptor(RepositoryConnectionInterceptor interceptor)
addRepositoryConnectionInterceptor in interface InterceptingRepositoryConnectionpublic void removeRepositoryConnectionInterceptor(RepositoryConnectionInterceptor interceptor)
removeRepositoryConnectionInterceptor in interface InterceptingRepositoryConnectionprotected boolean isDelegatingAdd()
RepositoryConnectionWrapperRepositoryConnectionWrapper.addWithoutCommit(Resource, URI, Value, Resource[]).
isDelegatingAdd in class RepositoryConnectionWrapperfalseprotected boolean isDelegatingRemove()
RepositoryConnectionWrapperRepositoryConnectionWrapper.removeWithoutCommit(Resource, URI, Value, Resource[]).
isDelegatingRemove in class RepositoryConnectionWrapperfalse
public void addWithoutCommit(Resource subject,
URI predicate,
Value object,
Resource... contexts)
throws RepositoryException
addWithoutCommit in class RepositoryConnectionWrapperRepositoryException
public void clear(Resource... contexts)
throws RepositoryException
RepositoryConnection
clear in interface RepositoryConnectionclear in class RepositoryConnectionWrappercontexts - The context(s) to remove the data from. Note that this parameter is
a vararg and as such is optional. If no contexts are supplied the
method operates on the entire repository.
RepositoryException - If the statements could not be removed from the repository, for
example because the repository is not writable.
public void close()
throws RepositoryException
RepositoryConnection
close in interface RepositoryConnectionclose in class RepositoryConnectionWrapperRepositoryException - If the connection could not be closed.
public void commit()
throws RepositoryException
RepositoryConnection
commit in interface RepositoryConnectioncommit in class RepositoryConnectionWrapperRepositoryException - If the connection could not be committed.
public void removeWithoutCommit(Resource subject,
URI predicate,
Value object,
Resource... contexts)
throws RepositoryException
removeWithoutCommit in class RepositoryConnectionWrapperRepositoryException
public void removeNamespace(String prefix)
throws RepositoryException
RepositoryConnection
removeNamespace in interface RepositoryConnectionremoveNamespace in class RepositoryConnectionWrapperprefix - The namespace prefix of which the assocation with a namespace name
is to be removed.
RepositoryException - If the namespace prefix could not be removed.
public void clearNamespaces()
throws RepositoryException
RepositoryConnection
clearNamespaces in interface RepositoryConnectionclearNamespaces in class RepositoryConnectionWrapperRepositoryException - If the namespace declarations could not be removed.
public void rollback()
throws RepositoryException
RepositoryConnection
rollback in interface RepositoryConnectionrollback in class RepositoryConnectionWrapperRepositoryException - If the connection could not be rolled back.
public void setAutoCommit(boolean autoCommit)
throws RepositoryException
RepositoryConnectionRepositoryConnection.commit() or
RepositoryConnection.rollback(). By default, new connections are in auto-commit mode.
NOTE: If this connection is switched to auto-commit mode during a transaction, the transaction is committed.
setAutoCommit in interface RepositoryConnectionsetAutoCommit in class RepositoryConnectionWrapperRepositoryException - In case the mode switch failed, for example because a currently
active transaction failed to commit.RepositoryConnection.commit()
public void setNamespace(String prefix,
String name)
throws RepositoryException
RepositoryConnection
setNamespace in interface RepositoryConnectionsetNamespace in class RepositoryConnectionWrapperprefix - The new prefix.name - The namespace name that the prefix maps to.
RepositoryException - If the namespace could not be set in the repository, for example
because the repository is not writable.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||