Class DefaultGraphManager
java.lang.Object
org.apache.tinkerpop.gremlin.server.util.DefaultGraphManager
- All Implemented Interfaces:
GraphManager
- Direct Known Subclasses:
CheckedGraphManager
Holder for
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 Summary
ConstructorsConstructorDescriptionDefaultGraphManager(Settings settings) Create a new instance using theSettingsfrom Gremlin Server. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfinal voidSelectively commit transactions on the specified graphs or the graphs of traversal sources.final voidCommit transactions across allGraphobjects.final BindingsGet theGraphandTraversalSourcelist as a set of bindings.final GraphGetGraphinstance whose name matchesgraphName.final TraversalSourcegetTraversalSource(String traversalSourceName) GetTraversalSourceinstance whose name matchestraversalSourceNameGet aSetof the names of the the storedTraversalSourceinstances.final GraphImplementation 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.final voidAdd or update the specifiedGraphwith the specified name toMap<String, Graph>.final voidputTraversalSource(String tsName, TraversalSource ts) Add or update the specifiedTraversalSourcewith the specified name.final GraphremoveGraph(String graphName) Implementation that allows for custom graph closing implementations; this method should remove theGraphfrom theGraphManager.final TraversalSourceremoveTraversalSource(String tsName) RemoveTraversalSourceby name.final voidSelectively rollback transactions on the specified graphs or the graphs of traversal sources.final voidRollback transactions across allGraphobjects.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.tinkerpop.gremlin.server.GraphManager
hasAnyOpenTransactions
-
Constructor Details
-
DefaultGraphManager
Create a new instance using theSettingsfrom Gremlin Server.
-
-
Method Details
-
addGraph
-
getGraphNames
Description copied from interface:GraphManager- Specified by:
getGraphNamesin interfaceGraphManager
-
getGraph
Description copied from interface:GraphManagerGetGraphinstance whose name matchesgraphName.- Specified by:
getGraphin interfaceGraphManager- Returns:
Graphif exists, else null
-
putGraph
Description copied from interface:GraphManagerAdd or update the specifiedGraphwith the specified name toMap<String, Graph>.- Specified by:
putGraphin interfaceGraphManager
-
getTraversalSourceNames
Description copied from interface:GraphManagerGet aSetof the names of the the storedTraversalSourceinstances.- Specified by:
getTraversalSourceNamesin interfaceGraphManager
-
getTraversalSource
Description copied from interface:GraphManagerGetTraversalSourceinstance whose name matchestraversalSourceName- Specified by:
getTraversalSourcein interfaceGraphManager- Returns:
TraversalSourceif exists, else null
-
putTraversalSource
Description copied from interface:GraphManagerAdd or update the specifiedTraversalSourcewith the specified name.- Specified by:
putTraversalSourcein interfaceGraphManager
-
removeTraversalSource
Description copied from interface:GraphManagerRemoveTraversalSourceby name.- Specified by:
removeTraversalSourcein interfaceGraphManager
-
getAsBindings
Get theGraphandTraversalSourcelist as a set of bindings.- Specified by:
getAsBindingsin interfaceGraphManager
-
rollbackAll
public final void rollbackAll()Rollback transactions across allGraphobjects.- Specified by:
rollbackAllin interfaceGraphManager
-
rollback
Selectively rollback transactions on the specified graphs or the graphs of traversal sources.- Specified by:
rollbackin interfaceGraphManager
-
commitAll
public final void commitAll()Commit transactions across allGraphobjects.- Specified by:
commitAllin interfaceGraphManager
-
commit
Selectively commit transactions on the specified graphs or the graphs of traversal sources.- Specified by:
commitin interfaceGraphManager
-
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.- Specified by:
openGraphin interfaceGraphManager
-
removeGraph
Implementation that allows for custom graph closing implementations; this method should remove theGraphfrom theGraphManager.- Specified by:
removeGraphin interfaceGraphManager- Throws:
Exception
-