Package org.eclipse.rdf4j.sail.base
Class DelegatingSailSource
java.lang.Object
org.eclipse.rdf4j.sail.base.DelegatingSailSource
- All Implemented Interfaces:
AutoCloseable
,SailClosable
,SailSource
A wrapper around an
SailSource
that can suppress the call to close()
. This is useful when the a
shared branch is sometimes to be used and other times a dedicated branch is to be used.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDelegatingSailSource
(SailSource delegate, boolean closing) Wraps thisSailSource
, delegating all calls to it unlessclosing
is false, in which caseclose()
will not be delegated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes this resource, relinquishing any underlying resources.dataset
(IsolationLevel level) Create an observableSailDataset
of the current state of thisSailSource
.void
flush()
Apply all the changes to this branch to the backingSailSource
, if applicable.fork()
Creates a new branch of this source.void
prepare()
Check the consistency of this branch and throws aSailConflictException
ifSailSource.flush()
ing this branch would cause the backingSailSource
to be inconsistent, if applicable.sink
(IsolationLevel level) Create aSailSink
that when when itsSailSource.flush()
is called, the changes are applied to this source.toString()
-
Field Details
-
delegate
-
releasing
private final boolean releasing
-
-
Constructor Details
-
DelegatingSailSource
Wraps thisSailSource
, delegating all calls to it unlessclosing
is false, in which caseclose()
will not be delegated.- Parameters:
delegate
-closing
- ifclose()
should be delegated
-
-
Method Details
-
toString
-
close
Description copied from interface:SailClosable
Closes this resource, relinquishing any underlying resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSailClosable
- Throws:
SailException
- if this resource cannot be closed
-
fork
Description copied from interface:SailSource
Creates a new branch of this source. When it'sSailSource.flush()
is called the changes are applied to this backing source.- Specified by:
fork
in interfaceSailSource
- Returns:
- a branched
SailSource
.
-
prepare
Description copied from interface:SailSource
Check the consistency of this branch and throws aSailConflictException
ifSailSource.flush()
ing this branch would cause the backingSailSource
to be inconsistent, if applicable. If this is the final backingSailSource
calling this method has no effect.- Specified by:
prepare
in interfaceSailSource
- Throws:
SailException
-
flush
Description copied from interface:SailSource
Apply all the changes to this branch to the backingSailSource
, if applicable. If this is the final backingSailSource
calling this method has no effect.- Specified by:
flush
in interfaceSailSource
- Throws:
SailException
-
sink
Description copied from interface:SailSource
Create aSailSink
that when when itsSailSource.flush()
is called, the changes are applied to this source.- Specified by:
sink
in interfaceSailSource
- Parameters:
level
- If this level is compatible withIsolationLevels.SERIALIZABLE
then aSailSink.prepare()
can throw aSailConflictException
.- Returns:
- Newly created
SailSink
- Throws:
SailException
-
dataset
Description copied from interface:SailSource
Create an observableSailDataset
of the current state of thisSailSource
. Repeatedly calling with methods withIsolationLevels.SNAPSHOT
(or higher) isolation levels will result inSailDataset
s that are all derived from the same state of the backingSailSource
(if applicable), that is the only difference between the states of theSailDataset
will be from changes using thisSailSource.sink(IsolationLevel)
.- Specified by:
dataset
in interfaceSailSource
- Parameters:
level
- If this is compatible withIsolationLevels.SNAPSHOT_READ
the resultingSailDataset
will observe a single state of thisSailSource
.- Returns:
- an
SailDataset
of the current state - Throws:
SailException
-