Class DriverRemoteConnection
java.lang.Object
org.apache.tinkerpop.gremlin.driver.remote.DriverRemoteConnection
- All Implemented Interfaces:
AutoCloseable,RemoteConnection
A
RemoteConnection implementation for Gremlin Server. Each DriverServerConnection is bound to one
graph instance hosted in Gremlin Server.- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
Field Summary
FieldsFields inherited from interface org.apache.tinkerpop.gremlin.process.remote.RemoteConnection
GREMLIN_REMOTE, GREMLIN_REMOTE_CONNECTION_CLASS -
Constructor Summary
ConstructorsConstructorDescriptionDriverRemoteConnection(org.apache.commons.configuration2.Configuration conf) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Returns thePDTRegistryassociated with this connection, ornullif none.voidsetPdtRegistry(PDTRegistry pdtRegistry) Sets thePDTRegistryfor registry-based dehydration in the gremlin-lang translator.<E> CompletableFuture<RemoteTraversal<?,E>> submitAsync(GremlinLang gremlinLang) toString()tx()Creates a newHttpRemoteTransactionfor executing transactional operations.static DriverRemoteConnectionCreates aDriverRemoteConnectionusing a newClusterinstance created from the supplied configuration file.static DriverRemoteConnectionCreates aDriverRemoteConnectionusing a newClusterinstance created from the supplied host and port and binds it to a remoteGraphTraversalSourcenamed "g".static DriverRemoteConnectionCreates aDriverRemoteConnectionusing a newClusterinstance created from the supplied host port and aliases it to the specified remoteGraphTraversalSource.static DriverRemoteConnectionCreates aDriverRemoteConnectionusing a newClusterinstance created from the supplied configuration file.static DriverRemoteConnectionusing(org.apache.commons.configuration2.Configuration conf) Creates aDriverRemoteConnectionusing an ApacheConfigurationobject.static DriverRemoteConnectionCreates aDriverRemoteConnectionusing an existingClientobject.static DriverRemoteConnectionCreates aDriverRemoteConnectionusing an existingClientobject.static DriverRemoteConnectionCreates aDriverRemoteConnectionfrom an existingClusterinstance.static DriverRemoteConnectionCreates aDriverRemoteConnectionfrom an existingClusterinstance.
-
Field Details
-
GREMLIN_REMOTE_DRIVER_CLUSTERFILE
- See Also:
-
GREMLIN_REMOTE_DRIVER_SOURCENAME
- See Also:
-
-
Constructor Details
-
DriverRemoteConnection
public DriverRemoteConnection(org.apache.commons.configuration2.Configuration conf)
-
-
Method Details
-
using
Creates aDriverRemoteConnectionusing an existingClientobject. TheClientwill not be closed on calls toclose(). -
using
Creates aDriverRemoteConnectionusing an existingClientobject. TheClientwill not be closed on calls toclose(). -
using
Creates aDriverRemoteConnectionusing a newClusterinstance created from the supplied host and port and binds it to a remoteGraphTraversalSourcenamed "g". Whenclose()is called, this newClusteris also closed. By default, this method will bind theRemoteConnectionto a graph on the server named "graph". -
using
Creates aDriverRemoteConnectionusing a newClusterinstance created from the supplied host port and aliases it to the specified remoteGraphTraversalSource. Whenclose()is called, this newClusteris also closed. By default, this method will bind theRemoteConnectionto the specified graph traversal source name. -
using
Creates aDriverRemoteConnectionfrom an existingClusterinstance. Whenclose()is called, theClusteris left open for the caller to close. By default, this method will bind theRemoteConnectionto a graph on the server named "graph". -
using
Creates aDriverRemoteConnectionfrom an existingClusterinstance. Whenclose()is called, theClusteris left open for the caller to close. -
using
Creates aDriverRemoteConnectionusing a newClusterinstance created from the supplied configuration file. Whenclose()is called, this newClusteris also closed. By default, this method will bind theRemoteConnectionto a graph on the server named "graph". -
using
public static DriverRemoteConnection using(String clusterConfFile, String remoteTraversalSourceName) Creates aDriverRemoteConnectionusing a newClusterinstance created from the supplied configuration file. Whenclose()is called, this newClusteris also closed. -
using
Creates aDriverRemoteConnectionusing an ApacheConfigurationobject. TheConfigurationobject should contain one of two required keys, either:clusterConfigurationFileorclusterConfiguration. TheclusterConfigurationFilekey is a pointer to a file location containing a configuration for aCluster. TheclusterConfigurationshould contain the actual contents of a configuration that would be used by aCluster. Thisconfigurationmay also contain the optional, but likely necessary,remoteTraversalSourceNamewhich tells theDriverServerConnectionwhich graph on the server to bind to. -
getPdtRegistry
Description copied from interface:RemoteConnectionReturns thePDTRegistryassociated with this connection, ornullif none. Used by the gremlin-lang translator for registry-based dehydration of unknown types.- Specified by:
getPdtRegistryin interfaceRemoteConnection
-
setPdtRegistry
Sets thePDTRegistryfor registry-based dehydration in the gremlin-lang translator. -
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
-
tx
Creates a newHttpRemoteTransactionfor executing transactional operations.- Specified by:
txin interfaceRemoteConnection- Returns:
- A new
HttpRemoteTransaction
-
toString
-