Interface GraphManager
- 
- All Known Implementing Classes:
- CheckedGraphManager,- DefaultGraphManager
 
 public interface GraphManagerTheGraphManagerinterface allows for reference tracking of Graph references through aMap<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 forTraversalSourceobjects.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidbeforeQueryStart(RequestMessage msg)This method will be called before a script or query is processed by the gremlin-server.voidcommit(Set<String> graphSourceNamesToCloseTxOn)Selectively commit transactions on the specified graphs or the graphs of traversal sources.voidcommitAll()Commit transactions across allGraphobjects.BindingsgetAsBindings()Get theGraphandTraversalSourcelist as a set of bindings.GraphgetGraph(String graphName)GetGraphinstance whose name matchesgraphName.Set<String>getGraphNames()TraversalSourcegetTraversalSource(String traversalSourceName)GetTraversalSourceinstance whose name matchestraversalSourceNameSet<String>getTraversalSourceNames()Get aSetof the names of the the storedTraversalSourceinstances.default booleanhasAnyOpenTransactions()Determines if anyGraphinstances that support transactions have open transactions.default voidonQueryError(RequestMessage msg, Throwable error)This method will be called before a script or query is processed by the gremlin-server.default voidonQuerySuccess(RequestMessage msg)When a script or query successfully completes this method will be called.GraphopenGraph(String graphName, Function<String,Graph> supplier)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.voidputGraph(String graphName, Graph g)Add or update the specifiedGraphwith the specified name toMap<String, Graph>.voidputTraversalSource(String tsName, TraversalSource ts)Add or update the specifiedTraversalSourcewith the specified name.GraphremoveGraph(String graphName)Implementation that allows for custom graph closing implementations; this method should remove theGraphfrom theGraphManager.TraversalSourceremoveTraversalSource(String tsName)RemoveTraversalSourceby name.voidrollback(Set<String> graphSourceNamesToCloseTxOn)Selectively rollback transactions on the specified graphs or the graphs of traversal sources.voidrollbackAll()Rollback transactions across allGraphobjects.
 
- 
- 
- 
Method Detail- 
getGraphGraph getGraph(String graphName) GetGraphinstance whose name matchesgraphName.- Returns:
- Graphif exists, else null
 
 - 
putGraphvoid putGraph(String graphName, Graph g) Add or update the specifiedGraphwith the specified name toMap<String, Graph>.
 - 
getTraversalSourceNamesSet<String> getTraversalSourceNames() Get aSetof the names of the the storedTraversalSourceinstances.
 - 
getTraversalSourceTraversalSource getTraversalSource(String traversalSourceName) GetTraversalSourceinstance whose name matchestraversalSourceName- Returns:
- TraversalSourceif exists, else null
 
 - 
putTraversalSourcevoid putTraversalSource(String tsName, TraversalSource ts) Add or update the specifiedTraversalSourcewith the specified name.
 - 
removeTraversalSourceTraversalSource removeTraversalSource(String tsName) RemoveTraversalSourceby name.
 - 
getAsBindingsBindings getAsBindings() Get theGraphandTraversalSourcelist as a set of bindings.
 - 
rollbackAllvoid rollbackAll() Rollback transactions across allGraphobjects.
 - 
rollbackvoid rollback(Set<String> graphSourceNamesToCloseTxOn) Selectively rollback transactions on the specified graphs or the graphs of traversal sources.
 - 
commitAllvoid commitAll() Commit transactions across allGraphobjects.
 - 
commitvoid commit(Set<String> graphSourceNamesToCloseTxOn) Selectively commit transactions on the specified graphs or the graphs of traversal sources.
 - 
openGraphGraph openGraph(String graphName, Function<String,Graph> supplier) 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.
 - 
removeGraphGraph removeGraph(String graphName) throws Exception Implementation that allows for custom graph closing implementations; this method should remove theGraphfrom theGraphManager.- Throws:
- Exception
 
 - 
hasAnyOpenTransactionsdefault boolean hasAnyOpenTransactions() Determines if anyGraphinstances that support transactions have open transactions.
 - 
beforeQueryStartdefault void beforeQueryStart(RequestMessage msg) This method will be called before a script or query is processed by the gremlin-server.- Parameters:
- msg- the- RequestMessagereceived by the gremlin-server.
 
 - 
onQueryErrordefault void onQueryError(RequestMessage msg, Throwable error) This method will be called before a script or query is processed by the gremlin-server.- Parameters:
- msg- the- RequestMessagereceived by the gremlin-server.
- error- the exception encountered during processing from the gremlin-server.
 
 - 
onQuerySuccessdefault void onQuerySuccess(RequestMessage msg) When a script or query successfully completes this method will be called.- Parameters:
- msg- the- RequestMessagereceived by the gremlin-server.
 
 
- 
 
-