ConfigurationKeys

class ConfigurationKeys(keys: Map<ConfigurationPropertyName, Bindable<*>>, owned: List<ConfigurationPropertyName> = emptyList(), storeOptions: Collection<ProviderOption<*>> = emptyList())

The keys of the environment under wow that nothing reads: Spring binds what it knows and ignores the rest, so wow.cluster.forward-timout would be a silent no-op. A key is under wow when Spring maps it there, however its root is written (Wow.cluster.forward-timout, the variable wow_cluster_forwardtimout; #7637), since the binder reads every such spelling; a key Spring maps elsewhere (wowza.region) is left alone. The keys that exist are the wow.* keys of the configuration metadata on the class path (METADATA, the host's and any module's; never Spring Boot's own), each with its type, and the options the node's providers declare; whether a key or a variable is read is decided by binding (#7515): the check binds each of them as its type over the environment, as the host does, and under each entry of wow.stores the options the store providers declare (BoundKeys). A key of a property source is known when it gives a name the binder read, asked as the binder asks for it (as written or relaxed: laneCapacity is lane-capacity), and an environment variable the same way, in Spring's mapping of a variable to a name, both its forms (WOW_KAFKA_COMMANDINTAKE_ENABLED and the legacy WOW_COSEC_TENANT_LEVEL_ROLES). So a key under one read as one value is unknown (wow.kafka.bootstrap-servers[0]), and so is a variable for a map's entry whose name it cannot write: Spring takes a variable's first element after the map as the entry, so WOW_AGGREGATES_SHOP_CART_TENANT names no entry [shop.cart], and WOW_PEERS_ESHOP_ORDERING_URL reaches eshop-ordering only when the configuration defines that peer (ENTRIES). A key under the prefix of another @ConfigurationProperties bean of the application that no metadata describes (its owned prefixes) is known in any form: this check cannot tell its keys. Only property sources that list their names are read.

Environment variables are checked when Spring maps them under one of Wow's groups (WOW_<GROUP>_… in any case: the first element of a key or a MODULES prefix, in either of Spring's forms), so WOW_BENCH_… or a user's wow_pg_password is left alone; so are the variables Kubernetes gives a pod for a Service named wow-<group>, told from settings by their names and values together (ServiceLinks), unless the binder reads one of them. A name of the environment's variables written with dots (wow.bench.x) is taken as a key, not a variable (isVariable).

check refuses the startup for every unknown key: a mistyped wow.cosec.authorizer.enabled would otherwise leave the authorizer that allows all in place, and a key of an earlier version would do nothing. It refuses two entries of a map that are one name to Spring, as a variable writing a dashed entry without its dashes makes (WOW_STORES_MAINSTORE_TYPE beside wow.stores.main-store, a second store), and a Service's variable the binder reads (WOW_INTERNAL_PORT of a Service wow-internal). The refusal points at the migration guide's configuration page (MIGRATION), which maps the keys of earlier versions to today's.

Constructors

Link copied to clipboard
constructor(keys: Map<ConfigurationPropertyName, Bindable<*>>, owned: List<ConfigurationPropertyName> = emptyList(), storeOptions: Collection<ProviderOption<*>> = emptyList())

Types

Link copied to clipboard

Functions

Link copied to clipboard
fun check(environment: ConfigurableEnvironment)

Refuses the startup when environment has a key or a variable refused lists, each kind under its own heading with what to do: of an unknown key, the module that declares it when that module is not on the class path; of an unknown variable under a map, how a variable writes a map's entry; of a key under an entry given an empty value, the entry and the source that empties it, and whether to remove that value or, where no variable writes the entry's name, keep the entry with a key of its own (#7656); a key of an earlier version is unknown as any other, the message pointing at the migration guide. It never prints a value; the values it reads besides binding, of keys nothing reads, it reads only to see whether they are empty (isEmptyGroup, rootValues). The variables of Kubernetes' Services it leaves alone are logged once.

Link copied to clipboard
fun refused(environment: ConfigurableEnvironment): List<String>

Every key and variable of environment the check refuses, in the order it lists them: those nothing reads (unknown), those whose value the binder cannot read, those that make a second entry of a map, a Service's variables the binder reads, those under an entry a source gives an empty value, an empty value at the name of a group of settings, and a value at wow itself written as a key (rootValues).

Link copied to clipboard
fun unknown(environment: ConfigurableEnvironment): List<String>

The keys and variables of environment under wow that nothing reads, as far as the check can tell for how they are written, in the order it lists them.