|
||||||||||
| 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.NotifyingRepositoryConnectionWrapper
public class NotifyingRepositoryConnectionWrapper
This broadcaster is used by the RepositoryBroadcaster to wrap the delegate
repository connection. There are two types of listeners for the repository
connection, RepositoryConnectionStateListener and
RepositoryConnectionListener. Listeners are notified of changes
after they have occurred.
| Field Summary |
|---|
| Fields inherited from class org.openrdf.repository.base.RepositoryConnectionBase |
|---|
logger |
| Constructor Summary | |
|---|---|
NotifyingRepositoryConnectionWrapper(Repository repository,
RepositoryConnection connection)
|
|
NotifyingRepositoryConnectionWrapper(Repository repository,
RepositoryConnection connection,
boolean reportDeltas)
|
|
| Method Summary | |
|---|---|
void |
addRepositoryConnectionListener(RepositoryConnectionListener listener)
Registers a RepositoryConnectionListener 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 |
removeRepositoryConnectionListener(RepositoryConnectionListener listener)
Removes a registered RepositoryConnectionListener from this connection. |
void |
removeWithoutCommit(Resource subj,
URI pred,
Value obj,
Resource... ctx)
|
boolean |
reportDeltas()
|
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. |
void |
setReportDeltas(boolean reportDeltas)
|
| 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 NotifyingRepositoryConnectionWrapper(Repository repository,
RepositoryConnection connection)
public NotifyingRepositoryConnectionWrapper(Repository repository,
RepositoryConnection connection,
boolean reportDeltas)
| Method Detail |
|---|
public boolean reportDeltas()
public void setReportDeltas(boolean reportDeltas)
public void addRepositoryConnectionListener(RepositoryConnectionListener listener)
addRepositoryConnectionListener in interface NotifyingRepositoryConnectionpublic void removeRepositoryConnectionListener(RepositoryConnectionListener listener)
removeRepositoryConnectionListener in interface NotifyingRepositoryConnectionprotected 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 subj,
URI pred,
Value obj,
Resource... ctx)
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 | |||||||||