public static class ArangoDBAsync.Builder
extends com.arangodb.internal.InternalArangoDBBuilder
ArangoDBAsync
.acquireHostList, acquireHostListInterval, chunksize, connectionTtl, customSerializer, deserializer, host, hostnameVerifier, hosts, httpCookieSpec, loadBalancingStrategy, maxConnections, password, serializer, sslContext, timeout, user, useSsl, vpackBuilder, vpackParserBuilder
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
ArangoDBAsync.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.
|
<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. |
ArangoDBAsync |
build()
Returns an instance of
ArangoDBAsync . |
ArangoDBAsync.Builder |
chunksize(Integer chunksize)
Sets the chunk size when
Protocol.VST is used. |
ArangoDBAsync.Builder |
connectionTtl(Long connectionTtl)
Set the maximum time to life of a connection.
|
ArangoDBAsync.Builder |
host(String host,
int port)
Adds a host to connect to.
|
ArangoDBAsync.Builder |
loadBalancingStrategy(LoadBalancingStrategy loadBalancingStrategy)
Sets the load balancing strategy to be used in an ArangoDB cluster setup.
|
ArangoDBAsync.Builder |
loadProperties(InputStream in) |
ArangoDBAsync.Builder |
maxConnections(Integer maxConnections)
Sets the maximum number of connections the built in connection pool will open.
|
ArangoDBAsync.Builder |
password(String password)
Sets the password for the user for authentication.
|
<T> ArangoDBAsync.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> ArangoDBAsync.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> ArangoDBAsync.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. |
ArangoDBAsync.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. |
ArangoDBAsync.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. |
ArangoDBAsync.Builder |
registerJsonModule(com.arangodb.velocypack.VPackParserModule module)
Register a
VPackParserModule to be used within the internal serialization process. |
ArangoDBAsync.Builder |
registerJsonModules(com.arangodb.velocypack.VPackParserModule... modules)
Register a list of
VPackParserModule to be used within the internal serialization process. |
<T> ArangoDBAsync.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> ArangoDBAsync.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. |
ArangoDBAsync.Builder |
registerModule(com.arangodb.velocypack.VPackModule module)
Register a
VPackModule to be used within the internal serialization process. |
ArangoDBAsync.Builder |
registerModules(com.arangodb.velocypack.VPackModule... modules)
Register a list of
VPackModule to be used within the internal serialization process. |
<T> ArangoDBAsync.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. |
ArangoDBAsync.Builder |
serializer(ArangoSerialization serialization)
Replace the built-in serializer/deserializer with the given one.
|
ArangoDBAsync.Builder |
setDeserializer(ArangoDeserializer deserializer)
Deprecated.
use
serializer(ArangoSerialization) instead |
ArangoDBAsync.Builder |
setSerializer(ArangoSerializer serializer)
Deprecated.
use
serializer(ArangoSerialization) instead |
ArangoDBAsync.Builder |
sslContext(SSLContext sslContext)
Sets the SSL context to be used when
true is passed through useSsl(Boolean) . |
ArangoDBAsync.Builder |
timeout(Integer timeout)
Sets the timeout in milliseconds.
|
ArangoDBAsync.Builder |
user(String user)
Sets the username to use for authentication.
|
ArangoDBAsync.Builder |
useSsl(Boolean useSsl)
If set to
true SSL will be used when connecting to an ArangoDB server. |
createHostHandler, createHostList, createHostResolver, deserializer, getProperty, loadProperties, serializer, setAcquireHostList, setAcquireHostListInterval, setChunksize, setConnectionTtl, setHost, setHostnameVerifier, setLoadBalancingStrategy, setMaxConnections, setPassword, setSerializer, setSslContext, setTimeout, setUser, setUseSsl
public ArangoDBAsync.Builder loadProperties(InputStream in) throws ArangoDBException
loadProperties
in class com.arangodb.internal.InternalArangoDBBuilder
ArangoDBException
public ArangoDBAsync.Builder host(String host, int port)
host
- address of the hostport
- port of the hostArangoDBAsync.Builder
public ArangoDBAsync.Builder timeout(Integer timeout)
timeout
- timeout in millisecondsArangoDBAsync.Builder
public ArangoDBAsync.Builder user(String user)
user
- the user in the database (default: root
)ArangoDBAsync.Builder
public ArangoDBAsync.Builder password(String password)
password
- the password of the user in the database (default: null
)ArangoDBAsync.Builder
public ArangoDBAsync.Builder useSsl(Boolean useSsl)
true
SSL will be used when connecting to an ArangoDB server.useSsl
- whether or not use SSL (default: false
)ArangoDBAsync.Builder
public ArangoDBAsync.Builder sslContext(SSLContext sslContext)
true
is passed through useSsl(Boolean)
.sslContext
- SSL context to be usedArangoDBAsync.Builder
public ArangoDBAsync.Builder chunksize(Integer chunksize)
Protocol.VST
is used.chunksize
- size of a chunk in bytesArangoDBAsync.Builder
public ArangoDBAsync.Builder maxConnections(Integer maxConnections)
In an ArangoDB cluster setup with LoadBalancingStrategy.ROUND_ROBIN
set, this value should be at
least as high as the number of ArangoDB coordinators in the cluster.
maxConnections
- max number of connections (default: 1)ArangoDBAsync.Builder
public ArangoDBAsync.Builder connectionTtl(Long connectionTtl)
connectionTtl
- the maximum time to life of a connection.ArangoDBAsync.Builder
public ArangoDBAsync.Builder acquireHostList(Boolean acquireHostList)
The host list will be used for failover and load balancing.
acquireHostList
- whether or not automatically acquire a list of available hosts (default: false)ArangoDBAsync.Builder
public ArangoDBAsync.Builder loadBalancingStrategy(LoadBalancingStrategy loadBalancingStrategy)
loadBalancingStrategy
- the load balancing strategy to be used (default: LoadBalancingStrategy.NONE
ArangoDBAsync.Builder
public <T> ArangoDBAsync.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 registerArangoDBAsync.Builder
public <T> ArangoDBAsync.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 registerArangoDBAsync.Builder
public <T> ArangoDBAsync.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
- ArangoDBAsync.Builder
public <T> ArangoDBAsync.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
- ArangoDBAsync.Builder
public ArangoDBAsync.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
- ArangoDBAsync.Builder
public ArangoDBAsync.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
- ArangoDBAsync.Builder
public <T> ArangoDBAsync.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
- ArangoDBAsync.Builder
public <T> ArangoDBAsync.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
- ArangoDBAsync.Builder
public <A extends Annotation> ArangoDBAsync.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
- ArangoDBAsync.Builder
public <A extends Annotation> ArangoDBAsync.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
- ArangoDBAsync.Builder
public ArangoDBAsync.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 registerArangoDBAsync.Builder
public ArangoDBAsync.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 registerArangoDBAsync.Builder
public ArangoDBAsync.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 registerArangoDBAsync.Builder
public ArangoDBAsync.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 registerArangoDBAsync.Builder
@Deprecated public ArangoDBAsync.Builder setSerializer(ArangoSerializer serializer)
serializer(ArangoSerialization)
instead
ATTENTION!: Use at your own risk
serializer
- custom serializerArangoDBAsync.Builder
@Deprecated public ArangoDBAsync.Builder setDeserializer(ArangoDeserializer deserializer)
serializer(ArangoSerialization)
instead
ATTENTION!: Use at your own risk
deserializer
- custom deserializerArangoDBAsync.Builder
public ArangoDBAsync.Builder serializer(ArangoSerialization serialization)
ATTENTION!: Any registered custom serializer/deserializer or module will be ignored.
serialization
- custom serializer/deserializerArangoDBAsync.Builder
public ArangoDBAsync build()
ArangoDBAsync
.ArangoDBAsync
Copyright © 2016–2020 ArangoDB GmbH. All rights reserved.