Modifier and Type | Field and Description |
---|---|
protected Protocol |
protocol |
acquireHostList, acquireHostListInterval, chunksize, connectionTtl, customSerializer, deserializer, host, hostnameVerifier, hosts, httpCookieSpec, httpRequestRetryHandler, keepAliveInterval, loadBalancingStrategy, maxConnections, password, 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)
Register a custom
VPackAnnotationFieldFilter for a specific type to be used within the internal
serialization process. |
<A extends Annotation> |
annotationFieldNaming(Class<A> type,
com.arangodb.velocypack.VPackAnnotationFieldNaming<A> fieldNaming)
Register a custom
VPackAnnotationFieldNaming for a specific type to be used within the internal
serialization process. |
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 |
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)
Register a custom
VPackDeserializer for a specific type to be used within the internal serialization
process. |
<T> ArangoDB.Builder |
registerEnclosingSerializer(Class<T> clazz,
com.arangodb.velocypack.VPackSerializer<T> serializer)
Register a special serializer for a member class which can only be identified by its enclosing class.
|
<T> ArangoDB.Builder |
registerInstanceCreator(Class<T> clazz,
com.arangodb.velocypack.VPackInstanceCreator<T> creator)
Register a custom
VPackInstanceCreator for a specific type to be used within the internal
serialization process. |
ArangoDB.Builder |
registerJsonDeserializer(String attribute,
com.arangodb.velocypack.ValueType type,
com.arangodb.velocypack.VPackJsonDeserializer deserializer)
Register a custom
VPackJsonDeserializer for a specific type and attribute name to be used within the
internal serialization process. |
ArangoDB.Builder |
registerJsonDeserializer(com.arangodb.velocypack.ValueType type,
com.arangodb.velocypack.VPackJsonDeserializer deserializer)
Register a custom
VPackJsonDeserializer for a specific type to be used within the internal
serialization process. |
ArangoDB.Builder |
registerJsonModule(com.arangodb.velocypack.VPackParserModule module)
Register a
VPackParserModule to be used within the internal serialization process. |
ArangoDB.Builder |
registerJsonModules(com.arangodb.velocypack.VPackParserModule... modules)
Register a list of
VPackParserModule to be used within the internal serialization process. |
<T> ArangoDB.Builder |
registerJsonSerializer(Class<T> clazz,
com.arangodb.velocypack.VPackJsonSerializer<T> serializer)
Register a custom
VPackJsonSerializer for a specific type to be used within the internal
serialization process. |
<T> ArangoDB.Builder |
registerJsonSerializer(String attribute,
Class<T> clazz,
com.arangodb.velocypack.VPackJsonSerializer<T> serializer)
Register a custom
VPackJsonSerializer for a specific type and attribute name to be used within the
internal serialization process. |
ArangoDB.Builder |
registerModule(com.arangodb.velocypack.VPackModule module)
Register a
VPackModule to be used within the internal serialization process. |
ArangoDB.Builder |
registerModules(com.arangodb.velocypack.VPackModule... modules)
Register a list of
VPackModule to be used within the internal serialization process. |
<T> ArangoDB.Builder |
registerSerializer(Class<T> clazz,
com.arangodb.velocypack.VPackSerializer<T> serializer)
Register a custom
VPackSerializer for a specific type to be used within the internal serialization
process. |
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, setKeepAliveInterval, setLoadBalancingStrategy, setMaxConnections, setPassword, 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 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
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 SecondsArangoDB.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 <T> ArangoDB.Builder registerSerializer(Class<T> clazz, com.arangodb.velocypack.VPackSerializer<T> serializer)
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
public <T> ArangoDB.Builder registerEnclosingSerializer(Class<T> clazz, com.arangodb.velocypack.VPackSerializer<T> serializer)
Attention:can not be used together with serializer(ArangoSerialization)
clazz
- the type of the enclosing classserializer
- serializer to registerArangoDB.Builder
public <T> ArangoDB.Builder registerDeserializer(Class<T> clazz, com.arangodb.velocypack.VPackDeserializer<T> deserializer)
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
public <T> ArangoDB.Builder registerInstanceCreator(Class<T> clazz, com.arangodb.velocypack.VPackInstanceCreator<T> creator)
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
public ArangoDB.Builder registerJsonDeserializer(com.arangodb.velocypack.ValueType type, com.arangodb.velocypack.VPackJsonDeserializer deserializer)
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
public ArangoDB.Builder registerJsonDeserializer(String attribute, com.arangodb.velocypack.ValueType type, com.arangodb.velocypack.VPackJsonDeserializer deserializer)
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
public <T> ArangoDB.Builder registerJsonSerializer(Class<T> clazz, com.arangodb.velocypack.VPackJsonSerializer<T> serializer)
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
public <T> ArangoDB.Builder registerJsonSerializer(String attribute, Class<T> clazz, com.arangodb.velocypack.VPackJsonSerializer<T> serializer)
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
public <A extends Annotation> ArangoDB.Builder annotationFieldFilter(Class<A> type, com.arangodb.velocypack.VPackAnnotationFieldFilter<A> fieldFilter)
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
public <A extends Annotation> ArangoDB.Builder annotationFieldNaming(Class<A> type, com.arangodb.velocypack.VPackAnnotationFieldNaming<A> fieldNaming)
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
public ArangoDB.Builder registerModule(com.arangodb.velocypack.VPackModule module)
VPackModule
to be used within the internal serialization process.
Attention:can not be used together with serializer(ArangoSerialization)
module
- module to registerArangoDB.Builder
public ArangoDB.Builder registerModules(com.arangodb.velocypack.VPackModule... modules)
VPackModule
to be used within the internal serialization process.
Attention:can not be used together with serializer(ArangoSerialization)
modules
- modules to registerArangoDB.Builder
public ArangoDB.Builder registerJsonModule(com.arangodb.velocypack.VPackParserModule module)
VPackParserModule
to be used within the internal serialization process.
Attention:can not be used together with serializer(ArangoSerialization)
module
- module to registerArangoDB.Builder
public ArangoDB.Builder registerJsonModules(com.arangodb.velocypack.VPackParserModule... 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–2021 ArangoDB GmbH. All rights reserved.