Package com.arangodb

Class ArangoDB.Builder

  • Enclosing interface:
    ArangoDB

    public static class ArangoDB.Builder
    extends Object
    Builder class to build an instance of ArangoDB.
    Author:
    Mark Vollmary
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • 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 host
        port - port of the host
        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
      • useSsl

        public ArangoDB.Builder useSsl​(Boolean useSsl)
        If set to true SSL will be used when connecting to an ArangoDB server.
        Parameters:
        useSsl - whether or not use SSL (default: false)
        Returns:
        ArangoDB.Builder
      • connectionTtl

        public ArangoDB.Builder connectionTtl​(Long connectionTtl)
        Set the maximum time to life of a connection. After this time the connection will be closed automatically.
        Parameters:
        connectionTtl - the maximum time to life 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 every keepAliveInterval 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 to true 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
      • 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
      • asyncExecutor

        public ArangoDB.Builder asyncExecutor​(Executor executor)
        Sets the downstream async executor that will be used to consume the responses of the async API, that are returned as CompletableFuture
        Parameters:
        executor - async downstream executor
        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)