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  Graphobjects. | 
| Bindings | getAsBindings()Get the  GraphandTraversalSourcelist as a set of bindings. | 
| Graph | getGraph(String graphName)Get  Graphinstance whose name matchesgraphName. | 
| Set<String> | getGraphNames() | 
| TraversalSource | getTraversalSource(String traversalSourceName)Get  TraversalSourceinstance whose name matchestraversalSourceName | 
| Set<String> | getTraversalSourceNames()Get a  Setof the names of the the storedTraversalSourceinstances. | 
| default boolean | hasAnyOpenTransactions()Determines if any  Graphinstances that support transactions have open transactions. | 
| Graph | openGraph(String graphName,
         Function<String,Graph> supplier)Implementation that allows for custom graph-opening implementations; if the  Maptracking 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. | 
| void | putGraph(String graphName,
        Graph g)Add or update the specified  Graphwith the specified name toMap<String, Graph>. | 
| void | putTraversalSource(String tsName,
                  TraversalSource ts)Add or update the specified  TraversalSourcewith the specified name. | 
| Graph | removeGraph(String graphName)Implementation that allows for custom graph closing implementations; this method should remove the  Graphfrom theGraphManager. | 
| TraversalSource | removeTraversalSource(String tsName)Remove  TraversalSourceby 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  Graphobjects. | 
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 traversalSourceNameTraversalSource 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.Graph removeGraph(String graphName) throws Exception
Graph
 from the GraphManager.Exceptiondefault boolean hasAnyOpenTransactions()
Graph instances that support transactions have open transactions.Copyright © 2013–2022 Apache Software Foundation. All rights reserved.