Class RemoteGraph
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.structure.RemoteGraph
-
- All Implemented Interfaces:
AutoCloseable
,Graph
,Host
public class RemoteGraph extends Object implements Graph
RemoteGraph
is only required for integrating with the test suite as there must be aGraph
instance for the test suite to bind to. Test suites that use this must ensure that theTraversalSource
be generated from theirGraphProvider
in viaAnonymousTraversalSource.withRemote(RemoteConnection)
or similar overload. SeeRemoteGraphProvider
in 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 class
RemoteGraph.RemoteFeatures
static class
RemoteGraph.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 Vertex
addVertex(Object... keyValues)
Add aVertex
to the graph given an optional series of key/value pairs.void
close()
Closes the underlyingRemoteConnection
.GraphComputer
compute()
Generate aGraphComputer
using the default engine of the underlying graph system.<C extends GraphComputer>
Ccompute(Class<C> graphComputerClass)
Declare theGraphComputer
to use for OLAP operations on the graph.org.apache.commons.configuration2.Configuration
configuration()
Get theConfiguration
associated 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.Features
features()
Gets theGraph.Features
exposed by the underlyingGraph
implementation.RemoteConnection
getConnection()
static RemoteGraph
open(String configFile)
static RemoteGraph
open(org.apache.commons.configuration2.Configuration conf)
Creates a newRemoteGraph
instance using the specified configuration, which allowsRemoteGraph
to be compliant withGraphFactory
.static RemoteGraph
open(RemoteConnection connection, org.apache.commons.configuration2.Configuration conf)
Creates a newRemoteGraph
instance.String
toString()
Transaction
tx()
Configure and control the transactions for those graphs that support this feature.Graph.Variables
variables()
A collection of globalGraph.Variables
associated 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 newRemoteGraph
instance using the specified configuration, which allowsRemoteGraph
to be compliant withGraphFactory
. Expects key forRemoteConnection.GREMLIN_REMOTE_CONNECTION_CLASS
as well as any configuration required by the underlyingRemoteConnection
which will be instantiated. Note that theConfiguration
object is passed down without change to the creation of theRemoteConnection
instance.
-
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 newRemoteGraph
instance.RemoteGraph
will attempt to call theAutoCloseable.close()
method when theclose()
method is called on this class.- Parameters:
connection
- theRemoteConnection
instance to useRemoteConnection
-
getConnection
public RemoteConnection getConnection()
-
close
public void close() throws Exception
Closes the underlyingRemoteConnection
.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceGraph
- Throws:
Exception
-
compute
public <C extends GraphComputer> C compute(Class<C> graphComputerClass) throws IllegalArgumentException
Description copied from interface:Graph
Declare theGraphComputer
to use for OLAP operations on the graph. If the graph does not support graph computer then anUnsupportedOperationException
is thrown.- Specified by:
compute
in interfaceGraph
- Parameters:
graphComputerClass
- The graph computer class to use.- Returns:
- A graph computer for processing this graph
- Throws:
IllegalArgumentException
- if the providedGraphComputer
class is not supported.
-
compute
public GraphComputer compute() throws IllegalArgumentException
Description copied from interface:Graph
Generate aGraphComputer
using the default engine of the underlying graph system. This is a shorthand method for the more involved method that usesGraph.compute(Class)
.- Specified by:
compute
in 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:Graph
Configure and control the transactions for those graphs that support this feature.
-
variables
public Graph.Variables variables()
Description copied from interface:Graph
A collection of globalGraph.Variables
associated with the graph. Variables are used for storing metadata about the graph.
-
configuration
public org.apache.commons.configuration2.Configuration configuration()
Description copied from interface:Graph
Get theConfiguration
associated with the construction of this graph. Whatever configuration was passed toGraphFactory.open(Configuration)
is what should be returned by this method.- Specified by:
configuration
in interfaceGraph
- Returns:
- the configuration used during graph construction.
-
features
public Graph.Features features()
Description copied from interface:Graph
Gets theGraph.Features
exposed by the underlyingGraph
implementation.
-
-