Class DefaultGraphManager
- java.lang.Object
- 
- org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager
 
- 
- All Implemented Interfaces:
- GraphManager
 - Direct Known Subclasses:
- CheckedGraphManager
 
 public class DefaultGraphManager extends Object implements GraphManager Holder forGraphandTraversalSourceinstances configured for the server to be passed to script engine bindings. TheGraphinstances are read from theSettingsfor Gremlin Server as defined in the configuration file. TheTraversalSourceinstances are rebound to theGraphManageronce initialization scripts construct them.
- 
- 
Constructor SummaryConstructors Constructor Description DefaultGraphManager(Settings settings)Create a new instance using theSettingsfrom Gremlin Server.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddGraph(String name, String configurationFile)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.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.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.tinkerpop.gremlin.server.GraphManagerbeforeQueryStart, hasAnyOpenTransactions, onQueryError, onQuerySuccess
 
- 
 
- 
- 
- 
Method Detail- 
getGraphNamespublic final Set<String> getGraphNames() Description copied from interface:GraphManager- Specified by:
- getGraphNamesin interface- GraphManager
 
 - 
getGraphpublic final Graph getGraph(String graphName) Description copied from interface:GraphManagerGetGraphinstance whose name matchesgraphName.- Specified by:
- getGraphin interface- GraphManager
- Returns:
- Graphif exists, else null
 
 - 
putGraphpublic final void putGraph(String graphName, Graph g) Description copied from interface:GraphManagerAdd or update the specifiedGraphwith the specified name toMap<String, Graph>.- Specified by:
- putGraphin interface- GraphManager
 
 - 
getTraversalSourceNamespublic final Set<String> getTraversalSourceNames() Description copied from interface:GraphManagerGet aSetof the names of the the storedTraversalSourceinstances.- Specified by:
- getTraversalSourceNamesin interface- GraphManager
 
 - 
getTraversalSourcepublic final TraversalSource getTraversalSource(String traversalSourceName) Description copied from interface:GraphManagerGetTraversalSourceinstance whose name matchestraversalSourceName- Specified by:
- getTraversalSourcein interface- GraphManager
- Returns:
- TraversalSourceif exists, else null
 
 - 
putTraversalSourcepublic final void putTraversalSource(String tsName, TraversalSource ts) Description copied from interface:GraphManagerAdd or update the specifiedTraversalSourcewith the specified name.- Specified by:
- putTraversalSourcein interface- GraphManager
 
 - 
removeTraversalSourcepublic final TraversalSource removeTraversalSource(String tsName) Description copied from interface:GraphManagerRemoveTraversalSourceby name.- Specified by:
- removeTraversalSourcein interface- GraphManager
 
 - 
getAsBindingspublic final Bindings getAsBindings() Get theGraphandTraversalSourcelist as a set of bindings.- Specified by:
- getAsBindingsin interface- GraphManager
 
 - 
rollbackAllpublic final void rollbackAll() Rollback transactions across allGraphobjects.- Specified by:
- rollbackAllin interface- GraphManager
 
 - 
rollbackpublic final void rollback(Set<String> graphSourceNamesToCloseTxOn) Selectively rollback transactions on the specified graphs or the graphs of traversal sources.- Specified by:
- rollbackin interface- GraphManager
 
 - 
commitAllpublic final void commitAll() Commit transactions across allGraphobjects.- Specified by:
- commitAllin interface- GraphManager
 
 - 
commitpublic final void commit(Set<String> graphSourceNamesToCloseTxOn) Selectively commit transactions on the specified graphs or the graphs of traversal sources.- Specified by:
- commitin interface- GraphManager
 
 - 
openGraphpublic final Graph 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.- Specified by:
- openGraphin interface- GraphManager
 
 - 
removeGraphpublic final Graph removeGraph(String graphName) throws Exception Implementation that allows for custom graph closing implementations; this method should remove theGraphfrom theGraphManager.- Specified by:
- removeGraphin interface- GraphManager
- Throws:
- Exception
 
 
- 
 
-