Package-level declarations

Types

Link copied to clipboard
open class ProviderOption<T : Any> @InternalWowApi constructor(val key: String, val description: String, val type: Class<T>, val default: T?, val scope: ProviderOption.Scope, val values: List<String> = emptyList(), parser: (String) -> T)

One setting a provider (a store's, a dataset backend's) reads from its configuration, as it declares it: its key, what it means (description, the configuration reference's text), the type of its value and its default (null when it has none), and where it may be set (scope). A provider lists every option it reads, and reads each through it, so the host binds, checks and documents exactly those: an option of Scope.TYPE is set for every instance of the provider's type under wow.<type>.<key>, and each instance may set it over that; a key a provider does not declare fails the start, naming the declared ones.

Link copied to clipboard
class ProviderSettings @InternalWowApi constructor(val key: String, val values: Map<String, String> = emptyMap())

The settings of one provider's instance, as its configuration holds them under key: a store's (wow.stores.<name>), a sink's or a transport's (wow.<name>), a peer discovery's or a dataset's. values are keyed relative to key (endpoint, say). Every config a provider is opened with holds one, so a provider reads its settings one way whatever it provides, through its ProviderOptions, and a failure names the setting by its full key.

Link copied to clipboard
class WowConfigurationException(val key: String, val value: Any?, val reason: String, val fix: String) : IllegalStateException

A configuration Wow cannot start with: key is the configuration key at fault, value its value as configured (null when it is not set, or when the fault is between keys), reason what is wrong and fix what to change. The core modules that enforce a rule of the configuration throw it where the rule lives (the internal port's security floor of wow-http, the query bulkheads of wow-query), and a host reports it as it reports its own: the Spring Boot host through a failure analyzer, instead of a stack of bean creation failures.

Functions

Link copied to clipboard

name, the name of a map's entry written without brackets, as Spring Boot's binding compares it: its letters in lower case and its digits, every other character left out. ordering-service, Ordering_Service and orderingservice are one entry to it, and an environment variable, which can write neither a dash nor a dot, writes this form: WOW_CALLERS_ORDERINGSERVICE_… gives the entry orderingservice. Spring compares a name written in brackets as written, and a map's key is the brackets' content, so whoever holds the key cannot tell how it was written: for a bracketed or a dotted name this form is the coarser of the two. The host's tests hold it to Spring's own comparison.

Link copied to clipboard
inline fun configCheck(condition: Boolean, key: String, value: Any?, fix: String, reason: () -> String)

Throws a WowConfigurationException of key with value and fix when condition is false.

Link copied to clipboard
inline fun <T : Any> configNotNull(value: T?, key: String, fix: String, configured: Any? = null, reason: () -> String): T

value, or, when it is null, a WowConfigurationException of key with fix; configured is the key's value, null when it is not set.