public class EmbeddedRemoteConnection extends Object implements RemoteConnection
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 = TraversalSourceFactory.traversal(new EmbeddedRemoteConnection(g));
assertEquals(6, simulatedRemoteG.V().count().next().intValue());
GREMLIN_REMOTE, GREMLIN_REMOTE_CONNECTION_CLASS| Constructor and Description |
|---|
EmbeddedRemoteConnection(GraphTraversalSource g) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
<E> CompletableFuture<RemoteTraversal<?,E>> |
submitAsync(Bytecode bytecode)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfrompublic EmbeddedRemoteConnection(GraphTraversalSource g)
public <E> CompletableFuture<RemoteTraversal<?,E>> submitAsync(Bytecode bytecode) throws RemoteConnectionException
RemoteConnectionTraversal Bytecode to a server and returns a promise of a RemoteTraversal.
The RemoteTraversal is an abstraction over two types of results that can be returned as part of the
response from the server: the results of the Traversal itself and the side-effects that it produced.submitAsync in interface RemoteConnectionRemoteConnectionExceptionpublic void close()
throws Exception
close in interface AutoCloseableExceptionCopyright © 2013–2018 Apache Software Foundation. All rights reserved.