Class CconfigClientImpl
java.lang.Object
org.chenile.cconfig.sdk.impl.CconfigClientImpl
- All Implemented Interfaces:
CconfigClient
The default implementation of the
CconfigClient interface. This uses an OWIZ
orchestration over ConfigContext to apply multiple config retrievers.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) MemoryCacheprivate final OrchExecutor<ConfigContext> -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CconfigClient
value, value
-
Field Details
-
orchExecutor
-
memoryCache
-
-
Constructor Details
-
CconfigClientImpl
-
-
Method Details
-
value
- Specified by:
valuein interfaceCconfigClient- Parameters:
module- - the module under which the key is defined. Modules can be nested.key- - the key for which value is desired.- Returns:
- the value for the key.
If key is null and only module name is specified, then all keys
for module will be returned. Key value can be string or a map.
If a module is specified and key is null it will be a map with all the keys as keys of the map. The value can be strings or map depending on how the value was defined by any of the Config Retrievers.
Eg: The JSON config retriever defines the keys for a module can look like this:
"key1": "value1" "key2": { "valid JSON": "here", "it": { "can": {"be": { "arbitrarily": "nested"}}} }
These JSON values can be over-ridden in two ways :
- They can be over-ridden for all "requests" whether they have a custom attribute or not (__GLOBAL__)
- They can be over-ridden for specific "requests" that have a custom attribute (eg. all requests that belong to a client "tenant0")
New keys can be introduced by individual config retrievers.
-
allKeysForModule
-
customizationAttribute
Override this in a subclass to change the default behaviour.- Returns:
- the value of custom attribute from request headers. Default implementation returns the value of the tenant ID header.
-