Class EmbeddedRemoteConnection
java.lang.Object
org.apache.tinkerpop.gremlin.process.remote.EmbeddedRemoteConnection
- All Implemented Interfaces:
AutoCloseable,RemoteConnection
Allows a
RemoteConnection to be submitted to a "local" Graph instance thus simulating a connection
to a remote source. Basic usage is as follows:
// Using TinkerGraph here but any embedded Graph instance would suffice
Graph graph = TinkerFactory.createModern();
GraphTraversalSource g = graph.traversal();
// setup the remote as normal but give it the embedded "g" so that it executes against that
GraphTraversalSource simulatedRemoteG = traversal().with(new EmbeddedRemoteConnection(g));
assertEquals(6, simulatedRemoteG.V().count().next().intValue());
- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
Field Summary
Fields inherited from interface org.apache.tinkerpop.gremlin.process.remote.RemoteConnection
GREMLIN_REMOTE, GREMLIN_REMOTE_CONNECTION_CLASS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()<E> CompletableFuture<RemoteTraversal<?,E>> submitAsync(GremlinLang gremlinLang) 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.process.remote.RemoteConnection
getPdtRegistry, tx
-
Constructor Details
-
EmbeddedRemoteConnection
-
-
Method Details
-
submitAsync
public <E> CompletableFuture<RemoteTraversal<?,E>> submitAsync(GremlinLang gremlinLang) throws RemoteConnectionException Description copied from interface:RemoteConnectionSubmitsTraversalGremlinLangto a server and returns a promise of aRemoteTraversal. TheRemoteTraversalis an abstraction over two types of results that can be returned as part of the response from the server: the results of theTraversalitself and the side-effects that it produced.- Specified by:
submitAsyncin interfaceRemoteConnection- Throws:
RemoteConnectionException
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-