Interface GraphManager
- All Known Implementing Classes:
CheckedGraphManager,DefaultGraphManager
public interface GraphManager
The
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.-
Method Summary
Modifier and TypeMethodDescriptionvoidSelectively commit transactions on the specified graphs or the graphs of traversal sources.voidCommit transactions across allGraphobjects.Get theGraphandTraversalSourcelist as a set of bindings.GetGraphinstance whose name matchesgraphName.getTraversalSource(String traversalSourceName) GetTraversalSourceinstance whose name matchestraversalSourceNameGet aSetof the names of the the storedTraversalSourceinstances.default booleanDetermines if anyGraphinstances that support transactions have open transactions.Implementation that allows for custom graph-opening implementations; if theMaptracking graph references has aGraphobject corresponding to the graph name, then we return thatGraph-- otherwise, we use the customFunctionto instantiate a newGraph, add it to theMaptracking graph references, and return saidGraph.voidAdd or update the specifiedGraphwith the specified name toMap<String, Graph>.voidputTraversalSource(String tsName, TraversalSource ts) Add or update the specifiedTraversalSourcewith the specified name.removeGraph(String graphName) Implementation that allows for custom graph closing implementations; this method should remove theGraphfrom theGraphManager.removeTraversalSource(String tsName) RemoveTraversalSourceby name.voidSelectively rollback transactions on the specified graphs or the graphs of traversal sources.voidRollback transactions across allGraphobjects.
-
Method Details
-
getGraphNames
-
getGraph
GetGraphinstance whose name matchesgraphName.- Returns:
Graphif exists, else null
-
putGraph
Add or update the specifiedGraphwith the specified name toMap<String, Graph>. -
getTraversalSourceNames
Get aSetof the names of the the storedTraversalSourceinstances. -
getTraversalSource
GetTraversalSourceinstance whose name matchestraversalSourceName- Returns:
TraversalSourceif exists, else null
-
putTraversalSource
Add or update the specifiedTraversalSourcewith the specified name. -
removeTraversalSource
RemoveTraversalSourceby name. -
getAsBindings
Bindings getAsBindings()Get theGraphandTraversalSourcelist as a set of bindings. -
rollbackAll
void rollbackAll()Rollback transactions across allGraphobjects. -
rollback
Selectively rollback transactions on the specified graphs or the graphs of traversal sources. -
commitAll
void commitAll()Commit transactions across allGraphobjects. -
commit
Selectively commit transactions on the specified graphs or the graphs of traversal sources. -
openGraph
Implementation that allows for custom graph-opening implementations; if theMaptracking graph references has aGraphobject corresponding to the graph name, then we return thatGraph-- otherwise, we use the customFunctionto instantiate a newGraph, add it to theMaptracking graph references, and return saidGraph. -
removeGraph
Implementation that allows for custom graph closing implementations; this method should remove theGraphfrom theGraphManager.- Throws:
Exception
-
hasAnyOpenTransactions
default boolean hasAnyOpenTransactions()Determines if anyGraphinstances that support transactions have open transactions.
-