Package app.l2nx.gs.adapter.core.config
Class ConfigResolver
java.lang.Object
app.l2nx.gs.adapter.core.config.ConfigResolver
Resolves adapter configuration from a two-source chain (per key), file-first:
- Properties file — either the path given by
-Dl2nx.config-file=<path>(operator-preferred; absolute or relative to the JVM working directory), orl2nx.propertiesin the JVM working directory of the host application as a fallback whenl2nx.config-fileis unset. - JVM system property (e.g.
-Dl2nx.gs-key=...) — consulted only when the file does not provide the key.
Missing-file semantics:
-Dl2nx.config-fileexplicitly set but missing / unreadable / malformed path → fail loud withIllegalStateException; the operator's intent is clear.-Dl2nx.config-fileunset andl2nx.propertiesnot present in the JVM working directory → emptyProperties(graceful — sysprop fallback may still provide the keys).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionresolve()booleanresolveBoolean(String key, boolean defaultValue) booleanHost-type — selects which connect endpoint the adapter targets and which server-key property name is required.intresolveInt(String key, int defaultValue) intresolveServerKey(String hostType) Resolve the server key matching the host-type.resolveString(String key)
-
Constructor Details
-
ConfigResolver
public ConfigResolver()
-
-
Method Details
-
resolve
-
resolveHostType
Host-type — selects which connect endpoint the adapter targets and which server-key property name is required. Values:gs(game server) orls(login server). Defaults togsfor back-compat with existing deployments that pre-date the host-type config key. -
resolveIoWorkers
public int resolveIoWorkers() -
resolveEventsConfig
-
resolveCommandsConfig
-
resolveInt
-
resolveString
-
resolveBoolean
-
resolveServerKey
-
resolveServerKey
Resolve the server key matching the host-type. Validation:host-type=gs→ exactlyl2nx.gs-keymust be present; settingl2nx.ls-keyalongside is a fatal misconfiguration.host-type=ls→ exactlyl2nx.ls-keymust be present; settingl2nx.gs-keyalongside is a fatal misconfiguration.
-
resolvePlatformUrl
-
resolveEnabled
public boolean resolveEnabled() -
resolveAdapterVersion
-