Class EnvBasedCconfigRetriever

java.lang.Object
org.chenile.cconfig.sdk.impl.EnvBasedCconfigRetriever
All Implemented Interfaces:
CconfigRetriever

public class EnvBasedCconfigRetriever extends Object implements CconfigRetriever
This considers all the module keys and selectively enhances them if there is an environmental override. Note that environment will not add any new config keys. It will only enhance the existing keys. Also, this completely replaces the existing value for the key with a new value rather than selective manipulation of the value of the key.
  • Field Details

  • Constructor Details

  • Method Details

    • registerWithFactory

      @PostConstruct public void registerWithFactory()
    • augmentKeys

      public void augmentKeys(ConfigContext configContext)
      Specified by:
      augmentKeys in interface CconfigRetriever
    • order

      public int order()
      Give it a higher precedence since Environment should ultimately override everything. But we will keep it relatively lower than database since
      Specified by:
      order in interface CconfigRetriever
      Returns:
    • envKey

      private String envKey(String customAttribute, String module, String key)