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)voidclose()Closes the underlyingRemoteConnection.GraphComputercompute()<C extends GraphComputer>
Ccompute(Class<C> graphComputerClass)org.apache.commons.configuration2.Configurationconfiguration()Iterator<Edge>edges(Object... edgeIds)This method returns an emptyIterator- it is not meant to be called directly.Graph.Featuresfeatures()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()Graph.Variablesvariables()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
- Specified by:
computein interfaceGraph- Throws:
IllegalArgumentException
-
compute
public GraphComputer compute() throws IllegalArgumentException
- Specified by:
computein interfaceGraph- Throws:
IllegalArgumentException
-
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()
-
variables
public Graph.Variables variables()
-
configuration
public org.apache.commons.configuration2.Configuration configuration()
- Specified by:
configurationin interfaceGraph
-
features
public Graph.Features features()
-
-