public interface GraphManager
GraphManager
interface allows for reference tracking of Graph references through
a Map<String, Graph>
; the interface plugs into the lifeline of gremlin script
executions, meaning that commit() and rollback() will be called on all graphs stored in the
graph reference tracker at the end of the script executions; you may want to implement
this interface if you want to define a custom graph instantiation/closing mechanism; note that
the interface also defines similar features for TraversalSource
objects.Modifier and Type | Method and Description |
---|---|
void |
commit(Set<String> graphSourceNamesToCloseTxOn)
Selectively commit transactions on the specified graphs or the graphs of traversal sources.
|
void |
commitAll()
Commit transactions across all
Graph objects. |
Bindings |
getAsBindings()
Get the
Graph and TraversalSource list as a set of bindings. |
Graph |
getGraph(String graphName)
Get
Graph instance whose name matches graphName . |
Set<String> |
getGraphNames()
|
TraversalSource |
getTraversalSource(String traversalSourceName)
Get
TraversalSource instance whose name matches traversalSourceName |
Set<String> |
getTraversalSourceNames()
Get a
Set of the names of the the stored TraversalSource instances. |
Graph |
openGraph(String graphName,
Function<String,Graph> supplier)
Implementation that allows for custom graph-opening implementations; if the
Map
tracking graph references has a Graph object corresponding to the graph name, then we return that
Graph -- otherwise, we use the custom Function to instantiate a new Graph , add it to
the Map tracking graph references, and return said Graph . |
void |
putGraph(String graphName,
Graph g)
Add or update the specified
Graph with the specified name to Map<String, Graph> . |
void |
putTraversalSource(String tsName,
TraversalSource ts)
Add or update the specified
TraversalSource with the specified name. |
Graph |
removeGraph(String graphName)
Implementation that allows for custom graph closing implementations; this method should remove the
Graph
from the GraphManager . |
TraversalSource |
removeTraversalSource(String tsName)
Remove
TraversalSource by name. |
void |
rollback(Set<String> graphSourceNamesToCloseTxOn)
Selectively rollback transactions on the specified graphs or the graphs of traversal sources.
|
void |
rollbackAll()
Rollback transactions across all
Graph objects. |
Graph getGraph(String graphName)
Graph
instance whose name matches graphName
.Graph
if exists, else nullvoid putGraph(String graphName, Graph g)
Graph
with the specified name to Map<String, Graph>
.Set<String> getTraversalSourceNames()
Set
of the names of the the stored TraversalSource
instances.TraversalSource getTraversalSource(String traversalSourceName)
TraversalSource
instance whose name matches traversalSourceName
TraversalSource
if exists, else nullvoid putTraversalSource(String tsName, TraversalSource ts)
TraversalSource
with the specified name.TraversalSource removeTraversalSource(String tsName)
TraversalSource
by name.Bindings getAsBindings()
Graph
and TraversalSource
list as a set of bindings.void rollbackAll()
Graph
objects.void rollback(Set<String> graphSourceNamesToCloseTxOn)
void commitAll()
Graph
objects.void commit(Set<String> graphSourceNamesToCloseTxOn)
Graph openGraph(String graphName, Function<String,Graph> supplier)
Map
tracking graph references has a Graph
object corresponding to the graph name, then we return that
Graph
-- otherwise, we use the custom Function
to instantiate a new Graph
, add it to
the Map
tracking graph references, and return said Graph
.Copyright © 2013–2022 Apache Software Foundation. All rights reserved.