Modifier and Type | Field and Description |
---|---|
protected Protocol |
protocol |
acquireHostList, acquireHostListInterval, chunksize, connectionTtl, customSerializer, deserializer, host, hostnameVerifier, hosts, httpCookieSpec, httpRequestRetryHandler, jwt, keepAliveInterval, loadBalancingStrategy, maxConnections, password, responseQueueTimeSamples, serializer, sslContext, timeout, user, useSsl, vpackBuilder, vpackParserBuilder
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
ArangoDB.Builder |
acquireHostList(Boolean acquireHostList)
Whether or not 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 acquireHostList
|
<A extends Annotation> |
annotationFieldFilter(Class<A> type,
com.arangodb.velocypack.VPackAnnotationFieldFilter<A> fieldFilter)
Deprecated.
Use
ArangoJack instead and register custom serializers and deserializers by implementing JsonSerializer and JsonDeserializer . |
<A extends Annotation> |
annotationFieldNaming(Class<A> type,
com.arangodb.velocypack.VPackAnnotationFieldNaming<A> fieldNaming)
Deprecated.
Use
ArangoJack instead and register custom serializers and deserializers by implementing JsonSerializer and JsonDeserializer . |
ArangoDB |
build()
Returns an instance of
ArangoDB . |
ArangoDB.Builder |
chunksize(Integer chunksize)
Sets the chunk size when
Protocol.VST is used. |
ArangoDB.Builder |
connectionTtl(Long connectionTtl)
Set the maximum time to life of a connection.
|
ArangoDB.Builder |
host(String host,
int port)
Adds a host to connect to.
|
ArangoDB.Builder |
hostnameVerifier(HostnameVerifier hostnameVerifier)
Sets the
HostnameVerifier to be used when using ssl with http protocol. |
ArangoDB.Builder |
httpRequestRetryHandler(org.apache.http.client.HttpRequestRetryHandler httpRequestRetryHandler)
Sets the
HttpRequestRetryHandler to be used when using http protocol. |
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(InputStream in) |
protected void |
loadProperties(Properties 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.
|
<T> ArangoDB.Builder |
registerDeserializer(Class<T> clazz,
com.arangodb.velocypack.VPackDeserializer<T> deserializer)
Deprecated.
Use
ArangoJack instead and register custom serializers and deserializers by implementing JsonSerializer and JsonDeserializer . |
<T> ArangoDB.Builder |
registerEnclosingSerializer(Class<T> clazz,
com.arangodb.velocypack.VPackSerializer<T> serializer)
Deprecated.
Use
ArangoJack instead and register custom serializers and deserializers by implementing JsonSerializer and JsonDeserializer . |
<T> ArangoDB.Builder |
registerInstanceCreator(Class<T> clazz,
com.arangodb.velocypack.VPackInstanceCreator<T> creator)
Deprecated.
Use
ArangoJack instead and register custom serializers and deserializers by implementing JsonSerializer and JsonDeserializer . |
ArangoDB.Builder |
registerJsonDeserializer(String attribute,
com.arangodb.velocypack.ValueType type,
com.arangodb.velocypack.VPackJsonDeserializer deserializer)
Deprecated.
Use
ArangoJack instead and register custom serializers and deserializers by implementing JsonSerializer and JsonDeserializer . |
ArangoDB.Builder |
registerJsonDeserializer(com.arangodb.velocypack.ValueType type,
com.arangodb.velocypack.VPackJsonDeserializer deserializer)
Deprecated.
Use
ArangoJack instead and register custom serializers and deserializers by implementing JsonSerializer and JsonDeserializer . |
ArangoDB.Builder |
registerJsonModule(com.arangodb.velocypack.VPackParserModule module)
Deprecated.
Use
ArangoJack instead and register custom modules. |
ArangoDB.Builder |
registerJsonModules(com.arangodb.velocypack.VPackParserModule... modules)
Deprecated.
Use
ArangoJack instead and register custom modules. |
<T> ArangoDB.Builder |
registerJsonSerializer(Class<T> clazz,
com.arangodb.velocypack.VPackJsonSerializer<T> serializer)
Deprecated.
Use
ArangoJack instead and register custom serializers and deserializers by implementing JsonSerializer and JsonDeserializer . |
<T> ArangoDB.Builder |
registerJsonSerializer(String attribute,
Class<T> clazz,
com.arangodb.velocypack.VPackJsonSerializer<T> serializer)
Deprecated.
Use
ArangoJack instead and register custom serializers and deserializers by implementing JsonSerializer and JsonDeserializer . |
ArangoDB.Builder |
registerModule(com.arangodb.velocypack.VPackModule module)
Deprecated.
Use
ArangoJack instead and register custom modules. |
ArangoDB.Builder |
registerModules(com.arangodb.velocypack.VPackModule... modules)
Deprecated.
Use
ArangoJack instead and register custom modules. |
<T> ArangoDB.Builder |
registerSerializer(Class<T> clazz,
com.arangodb.velocypack.VPackSerializer<T> serializer)
Deprecated.
Use
ArangoJack instead and register custom serializers and deserializers by implementing JsonSerializer and JsonDeserializer . |
ArangoDB.Builder |
responseQueueTimeSamples(Integer responseQueueTimeSamples)
Setting the amount of samples kept for queue time metrics
|
ArangoDB.Builder |
serializer(ArangoSerialization serialization)
Replace the built-in serializer/deserializer with the given one.
|
ArangoDB.Builder |
setDeserializer(ArangoDeserializer deserializer)
Deprecated.
use
serializer(ArangoSerialization) instead |
ArangoDB.Builder |
setSerializer(ArangoSerializer serializer)
Deprecated.
use
serializer(ArangoSerialization) instead |
ArangoDB.Builder |
sslContext(SSLContext sslContext)
Sets the SSL context to be used when
true is passed through useSsl(Boolean) . |
ArangoDB.Builder |
timeout(Integer timeout)
Sets the connection and request timeout in milliseconds.
|
ArangoDB.Builder |
useProtocol(Protocol protocol) |
ArangoDB.Builder |
user(String user)
Sets the username to use for authentication.
|
ArangoDB.Builder |
useSsl(Boolean useSsl)
If set to
true SSL will be used when connecting to an ArangoDB server. |
createHostHandler, createHostList, createHostResolver, deserializer, getProperty, serializer, setAcquireHostList, setAcquireHostListInterval, setChunksize, setConnectionTtl, setHost, setHostnameVerifier, setHttpRequestRetryHandler, setJwt, setKeepAliveInterval, setLoadBalancingStrategy, setMaxConnections, setPassword, setResponseQueueTimeSamples, setSerializer, setSslContext, setTimeout, setUser, setUseSsl
protected Protocol protocol
protected void loadProperties(Properties properties)
loadProperties
in class com.arangodb.internal.InternalArangoDBBuilder
public ArangoDB.Builder useProtocol(Protocol protocol)
public ArangoDB.Builder loadProperties(InputStream in) throws ArangoDBException
loadProperties
in class com.arangodb.internal.InternalArangoDBBuilder
ArangoDBException
public ArangoDB.Builder host(String host, int port)
host
- address of the hostport
- port of the hostArangoDB.Builder
public ArangoDB.Builder timeout(Integer timeout)
timeout
- timeout in millisecondsArangoDB.Builder
public ArangoDB.Builder user(String user)
user
- the user in the database (default: root
)ArangoDB.Builder
public ArangoDB.Builder password(String password)
password
- the password of the user in the database (default: null
)ArangoDB.Builder
public ArangoDB.Builder jwt(String jwt)
jwt
- token to use (default: null
)ArangoDB.Builder
public ArangoDB.Builder useSsl(Boolean useSsl)
true
SSL will be used when connecting to an ArangoDB server.useSsl
- whether or not use SSL (default: false
)ArangoDB.Builder
public ArangoDB.Builder sslContext(SSLContext sslContext)
true
is passed through useSsl(Boolean)
.sslContext
- SSL context to be usedArangoDB.Builder
public ArangoDB.Builder hostnameVerifier(HostnameVerifier hostnameVerifier)
HostnameVerifier
to be used when using ssl with http protocol.hostnameVerifier
- HostnameVerifier to be usedArangoDB.Builder
public ArangoDB.Builder httpRequestRetryHandler(org.apache.http.client.HttpRequestRetryHandler httpRequestRetryHandler)
HttpRequestRetryHandler
to be used when using http protocol.httpRequestRetryHandler
- HttpRequestRetryHandler to be usedArangoDB.Builder
NOTE:
Some ArangoDB HTTP endpoints do not honor RFC-2616 HTTP 1.1 specification in respect to
9.1 Safe and Idempotent Methods.
Please refer to HTTP API Documentation for details.
public ArangoDB.Builder chunksize(Integer chunksize)
Protocol.VST
is used.chunksize
- size of a chunk in bytesArangoDB.Builder
public ArangoDB.Builder maxConnections(Integer maxConnections)
Defaults:
Protocol.VST
== 1Protocol.HTTP_JSON
== 20Protocol.HTTP_VPACK
== 20
maxConnections
- max number of connectionsArangoDB.Builder
public ArangoDB.Builder connectionTtl(Long connectionTtl)
connectionTtl
- the maximum time to life of a connection in millisecondsArangoDB.Builder
public ArangoDB.Builder keepAliveInterval(Integer keepAliveInterval)
keepAliveInterval
seconds, to avoid to be closed due to inactivity by the server (or by the external
environment, eg. firewall, intermediate routers, operating system).keepAliveInterval
- interval in secondsArangoDB.Builder
public ArangoDB.Builder acquireHostList(Boolean acquireHostList)
true
to enable automatic master discovery.
The host list will be used for failover and load balancing.
acquireHostList
- whether or not automatically acquire a list of available hosts (default: false)ArangoDB.Builder
public ArangoDB.Builder acquireHostListInterval(Integer acquireHostListInterval)
acquireHostListInterval
- Interval in millisecondsArangoDB.Builder
public ArangoDB.Builder loadBalancingStrategy(LoadBalancingStrategy loadBalancingStrategy)
LoadBalancingStrategy.NONE
or not set at all, since that
would be the default.loadBalancingStrategy
- the load balancing strategy to be used (default: LoadBalancingStrategy.NONE
ArangoDB.Builder
public ArangoDB.Builder responseQueueTimeSamples(Integer responseQueueTimeSamples)
responseQueueTimeSamples
- amount of samples to keepArangoDB.Builder
@Deprecated public <T> ArangoDB.Builder registerSerializer(Class<T> clazz, com.arangodb.velocypack.VPackSerializer<T> serializer)
ArangoJack
instead and register custom serializers and deserializers by implementing JsonSerializer
and JsonDeserializer
.VPackSerializer
for a specific type to be used within the internal serialization
process.
Attention:can not be used together with serializer(ArangoSerialization)
clazz
- the type the serializer should be registered forserializer
- serializer to registerArangoDB.Builder
@Deprecated public <T> ArangoDB.Builder registerEnclosingSerializer(Class<T> clazz, com.arangodb.velocypack.VPackSerializer<T> serializer)
ArangoJack
instead and register custom serializers and deserializers by implementing JsonSerializer
and JsonDeserializer
.
Attention:can not be used together with serializer(ArangoSerialization)
clazz
- the type of the enclosing classserializer
- serializer to registerArangoDB.Builder
@Deprecated public <T> ArangoDB.Builder registerDeserializer(Class<T> clazz, com.arangodb.velocypack.VPackDeserializer<T> deserializer)
ArangoJack
instead and register custom serializers and deserializers by implementing JsonSerializer
and JsonDeserializer
.VPackDeserializer
for a specific type to be used within the internal serialization
process.
Attention:can not be used together with serializer(ArangoSerialization)
clazz
- the type the serializer should be registered fordeserializer
- ArangoDB.Builder
@Deprecated public <T> ArangoDB.Builder registerInstanceCreator(Class<T> clazz, com.arangodb.velocypack.VPackInstanceCreator<T> creator)
ArangoJack
instead and register custom serializers and deserializers by implementing JsonSerializer
and JsonDeserializer
.VPackInstanceCreator
for a specific type to be used within the internal
serialization process.
Attention:can not be used together with serializer(ArangoSerialization)
clazz
- the type the instance creator should be registered forcreator
- ArangoDB.Builder
@Deprecated public ArangoDB.Builder registerJsonDeserializer(com.arangodb.velocypack.ValueType type, com.arangodb.velocypack.VPackJsonDeserializer deserializer)
ArangoJack
instead and register custom serializers and deserializers by implementing JsonSerializer
and JsonDeserializer
.VPackJsonDeserializer
for a specific type to be used within the internal
serialization process.
Attention:can not be used together with serializer(ArangoSerialization)
type
- the type the serializer should be registered fordeserializer
- ArangoDB.Builder
@Deprecated public ArangoDB.Builder registerJsonDeserializer(String attribute, com.arangodb.velocypack.ValueType type, com.arangodb.velocypack.VPackJsonDeserializer deserializer)
ArangoJack
instead and register custom serializers and deserializers by implementing JsonSerializer
and JsonDeserializer
.VPackJsonDeserializer
for a specific type and attribute name to be used within the
internal serialization process.
Attention:can not be used together with serializer(ArangoSerialization)
attribute
- type
- the type the serializer should be registered fordeserializer
- ArangoDB.Builder
@Deprecated public <T> ArangoDB.Builder registerJsonSerializer(Class<T> clazz, com.arangodb.velocypack.VPackJsonSerializer<T> serializer)
ArangoJack
instead and register custom serializers and deserializers by implementing JsonSerializer
and JsonDeserializer
.VPackJsonSerializer
for a specific type to be used within the internal
serialization process.
Attention:can not be used together with serializer(ArangoSerialization)
clazz
- the type the serializer should be registered forserializer
- ArangoDB.Builder
@Deprecated public <T> ArangoDB.Builder registerJsonSerializer(String attribute, Class<T> clazz, com.arangodb.velocypack.VPackJsonSerializer<T> serializer)
ArangoJack
instead and register custom serializers and deserializers by implementing JsonSerializer
and JsonDeserializer
.VPackJsonSerializer
for a specific type and attribute name to be used within the
internal serialization process.
Attention:can not be used together with serializer(ArangoSerialization)
attribute
- clazz
- the type the serializer should be registered forserializer
- ArangoDB.Builder
@Deprecated public <A extends Annotation> ArangoDB.Builder annotationFieldFilter(Class<A> type, com.arangodb.velocypack.VPackAnnotationFieldFilter<A> fieldFilter)
ArangoJack
instead and register custom serializers and deserializers by implementing JsonSerializer
and JsonDeserializer
.VPackAnnotationFieldFilter
for a specific type to be used within the internal
serialization process.
Attention:can not be used together with serializer(ArangoSerialization)
type
- the type the serializer should be registered forfieldFilter
- ArangoDB.Builder
@Deprecated public <A extends Annotation> ArangoDB.Builder annotationFieldNaming(Class<A> type, com.arangodb.velocypack.VPackAnnotationFieldNaming<A> fieldNaming)
ArangoJack
instead and register custom serializers and deserializers by implementing JsonSerializer
and JsonDeserializer
.VPackAnnotationFieldNaming
for a specific type to be used within the internal
serialization process.
Attention:can not be used together with serializer(ArangoSerialization)
type
- the type the serializer should be registered forfieldNaming
- ArangoDB.Builder
@Deprecated public ArangoDB.Builder registerModule(com.arangodb.velocypack.VPackModule module)
ArangoJack
instead and register custom modules.VPackModule
to be used within the internal serialization process.
Attention:can not be used together with serializer(ArangoSerialization)
module
- module to registerArangoDB.Builder
@Deprecated public ArangoDB.Builder registerModules(com.arangodb.velocypack.VPackModule... modules)
ArangoJack
instead and register custom modules.VPackModule
to be used within the internal serialization process.
Attention:can not be used together with serializer(ArangoSerialization)
modules
- modules to registerArangoDB.Builder
@Deprecated public ArangoDB.Builder registerJsonModule(com.arangodb.velocypack.VPackParserModule module)
ArangoJack
instead and register custom modules.VPackParserModule
to be used within the internal serialization process.
Attention:can not be used together with serializer(ArangoSerialization)
module
- module to registerArangoDB.Builder
@Deprecated public ArangoDB.Builder registerJsonModules(com.arangodb.velocypack.VPackParserModule... modules)
ArangoJack
instead and register custom modules.VPackParserModule
to be used within the internal serialization process.
Attention:can not be used together with serializer(ArangoSerialization)
modules
- modules to registerArangoDB.Builder
@Deprecated public ArangoDB.Builder setSerializer(ArangoSerializer serializer)
serializer(ArangoSerialization)
instead
ATTENTION!: Use at your own risk
serializer
- custom serializerArangoDB.Builder
@Deprecated public ArangoDB.Builder setDeserializer(ArangoDeserializer deserializer)
serializer(ArangoSerialization)
instead
ATTENTION!: Use at your own risk
deserializer
- custom deserializerArangoDB.Builder
public ArangoDB.Builder serializer(ArangoSerialization serialization)
ATTENTION!: Any registered custom serializer/deserializer or module will be ignored.
serialization
- custom serializer/deserializerArangoDB.Builder
Copyright © 2016–2023 ArangoDB GmbH. All rights reserved.