Package com.fauna.client
Class FaunaConfig
- java.lang.Object
-
- com.fauna.client.FaunaConfig
-
public final class FaunaConfig extends java.lang.Object
FaunaConfig is a configuration class used to set up and configure a connection to Fauna. It encapsulates various settings such as the endpoint URL, secret key, and more.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FaunaConfig.Builder
Builder class for FaunaConfig.static class
FaunaConfig.FaunaEndpoint
static class
FaunaConfig.FaunaEnvironment
This class handles reading Fauna environment variables for the client.
-
Field Summary
Fields Modifier and Type Field Description static FaunaConfig
DEFAULT
static FaunaConfig
LOCAL
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FaunaConfig.Builder
builder()
Creates a new builder for FaunaConfig.java.time.Duration
getClientTimeoutBuffer()
Gets the buffer that will be added to the HTTP client timeout, in addition to any query timeout.java.lang.String
getEndpoint()
Gets the Fauna endpoint URL.java.util.logging.Handler
getLogHandler()
Gets the log handler that the client will use.int
getMaxContentionRetries()
Gets the number of contention retries that the Fauna server will attempt.java.lang.String
getSecret()
Gets the secret key used for authentication.StatsCollector
getStatsCollector()
Gets the stats collector for the client.
-
-
-
Field Detail
-
DEFAULT
public static final FaunaConfig DEFAULT
-
LOCAL
public static final FaunaConfig LOCAL
-
-
Method Detail
-
getEndpoint
public java.lang.String getEndpoint()
Gets the Fauna endpoint URL.- Returns:
- A String representing the endpoint URL. The default is https://db.fauna.com
-
getSecret
public java.lang.String getSecret()
Gets the secret key used for authentication.- Returns:
- A String representing the secret key.
-
getMaxContentionRetries
public int getMaxContentionRetries()
Gets the number of contention retries that the Fauna server will attempt.- Returns:
- An integer value.
-
getClientTimeoutBuffer
public java.time.Duration getClientTimeoutBuffer()
Gets the buffer that will be added to the HTTP client timeout, in addition to any query timeout.- Returns:
- The timeout buffer Duration.
-
getLogHandler
public java.util.logging.Handler getLogHandler()
Gets the log handler that the client will use.- Returns:
- A log handler instance.
-
getStatsCollector
public StatsCollector getStatsCollector()
Gets the stats collector for the client.- Returns:
- A StatsCollector instance.
-
builder
public static FaunaConfig.Builder builder()
Creates a new builder for FaunaConfig.- Returns:
- A new instance of Builder.
-
-