Package com.arangodb
Class ArangoDB.Builder
- java.lang.Object
-
- com.arangodb.ArangoDB.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ArangoDB.Builder
acquireHostList(Boolean acquireHostList)
Whether the driver should acquire a list of available coordinators in an ArangoDB cluster or a single server with active failover.ArangoDB.Builder
acquireHostListInterval(Integer acquireHostListInterval)
Setting the Interval for acquireHostListArangoDB.Builder
asyncExecutor(Executor executor)
Deprecated.for removal.ArangoDB
build()
Returns an instance ofArangoDB
.ArangoDB.Builder
chunkSize(Integer chunkSize)
Sets the chunk size whenProtocol.VST
is used.ArangoDB.Builder
compression(Compression compression)
Sets thecontent-encoding
andaccept-encoding
to use for HTTP requests and the related algorithm to encode and decode the transferred data.ArangoDB.Builder
compressionLevel(Integer level)
Sets the compression level.ArangoDB.Builder
compressionThreshold(Integer threshold)
Sets the minimum HTTP request body size (in bytes) to trigger compression.ArangoDB.Builder
connectionTtl(Long connectionTtl)
Set the time to live of an inactive connection.protected com.arangodb.internal.net.HostHandler
createHostHandler(com.arangodb.internal.net.HostResolver hostResolver)
protected Collection<com.arangodb.internal.net.Host>
createHostList(com.arangodb.internal.net.ConnectionFactory connectionFactory)
protected com.arangodb.internal.net.HostResolver
createHostResolver(Collection<com.arangodb.internal.net.Host> hosts, com.arangodb.internal.net.ConnectionFactory connectionFactory)
ArangoDB.Builder
host(String host, int port)
Adds a host to connect to.ArangoDB.Builder
jwt(String jwt)
Sets the JWT for the user authentication.ArangoDB.Builder
keepAliveInterval(Integer keepAliveInterval)
Set the keep-alive interval for VST connections.ArangoDB.Builder
loadBalancingStrategy(LoadBalancingStrategy loadBalancingStrategy)
Sets the load balancing strategy to be used in an ArangoDB cluster setup.ArangoDB.Builder
loadProperties(ArangoConfigProperties properties)
ArangoDB.Builder
maxConnections(Integer maxConnections)
Sets the maximum number of connections the built in connection pool will open per host.ArangoDB.Builder
password(String password)
Sets the password for the user for authentication.ArangoDB.Builder
protocol(Protocol protocol)
ArangoDB.Builder
protocolConfig(ProtocolConfig protocolConfig)
Configuration specific forProtocolProvider
.protected com.arangodb.internal.net.ProtocolProvider
protocolProvider(Protocol protocol)
ArangoDB.Builder
responseQueueTimeSamples(Integer responseQueueTimeSamples)
Setting the amount of samples kept for queue time metricsArangoDB.Builder
serde(ArangoSerde serde)
Sets the serde for the user data.ArangoDB.Builder
sslContext(SSLContext sslContext)
Sets the SSL context to be used whentrue
is passed throughuseSsl(Boolean)
.ArangoDB.Builder
timeout(Integer timeout)
Sets the connection and request timeout in milliseconds.ArangoDB.Builder
user(String user)
Sets the username to use for authentication.ArangoDB.Builder
useSsl(Boolean useSsl)
If set totrue
SSL will be used when connecting to an ArangoDB server.ArangoDB.Builder
verifyHost(Boolean verifyHost)
Set whether hostname verification is enabled
-
-
-
Method Detail
-
loadProperties
public ArangoDB.Builder loadProperties(ArangoConfigProperties properties)
-
protocol
public ArangoDB.Builder protocol(Protocol protocol)
-
host
public ArangoDB.Builder host(String host, int port)
Adds a host to connect to. Multiple hosts can be added to provide fallbacks.- Parameters:
host
- address of the hostport
- port of the host- Returns:
ArangoDB.Builder
-
timeout
public ArangoDB.Builder timeout(Integer timeout)
Sets the connection and request timeout in milliseconds.- Parameters:
timeout
- timeout in milliseconds- Returns:
ArangoDB.Builder
-
user
public ArangoDB.Builder user(String user)
Sets the username to use for authentication.- Parameters:
user
- the user in the database (default:root
)- Returns:
ArangoDB.Builder
-
password
public ArangoDB.Builder password(String password)
Sets the password for the user for authentication.- Parameters:
password
- the password of the user in the database (default:null
)- Returns:
ArangoDB.Builder
-
jwt
public ArangoDB.Builder jwt(String jwt)
Sets the JWT for the user authentication.- Parameters:
jwt
- token to use (default:null
)- Returns:
ArangoDB.Builder
-
useSsl
public ArangoDB.Builder useSsl(Boolean useSsl)
If set totrue
SSL will be used when connecting to an ArangoDB server.- Parameters:
useSsl
- whether or not use SSL (default:false
)- Returns:
ArangoDB.Builder
-
sslContext
public ArangoDB.Builder sslContext(SSLContext sslContext)
Sets the SSL context to be used whentrue
is passed throughuseSsl(Boolean)
.- Parameters:
sslContext
- SSL context to be used- Returns:
ArangoDB.Builder
-
verifyHost
public ArangoDB.Builder verifyHost(Boolean verifyHost)
Set whether hostname verification is enabled- Parameters:
verifyHost
-true
if enabled- Returns:
ArangoDB.Builder
-
chunkSize
public ArangoDB.Builder chunkSize(Integer chunkSize)
Sets the chunk size whenProtocol.VST
is used.- Parameters:
chunkSize
- size of a chunk in bytes- Returns:
ArangoDB.Builder
-
maxConnections
public ArangoDB.Builder maxConnections(Integer maxConnections)
Sets the maximum number of connections the built in connection pool will open per host.Defaults:
Protocol.VST
== 1Protocol.HTTP_JSON
== 20Protocol.HTTP_VPACK
== 20- Parameters:
maxConnections
- max number of connections- Returns:
ArangoDB.Builder
-
connectionTtl
public ArangoDB.Builder connectionTtl(Long connectionTtl)
Set the time to live of an inactive connection. After this time of inactivity the connection will be closed automatically.- Parameters:
connectionTtl
- the time to live of a connection in milliseconds- Returns:
ArangoDB.Builder
-
keepAliveInterval
public ArangoDB.Builder keepAliveInterval(Integer keepAliveInterval)
Set the keep-alive interval for VST connections. If set, every VST connection will perform a no-op request everykeepAliveInterval
seconds, to avoid to be closed due to inactivity by the server (or by the external environment, eg. firewall, intermediate routers, operating system).- Parameters:
keepAliveInterval
- interval in seconds- Returns:
ArangoDB.Builder
-
acquireHostList
public ArangoDB.Builder acquireHostList(Boolean acquireHostList)
Whether the driver should acquire a list of available coordinators in an ArangoDB cluster or a single server with active failover. In case of Active-Failover deployment set totrue
to enable automatic master discovery.The host list will be used for failover and load balancing.
- Parameters:
acquireHostList
- whether automatically acquire a list of available hosts (default: false)- Returns:
ArangoDB.Builder
-
acquireHostListInterval
public ArangoDB.Builder acquireHostListInterval(Integer acquireHostListInterval)
Setting the Interval for acquireHostList- Parameters:
acquireHostListInterval
- Interval in milliseconds- Returns:
ArangoDB.Builder
-
loadBalancingStrategy
public ArangoDB.Builder loadBalancingStrategy(LoadBalancingStrategy loadBalancingStrategy)
Sets the load balancing strategy to be used in an ArangoDB cluster setup. In case of Active-Failover deployment set toLoadBalancingStrategy.NONE
or not set at all, since that would be the default.- Parameters:
loadBalancingStrategy
- the load balancing strategy to be used (default:LoadBalancingStrategy.NONE
- Returns:
ArangoDB.Builder
-
responseQueueTimeSamples
public ArangoDB.Builder responseQueueTimeSamples(Integer responseQueueTimeSamples)
Setting the amount of samples kept for queue time metrics- Parameters:
responseQueueTimeSamples
- amount of samples to keep- Returns:
ArangoDB.Builder
-
serde
public ArangoDB.Builder serde(ArangoSerde serde)
Sets the serde for the user data. This is used to serialize and deserialize all the data payload such as: - documents, vertexes, edges - AQL bind vars - body payload of requests and responses inArangoDB.execute(Request, Class)
However, note that the following types will always be serialized and deserialized using the internal serde: -
JsonNode
-RawJson
-RawBytes
-BaseDocument
-BaseEdgeDocument
- Parameters:
serde
- custom serde for the user data- Returns:
ArangoDB.Builder
-
asyncExecutor
@Deprecated public ArangoDB.Builder asyncExecutor(Executor executor)
Deprecated.for removal. To consume the responses in a custom executor use async CompletableFuture methods.Sets the downstream async executor that will be used to consume the responses of the async API, that are returned asCompletableFuture
- Parameters:
executor
- async downstream executor- Returns:
ArangoDB.Builder
-
compression
public ArangoDB.Builder compression(Compression compression)
Sets thecontent-encoding
andaccept-encoding
to use for HTTP requests and the related algorithm to encode and decode the transferred data. (default:Compression.NONE
)- Parameters:
compression
- format- Returns:
ArangoDB.Builder
- Since:
- ArangoDB 3.12
-
compressionThreshold
public ArangoDB.Builder compressionThreshold(Integer threshold)
Sets the minimum HTTP request body size (in bytes) to trigger compression. (default:1024
)- Parameters:
threshold
- body size (in bytes)- Returns:
ArangoDB.Builder
- Since:
- ArangoDB 3.12
-
compressionLevel
public ArangoDB.Builder compressionLevel(Integer level)
Sets the compression level. (default:6
)- Parameters:
level
- compression level between 0 and 9- Returns:
ArangoDB.Builder
- Since:
- ArangoDB 3.12
-
protocolConfig
public ArangoDB.Builder protocolConfig(ProtocolConfig protocolConfig)
Configuration specific forProtocolProvider
.- Returns:
ArangoDB.Builder
-
protocolProvider
protected com.arangodb.internal.net.ProtocolProvider protocolProvider(Protocol protocol)
-
createHostHandler
protected com.arangodb.internal.net.HostHandler createHostHandler(com.arangodb.internal.net.HostResolver hostResolver)
-
createHostResolver
protected com.arangodb.internal.net.HostResolver createHostResolver(Collection<com.arangodb.internal.net.Host> hosts, com.arangodb.internal.net.ConnectionFactory connectionFactory)
-
createHostList
protected Collection<com.arangodb.internal.net.Host> createHostList(com.arangodb.internal.net.ConnectionFactory connectionFactory)
-
-