StoreConfig

class StoreConfig @InternalWowApi constructor(val name: String, val type: String, val ddl: Ddl = Ddl.AUTO, val options: Map<String, String> = emptyMap(), val polling: TailPolling = TailPolling.DEFAULT, val service: String = "", val resources: StoreResources = StoreResources.NONE, val development: Boolean = false, val clock: Clock = Clock.systemUTC())

What a StoreProvider opens one store instance from: the store's name and type, how it manages the framework's schema (ddl, wow.stores.<name>.ddl over wow.ddl), its own settings (options), how the tails of its logs poll (polling, wow.log.poll-interval), the service whose failure ledger it keeps (the key of its entries), the application's resources, whether the node runs for development, where a store may accept a deployment it refuses for production (a standalone MongoDB server, say), and the clock its ports read the time from: the leases' and the reservations' expiry, the store's one time source, so a test fixes it in one place.

Fields may be added: the host builds it, so the constructor is internal to Wow; a provider's test builds one with of.

Constructors

Link copied to clipboard
constructor(name: String, type: String, ddl: Ddl = Ddl.AUTO, options: Map<String, String> = emptyMap(), polling: TailPolling = TailPolling.DEFAULT, service: String = "", resources: StoreResources = StoreResources.NONE, development: Boolean = false, clock: Clock = Clock.systemUTC())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
val ddl: Ddl
Link copied to clipboard
Link copied to clipboard
val key: String

The configuration key of this store's settings, wow.stores.<name>, for a provider's failures to name.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The keys of options the store asked for, so a test can hold them to the options its provider declares.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun option(name: String): String?

The setting name of options, or null when it is not set or blank.

fun <T : Any> option(option: ProviderOption.Defaulted<T>): T

The value of the ProviderOption.Defaulted option: its setting, parsed, else its default, so always one.

fun <T : Any> option(option: ProviderOption<T>): T?

The value of option: its setting in options, parsed, else its default; fails naming the setting when the value is not one of the option's type.

Link copied to clipboard

The settings under the map option (ProviderOption.map), their keys relative to it.

Link copied to clipboard
open override fun toString(): String