public final class DefaultGraphManager extends Object implements GraphManager
Graph and TraversalSource instances configured for the server to be passed to script
 engine bindings. The Graph instances are read from the Settings for Gremlin Server as defined in
 the configuration file. The TraversalSource instances are rebound to the GraphManager once
 initialization scripts construct them.| Constructor and Description | 
|---|
| DefaultGraphManager(Settings settings)Create a new instance using the  Settingsfrom Gremlin Server. | 
| 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() | 
| Map<String,Graph> | getGraphs()Deprecated. 
 As of release 3.2.5, replaced by a combination of  getGraphNames()andgetGraph(String) | 
| TraversalSource | getTraversalSource(String traversalSourceName)Get  TraversalSourceinstance whose name matchestraversalSourceName | 
| Set<String> | getTraversalSourceNames()Get a  Setof the names of the the storedTraversalSourceinstances. | 
| Map<String,TraversalSource> | getTraversalSources()Deprecated. 
 As of release 3.2.5, replaced by a combination of  getTraversalSourceNames()andgetTraversalSource(String) | 
| 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. | 
@Deprecated public final Map<String,Graph> getGraphs()
getGraphNames() and
 getGraph(String)Graph instances and their binding names as defined in the Gremlin Server
 configuration file.getGraphs in interface GraphManagerMap where the key is the name of the Graph and the value is the Graph itselfpublic final Set<String> getGraphNames()
GraphManagergetGraphNames in interface GraphManagerpublic final Graph getGraph(String graphName)
GraphManagerGraph instance whose name matches graphName.getGraph in interface GraphManagerGraph if exists, else nullpublic final void putGraph(String graphName, Graph g)
GraphManagerGraph with the specified name to Map<String, Graph> .putGraph in interface GraphManager@Deprecated public final Map<String,TraversalSource> getTraversalSources()
getTraversalSourceNames() and
 getTraversalSource(String)TraversalSource instances and their binding names as defined by Gremlin Server
 initialization scripts.getTraversalSources in interface GraphManagerMap where the key is the name of the TraversalSource and the value is the
 TraversalSource itselfpublic final Set<String> getTraversalSourceNames()
GraphManagerSet of the names of the the stored TraversalSource instances.getTraversalSourceNames in interface GraphManagerpublic final TraversalSource getTraversalSource(String traversalSourceName)
GraphManagerTraversalSource instance whose name matches traversalSourceNamegetTraversalSource in interface GraphManagerTraversalSource if exists, else nullpublic final void putTraversalSource(String tsName, TraversalSource ts)
GraphManagerTraversalSource with the specified name.putTraversalSource in interface GraphManagerpublic final TraversalSource removeTraversalSource(String tsName)
GraphManagerTraversalSource by name.removeTraversalSource in interface GraphManagerpublic final Bindings getAsBindings()
Graph and TraversalSource list as a set of bindings.getAsBindings in interface GraphManagerpublic final void rollbackAll()
Graph objects.rollbackAll in interface GraphManagerpublic final void rollback(Set<String> graphSourceNamesToCloseTxOn)
rollback in interface GraphManagerpublic final void commitAll()
Graph objects.commitAll in interface GraphManagerpublic final void commit(Set<String> graphSourceNamesToCloseTxOn)
commit in interface GraphManagerpublic final 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.openGraph in interface GraphManagerpublic final Graph removeGraph(String graphName) throws Exception
Graph
 from the GraphManager.removeGraph in interface GraphManagerExceptionCopyright © 2013–2018 Apache Software Foundation. All rights reserved.