Load a configuration section¶
This operation retrieves one named section from the Environment API and merges its settings into the library's shared cache. It exists as the fallback path for the common case where a non-global key was not requested at construction time and therefore is not yet part of the main payload.
| Field | Value |
|---|---|
| Operation ID | OP-ENV-003 |
| Trigger | GetConfigSettingInfo misses a non-global key in the shared cache |
| Inputs | section |
| Outputs | Section-scoped ConfigurationSettings payload plus merged cached entries |
| Primary components | EnvironmentServiceBase.LoadSection, EnvironmentServiceBase.AddSettingToLoadedConfigurations |
| Entry point | SAIF.Framework.Security.EnvironmentApi\Services.Common\EnvironmentServiceBase.cs |
Steps¶
- Read the current
LastRefreshedvalue before issuing the section request, so the returned payload can be stamped with the same server refresh timestamp as the rest of the cache (BR-002). - Build
/v2/settings/{ApplicationId}/{ApplicationHost}/{section}/sectionand download the JSON response. - Deserialize the response into a fresh
ConfigurationSettingsinstance. - Stamp the returned payload with the previously captured
LastRefreshedvalue and a new localLastLoadedtimestamp. - Merge each returned
ConfigSettinginto the shared cache by callingAddSettingToLoadedConfigurations. - Lock
_configLockduring the merge so concurrent section loads cannot corrupt the shared dictionary. - Skip the merge entirely when
_configurationsis still null. - Ignore duplicate-key
ArgumentExceptions so a repeated or concurrent section load does not fail the caller. - Return the section payload to the caller, which rechecks the specific key against the freshly merged settings.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Caller misses non-global key]) --> Stamp[Capture LastRefreshed]
Stamp --> Download[Download section payload]
Download --> Deserialize[Deserialize ConfigurationSettings]
Deserialize --> Merge[Merge returned settings into shared cache]
Merge --> End([Return section payload])
Failure and edge-case behavior¶
- The method depends on the current
ApplicationHost; a host-resolution failure surfaces before the section request is even made. - Duplicate section entries are ignored during the cache merge rather than overwriting the value that was already loaded.
- HTTP and deserialization failures are not caught locally and propagate to the caller.
Related documentation¶
Sources¶
- SAIF.Framework.Security.EnvironmentApi\Services.Common\EnvironmentServiceBase.cs