Class NotifyingSailConnectionWrapper
java.lang.Object
org.eclipse.rdf4j.sail.helpers.SailConnectionWrapper
org.eclipse.rdf4j.sail.helpers.NotifyingSailConnectionWrapper
- All Implemented Interfaces:
AutoCloseable, FederatedServiceResolverClient, ThreadSafetyAware, NotifyingSailConnection, SailConnection
- Direct Known Subclasses:
InferencerConnectionWrapper, LuceneSailConnection, ShaclSailConnection
public class NotifyingSailConnectionWrapper
extends SailConnectionWrapper
implements NotifyingSailConnection
An implementation of the
NotifyingSailConnection interface that wraps another
NotifyingSailConnection object and forwards any method calls to the wrapped
transaction.- Author:
- Jeen Broekstra
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newNotifyingSailConnectionWrapperobject that wraps the supplied connection. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConnectionListener(SailConnectionListener listener) Adds the given listener to the wrapped connection.Gets the connection that is wrapped by this object.voidRemoves the given listener from the wrapped connection.Methods inherited from class SailConnectionWrapper
addStatement, addStatement, begin, begin, clear, clearNamespaces, close, commit, endUpdate, evaluate, explain, flush, getComparator, getContextIDs, getFederatedServiceResolver, getNamespace, getNamespaces, getStatements, getStatements, getSupportedOrders, hasStatement, isActive, isOpen, prepare, prepareQuery, removeNamespace, removeStatement, removeStatements, rollback, setFederatedServiceResolver, setNamespace, setTransactionSettings, size, size, startUpdate, supportsConcurrentReadsModifier and TypeMethodDescriptionvoidaddStatement(Resource subj, IRI pred, Value obj, Resource... contexts) Adds a statement to the store.voidaddStatement(UpdateContext modify, Resource subj, IRI pred, Value obj, Resource... contexts) Adds a statement to the store.voidbegin()Begins a transaction requiringSailConnection.commit()orSailConnection.rollback()to be called to close the transaction.voidbegin(IsolationLevel level) Begins a transaction with the specifiedIsolationLevellevel, requiringSailConnection.commit()orSailConnection.rollback()to be called to close the transaction.voidRemoves all statements from the specified/all contexts.voidRemoves all namespace declarations from the repository.voidclose()Closes the connection.voidcommit()Commits any updates that have been performed since the last timeSailConnection.commit()orSailConnection.rollback()was called.voidendUpdate(UpdateContext modify) Indicates that the givenopwill not be used in any call again.CloseableIteration<? extends BindingSet> evaluate(TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred) Evaluates the supplied TupleExpr on the data contained in this Sail object, using the (optional) dataset and supplied bindings as input parameters.explain(Explanation.Level level, TupleExpr tupleExpr, Dataset dataset, BindingSet bindings, boolean includeInferred, int timeoutSeconds) Explain how the TupleExpr will be (or has been) executed/evaluated by returning a TupleExpr (which may or may not be the provided TupleExpr) that has gone through zero or more of the stages prior to and also including execution as specified by the provided level.voidflush()Flushes any pending updates and notify changes to listeners as appropriate.Different underlying datastructures may have different ways of ordering statements.CloseableIteration<? extends Resource> Returns the set of all unique context identifiers that are used to store statements.Gets theFederatedServiceResolverused by this client.getNamespace(String prefix) Gets the namespace that is associated with the specified prefix, if any.CloseableIteration<? extends Namespace> Gets the namespaces relevant to the data contained in this Sail object.CloseableIteration<? extends Statement> getStatements(StatementOrder statementOrder, Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) Gets all statements from the specified contexts that have a specific subject, predicate and/or object.CloseableIteration<? extends Statement> getStatements(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) Gets all statements from the specified contexts that have a specific subject, predicate and/or object.getSupportedOrders(Resource subj, IRI pred, Value obj, Resource... contexts) The underlying store may support some, but not all, statement orders based on the statement pattern.booleanhasStatement(Resource subj, IRI pred, Value obj, boolean includeInferred, Resource... contexts) Determines if the store contains any statements from the specified contexts that have a specific subject, predicate and/or object.booleanisActive()Indicates if a transaction is currently active on the connection.booleanisOpen()Checks whether this SailConnection is open.voidprepare()Checks for an error state in the active transaction that would force the transaction to be rolled back.prepareQuery(QueryLanguage ql, Query.QueryType type, String query, String baseURI) Allows the SailConnection to bypass the standard query parser and provide its own internalTupleExprimplementation.voidremoveNamespace(String prefix) Removes a namespace declaration by removing the association between a prefix and a namespace name.voidremoveStatement(UpdateContext modify, Resource subj, IRI pred, Value obj, Resource... contexts) Removes all statements matching the specified subject, predicate and object from the repository.voidremoveStatements(Resource subj, IRI pred, Value obj, Resource... contexts) Removes all statements matching the specified subject, predicate and object from the repository.voidrollback()Rolls back the transaction, discarding any uncommitted changes that have been made in this SailConnection.voidSets theFederatedServiceResolverto use for this client.voidsetNamespace(String prefix, String name) Sets the prefix for a namespace.voidsetTransactionSettings(TransactionSetting... settings) Pass any transaction-specific settings to the SailConnection.longlongReturns the number of (explicit) statements in the store, or in specific contexts.voidstartUpdate(UpdateContext modify) Signals the start of an update operation.booleanA class may support concurrent reads from multiple threads against the same object.
-
Constructor Details
-
NotifyingSailConnectionWrapper
Creates a newNotifyingSailConnectionWrapperobject that wraps the supplied connection.
-
-
Method Details
-
getWrappedConnection
Description copied from class:SailConnectionWrapperGets the connection that is wrapped by this object.- Overrides:
getWrappedConnectionin classSailConnectionWrapper- Returns:
- The SailConnection object that was supplied to the constructor of this class.
-
addConnectionListener
Adds the given listener to the wrapped connection.- Specified by:
addConnectionListenerin interfaceNotifyingSailConnection- Parameters:
listener- A SailConnectionListener.
-
removeConnectionListener
Removes the given listener from the wrapped connection.- Specified by:
removeConnectionListenerin interfaceNotifyingSailConnection- Parameters:
listener- A SailConnectionListener.
-