Class EmbeddedRemoteConnection
- java.lang.Object
- 
- org.apache.tinkerpop.gremlin.process.remote.EmbeddedRemoteConnection
 
- 
- All Implemented Interfaces:
- AutoCloseable,- RemoteConnection
 
 public class EmbeddedRemoteConnection extends Object implements RemoteConnection Allows aRemoteConnectionto be submitted to a "local"Graphinstance 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());- Author:
- Stephen Mallette (http://stephen.genoprime.com)
 
- 
- 
Field Summary- 
Fields inherited from interface org.apache.tinkerpop.gremlin.process.remote.RemoteConnectionGREMLIN_REMOTE, GREMLIN_REMOTE_CONNECTION_CLASS
 
- 
 - 
Constructor SummaryConstructors Constructor Description EmbeddedRemoteConnection(GraphTraversalSource g)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()<E> CompletableFuture<RemoteTraversal<?,E>>submitAsync(Bytecode bytecode)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.tinkerpop.gremlin.process.remote.RemoteConnectiontx
 
- 
 
- 
- 
- 
Constructor Detail- 
EmbeddedRemoteConnectionpublic EmbeddedRemoteConnection(GraphTraversalSource g) 
 
- 
 - 
Method Detail- 
submitAsyncpublic <E> CompletableFuture<RemoteTraversal<?,E>> submitAsync(Bytecode bytecode) throws RemoteConnectionException Description copied from interface:RemoteConnectionSubmitsTraversalBytecodeto 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 interface- RemoteConnection
- Throws:
- RemoteConnectionException
 
 - 
closepublic void close() throws Exception- Specified by:
- closein interface- AutoCloseable
- Throws:
- Exception
 
 
- 
 
-