Package codes.grow.packages.betterstack
Class BetterStackClient.Builder
java.lang.Object
codes.grow.packages.betterstack.BetterStackClient.Builder
- Enclosing class:
BetterStackClient
Builder that configures and creates a client in one chain.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configuration and the client.Sets the connect timeout.encoding(IngestEncoding encoding) Sets the ingest body encoding.Fills unset fields from an environment reader.Adds a header.Sets hooks.Sets the logger.Sets the proxy URL.queryPassword(Secret password) Sets the SQL connection password.queryPassword(String password) Sets the SQL connection password.Sets the SQL query base URL.queryUsername(String username) Sets the SQL connection username.Sets the per-attempt timeout.retry(RetryPolicy retry) Sets the retry policy.sourceTable(String sourceTable) Sets the default collection.sourceToken(Secret token) Sets the source token.sourceToken(String token) Sets the source token.tls(TlsOptions tls) Sets the TLS options.Sets the total timeout.Sets the ingest base URL (the source's ingesting host).userAgentSuffix(String suffix) Sets the user agent suffix.
-
Method Details
-
fromEnv
Fills unset fields from an environment reader.- Parameters:
env- reader, e.g.EnvReader.system()- Returns:
- this builder
-
url
Sets the ingest base URL (the source's ingesting host).- Parameters:
url- host or URL- Returns:
- this builder
-
sourceToken
Sets the source token.- Parameters:
token- token- Returns:
- this builder
-
sourceToken
Sets the source token.- Parameters:
token- token- Returns:
- this builder
-
queryUrl
Sets the SQL query base URL.- Parameters:
url- host or URL- Returns:
- this builder
-
queryUsername
Sets the SQL connection username.- Parameters:
username- username- Returns:
- this builder
-
queryPassword
Sets the SQL connection password.- Parameters:
password- password- Returns:
- this builder
-
queryPassword
Sets the SQL connection password.- Parameters:
password- password- Returns:
- this builder
-
sourceTable
Sets the default collection.- Parameters:
sourceTable- identifier- Returns:
- this builder
-
encoding
Sets the ingest body encoding.- Parameters:
encoding- encoding- Returns:
- this builder
-
connectTimeout
Sets the connect timeout.- Parameters:
d- duration- Returns:
- this builder
-
requestTimeout
Sets the per-attempt timeout.- Parameters:
d- duration- Returns:
- this builder
-
totalTimeout
Sets the total timeout.- Parameters:
d- duration- Returns:
- this builder
-
retry
Sets the retry policy.- Parameters:
retry- policy- Returns:
- this builder
-
tls
Sets the TLS options.- Parameters:
tls- options- Returns:
- this builder
-
proxy
Sets the proxy URL.- Parameters:
proxy- URL- Returns:
- this builder
-
header
Adds a header.- Parameters:
name- namevalue- value- Returns:
- this builder
-
userAgentSuffix
Sets the user agent suffix.- Parameters:
suffix- suffix- Returns:
- this builder
-
hooks
Sets hooks.- Parameters:
hooks- hooks- Returns:
- this builder
-
logger
Sets the logger.- Parameters:
logger- logger- Returns:
- this builder
-
build
Builds the configuration and the client.- Returns:
- a new client
- Throws:
ConfigException- when the configuration is invalid
-