Warning:
Fauna is decommissioning FQL v4 on June 30, 2025.
This driver is not compatible with FQL v10, the latest version. Fauna accounts created after August 21, 2024 must use FQL v10.
Ensure you migrate existing projects to the official v10 driver by the v4 EOL date: https://github.com/fauna/fauna-jvm.
For more information, see the v4 end of life (EOL) announcement and related FAQ.
public static class Connection.Builder
extends java.lang.Object
Connection
instance. Use the Connection.builder()
method to create
an instance of the Connection.Builder
class.Modifier and Type | Method and Description |
---|---|
Connection |
build() |
Connection.Builder |
withAuthToken(java.lang.String token)
Sets the authentication token or key for the
Connection instance. |
Connection.Builder |
withFaunaRoot(java.lang.String root)
Sets the FaunaDB root URL for the
Connection instance. |
Connection.Builder |
withFaunaRoot(java.net.URL root)
Sets the FaunaDB root URL for the
Connection instance. |
Connection.Builder |
withHttpClient(HttpClient client)
Sets the client to use for the connection.
|
Connection.Builder |
withLastSeenTxn(long txnTime)
Sets the last seen transaction time for the connection.
|
Connection.Builder |
withMetrics(com.codahale.metrics.MetricRegistry registry)
Sets a
MetricRegistry for the Connection instance. |
public Connection.Builder withFaunaRoot(java.lang.String root) throws java.net.MalformedURLException
Connection
instance.root
- the root URL, as a RFC 2396 formatted string. Example: https://db.fauna.comConnection.Builder
objectjava.net.MalformedURLException
- if a malformed url is providedpublic Connection.Builder withFaunaRoot(java.net.URL root)
Connection
instance.root
- the root URLConnection.Builder
objectpublic Connection.Builder withAuthToken(java.lang.String token)
Connection
instance.token
- the auth token or keyConnection.Builder
objectpublic Connection.Builder withMetrics(com.codahale.metrics.MetricRegistry registry)
MetricRegistry
for the Connection
instance.
The MetricRegistry
will be used to track connection level statistics.registry
- the MetricRegistry
instance.Connection.Builder
objectpublic Connection.Builder withLastSeenTxn(long txnTime)
txnTime
- the last seen transaction time in microseconds.Connection.Builder
objectpublic Connection.Builder withHttpClient(HttpClient client)
client
- the HttpClient
to use for this connection.Connection.Builder
objectpublic Connection build()
Connection
with its configuration based on
the settings of the Connection.Builder
instance.