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 Object
Connection. Use Connection.builder() to obtain
an instance of this builder.| Modifier and Type | Method and Description |
|---|---|
Connection |
build()
Returns a newly constructed
Connection with configuration based on the settings of this Connection.Builder. |
Connection.Builder |
withAuthToken(String token)
Sets the Auth Token that the built
Connection will provide to FaunaDB. |
Connection.Builder |
withFaunaRoot(String root)
Sets the FaunaDB root URL for the built
Connection. |
Connection.Builder |
withFaunaRoot(URL root)
Sets the FaunaDB root URL for the built
Connection. |
Connection.Builder |
withHttpClient(AsyncHttpClient client)
Sets a custom
AsyncHttpClient implementation that the built Connection will use. |
Connection.Builder |
withMetrics(MetricRegistry registry)
Sets a
MetricRegistry that the Connection will use to register and track Connection-level statistics. |
public Connection.Builder withFaunaRoot(String root) throws MalformedURLException
Connection.root - the root URL, as a RFC 2396 formatted string. Example: https://db.fauna.comConnection.Builder objectMalformedURLException - if root is not RFC 2396.public Connection.Builder withFaunaRoot(URL root)
Connection.root - the root URLConnection.Builder objectpublic Connection.Builder withAuthToken(String token)
Connection will provide to FaunaDB. This must be provided in order
for client to authenticate with FaunaDB.token - the auth token.Connection.Builder objectpublic Connection.Builder withHttpClient(AsyncHttpClient client)
AsyncHttpClient implementation that the built Connection will use. This custom implementation
can be provided to control the behavior of the underlying HTTP transport.client - the custom AsyncHttpClient instanceConnection.Builder objectpublic Connection.Builder withMetrics(MetricRegistry registry)
MetricRegistry that the Connection will use to register and track Connection-level statistics.registry - the MetricRegistry instance.Connection.Builder objectpublic Connection build()
Connection with configuration based on the settings of this Connection.Builder.