public class RemoteGraph extends Object implements Graph
RemoteGraph is only required for integrating with the test suite as there must be a Graph instance
for the test suite to bind to. Test suites that use this must ensure that the TraversalSource be
generated from their GraphProvider in via AnonymousTraversalSource#withRemote(RemoteConnection) or
similar overload. See RemoteGraphProvider in the gremlin-server module for an example.| Modifier and Type | Class and Description |
|---|---|
static class |
RemoteGraph.RemoteFeatures |
static class |
RemoteGraph.RemoteGraphFeatures |
Graph.Exceptions, Graph.Features, Graph.Hidden, Graph.OptIn, Graph.OptIns, Graph.OptOut, Graph.OptOuts, Graph.Variables| Modifier and Type | Method and Description |
|---|---|
Vertex |
addVertex(Object... keyValues)
Add a
Vertex to the graph given an optional series of key/value pairs. |
void |
close()
Closes the underlying
RemoteConnection. |
GraphComputer |
compute()
Generate a
GraphComputer using the default engine of the underlying graph system. |
<C extends GraphComputer> |
compute(Class<C> graphComputerClass)
Declare the
GraphComputer to use for OLAP operations on the graph. |
Configuration |
configuration()
Get the
org.apache.commons.configuration.Configuration associated with the construction of this graph. |
Iterator<Edge> |
edges(Object... edgeIds)
This method returns an empty
Iterator - it is not meant to be called directly. |
Graph.Features |
features()
Gets the
Graph.Features exposed by the underlying Graph implementation. |
RemoteConnection |
getConnection() |
static RemoteGraph |
open(Configuration conf)
Creates a new
RemoteGraph instance using the specified configuration, which allows RemoteGraph
to be compliant with GraphFactory. |
static RemoteGraph |
open(RemoteConnection connection,
Configuration conf)
Creates a new
RemoteGraph instance. |
String |
toString() |
Transaction |
tx()
Configure and control the transactions for those graphs that support this feature.
|
Graph.Variables |
variables()
A collection of global
Graph.Variables associated with the graph. |
Iterator<Vertex> |
vertices(Object... vertexIds)
This method returns an empty
Iterator - it is not meant to be called directly. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddVertex, io, traversal, traversalgetHostingVertexpublic static RemoteGraph open(Configuration conf)
RemoteGraph instance using the specified configuration, which allows RemoteGraph
to be compliant with GraphFactory. Expects key for RemoteConnection.GREMLIN_REMOTE_CONNECTION_CLASS
as well as any configuration required by the underlying RemoteConnection which will be instantiated.
Note that the Configuration object is passed down without change to the creation of the
RemoteConnection instance.public static RemoteGraph open(RemoteConnection connection, Configuration conf)
RemoteGraph instance. RemoteGraph will attempt to call the
AutoCloseable.close() method when the close() method is called on this class.connection - the RemoteConnection instance to use
RemoteConnectionpublic RemoteConnection getConnection()
public void close()
throws Exception
RemoteConnection.close in interface AutoCloseableclose in interface GraphExceptionpublic <C extends GraphComputer> C compute(Class<C> graphComputerClass) throws IllegalArgumentException
GraphGraphComputer to use for OLAP operations on the graph.
If the graph does not support graph computer then an UnsupportedOperationException is thrown.compute in interface GraphgraphComputerClass - The graph computer class to use.IllegalArgumentException - if the provided GraphComputer class is not supported.public GraphComputer compute() throws IllegalArgumentException
GraphGraphComputer using the default engine of the underlying graph system.
This is a shorthand method for the more involved method that uses Graph.compute(Class).compute in interface GraphIllegalArgumentException - if there is no default graph computerpublic Iterator<Vertex> vertices(Object... vertexIds)
Iterator - it is not meant to be called directly.public Iterator<Edge> edges(Object... edgeIds)
Iterator - it is not meant to be called directly.public Transaction tx()
GraphTransaction in the TinkerPop context is a
transaction "factory" or "controller" that helps manage transactions owned by the underlying graph database.public Graph.Variables variables()
GraphGraph.Variables associated with the graph.
Variables are used for storing metadata about the graph.public Configuration configuration()
Graphorg.apache.commons.configuration.Configuration associated with the construction of this graph.
Whatever configuration was passed to GraphFactory#open(org.apache.commons.configuration.Configuration)
is what should be returned by this method.configuration in interface Graphpublic Graph.Features features()
GraphGraph.Features exposed by the underlying Graph implementation.Copyright © 2013–2018 Apache Software Foundation. All rights reserved.