Interface Connector
- All Known Implementing Classes:
BasicStorageConnector
public interface Connector
Storage connector interface.
This interface declares the methods accessible from the driver.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyChanges
(List<TransactionalChange> changes) Applies the specified changes to the underlying ontology.void
closeSnapshot
(OntologySnapshot snapshot) Closes the specified transactional snapshot.<R> R
executeRead
(Function<OntologySnapshot, R> function) Executes read-only operation on the live ontology.void
executeWrite
(Consumer<OntologySnapshot> function) Executes a write operation on the live ontology.Gets snapshot of the underlying ontology.Gets logical URI of the ontology loaded by this connector.
-
Method Details
-
getOntologyUri
URI getOntologyUri()Gets logical URI of the ontology loaded by this connector.- Returns:
- Ontology URI
-
getOntologySnapshot
OntologySnapshot getOntologySnapshot()Gets snapshot of the underlying ontology.The snapshot is completely independent of the live ontology, so any changes to either are not visible to the other.
- Returns:
- Value object with the ontology snapshot
-
executeRead
Executes read-only operation on the live ontology.- Type Parameters:
R
- Result type- Parameters:
function
- The function to execute- Returns:
- Read result
-
executeWrite
Executes a write operation on the live ontology.- Parameters:
function
- The function to execute
-
applyChanges
Applies the specified changes to the underlying ontology.Note that this operation is atomic - the changes are applied as a whole and no other operation can be performed on the underlying ontology while the changes are being applied.
- Parameters:
changes
- The changes to apply
-
closeSnapshot
Closes the specified transactional snapshot.This in particular means destroying the transactional ontology.
- Parameters:
snapshot
- The snapshot to close
-