Class RemoteGraph
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.structure.RemoteGraph
-
- All Implemented Interfaces:
AutoCloseable,Graph,Host
public class RemoteGraph extends Object implements Graph
RemoteGraphis only required for integrating with the test suite as there must be aGraphinstance for the test suite to bind to. Test suites that use this must ensure that theTraversalSourcebe generated from theirGraphProviderin viaAnonymousTraversalSource.withRemote(RemoteConnection)or similar overload. SeeRemoteGraphProviderin the gremlin-server module for an example.- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRemoteGraph.RemoteFeaturesstatic classRemoteGraph.RemoteGraphFeatures-
Nested classes/interfaces inherited from interface org.apache.tinkerpop.gremlin.structure.Graph
Graph.Exceptions, Graph.Features, Graph.Hidden, Graph.OptIn, Graph.OptIns, Graph.OptOut, Graph.OptOuts, Graph.Variables
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description VertexaddVertex(Object... keyValues)Add aVertexto the graph given an optional series of key/value pairs.voidclose()Closes the underlyingRemoteConnection.GraphComputercompute()Generate aGraphComputerusing the default engine of the underlying graph system.<C extends GraphComputer>
Ccompute(Class<C> graphComputerClass)Declare theGraphComputerto use for OLAP operations on the graph.org.apache.commons.configuration2.Configurationconfiguration()Get theConfigurationassociated with the construction of this graph.Iterator<Edge>edges(Object... edgeIds)This method returns an emptyIterator- it is not meant to be called directly.Graph.Featuresfeatures()Gets theGraph.Featuresexposed by the underlyingGraphimplementation.RemoteConnectiongetConnection()static RemoteGraphopen(String configFile)static RemoteGraphopen(org.apache.commons.configuration2.Configuration conf)Creates a newRemoteGraphinstance using the specified configuration, which allowsRemoteGraphto be compliant withGraphFactory.static RemoteGraphopen(RemoteConnection connection, org.apache.commons.configuration2.Configuration conf)Creates a newRemoteGraphinstance.StringtoString()Transactiontx()Configure and control the transactions for those graphs that support this feature.Graph.Variablesvariables()A collection of globalGraph.Variablesassociated with the graph.Iterator<Vertex>vertices(Object... vertexIds)This method returns an emptyIterator- it is not meant to be called directly.
-
-
-
Method Detail
-
open
public static RemoteGraph open(org.apache.commons.configuration2.Configuration conf)
Creates a newRemoteGraphinstance using the specified configuration, which allowsRemoteGraphto be compliant withGraphFactory. Expects key forRemoteConnection.GREMLIN_REMOTE_CONNECTION_CLASSas well as any configuration required by the underlyingRemoteConnectionwhich will be instantiated. Note that theConfigurationobject is passed down without change to the creation of theRemoteConnectioninstance.
-
open
public static RemoteGraph open(String configFile) throws Exception
- Throws:
Exception
-
open
public static RemoteGraph open(RemoteConnection connection, org.apache.commons.configuration2.Configuration conf)
Creates a newRemoteGraphinstance.RemoteGraphwill attempt to call theAutoCloseable.close()method when theclose()method is called on this class.- Parameters:
connection- theRemoteConnectioninstance to useRemoteConnection
-
getConnection
public RemoteConnection getConnection()
-
close
public void close() throws ExceptionCloses the underlyingRemoteConnection.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceGraph- Throws:
Exception
-
compute
public <C extends GraphComputer> C compute(Class<C> graphComputerClass) throws IllegalArgumentException
Description copied from interface:GraphDeclare theGraphComputerto use for OLAP operations on the graph. If the graph does not support graph computer then anUnsupportedOperationExceptionis thrown.- Specified by:
computein interfaceGraph- Parameters:
graphComputerClass- The graph computer class to use.- Returns:
- A graph computer for processing this graph
- Throws:
IllegalArgumentException- if the providedGraphComputerclass is not supported.
-
compute
public GraphComputer compute() throws IllegalArgumentException
Description copied from interface:GraphGenerate aGraphComputerusing the default engine of the underlying graph system. This is a shorthand method for the more involved method that usesGraph.compute(Class).- Specified by:
computein interfaceGraph- Returns:
- A default graph computer
- Throws:
IllegalArgumentException- if there is no default graph computer
-
vertices
public Iterator<Vertex> vertices(Object... vertexIds)
This method returns an emptyIterator- it is not meant to be called directly.
-
edges
public Iterator<Edge> edges(Object... edgeIds)
This method returns an emptyIterator- it is not meant to be called directly.
-
tx
public Transaction tx()
Description copied from interface:GraphConfigure and control the transactions for those graphs that support this feature.
-
variables
public Graph.Variables variables()
Description copied from interface:GraphA collection of globalGraph.Variablesassociated with the graph. Variables are used for storing metadata about the graph.
-
configuration
public org.apache.commons.configuration2.Configuration configuration()
Description copied from interface:GraphGet theConfigurationassociated with the construction of this graph. Whatever configuration was passed toGraphFactory.open(Configuration)is what should be returned by this method.- Specified by:
configurationin interfaceGraph- Returns:
- the configuration used during graph construction.
-
features
public Graph.Features features()
Description copied from interface:GraphGets theGraph.Featuresexposed by the underlyingGraphimplementation.
-
-