Class ConsulSubstitutor

java.lang.Object
org.apache.commons.text.StringSubstitutor
io.dropwizard.configuration.EnvironmentVariableSubstitutor
org.kiwiproject.dropwizard.consul.config.ConsulSubstitutor

public class ConsulSubstitutor extends io.dropwizard.configuration.EnvironmentVariableSubstitutor
A custom EnvironmentVariableSubstitutor using Consul KV as lookup source.
  • Field Summary

    Fields inherited from class org.apache.commons.text.StringSubstitutor

    DEFAULT_ESCAPE, DEFAULT_PREFIX, DEFAULT_SUFFIX, DEFAULT_VALUE_DELIMITER, DEFAULT_VAR_DEFAULT, DEFAULT_VAR_END, DEFAULT_VAR_START
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConsulSubstitutor(org.kiwiproject.consul.Consul consul)
     
    ConsulSubstitutor(org.kiwiproject.consul.Consul consul, boolean strict)
     
    ConsulSubstitutor(org.kiwiproject.consul.Consul consul, boolean strict, boolean substitutionInVariables)
    Constructor
  • Method Summary

    Methods inherited from class io.dropwizard.configuration.EnvironmentVariableSubstitutor

    substitute

    Methods inherited from class org.apache.commons.text.StringSubstitutor

    createInterpolator, getEscapeChar, getStringLookup, getValueDelimiterMatcher, getVariablePrefixMatcher, getVariableSuffixMatcher, isDisableSubstitutionInValues, isEnableSubstitutionInVariables, isEnableUndefinedVariableException, isPreserveEscapes, replace, replace, replace, replace, replace, replace, replace, replace, replace, replace, replace, replace, replace, replace, replaceIn, replaceIn, replaceIn, replaceIn, replaceIn, replaceIn, replaceSystemProperties, resolveVariable, setDisableSubstitutionInValues, setEnableSubstitutionInVariables, setEnableUndefinedVariableException, setEscapeChar, setPreserveEscapes, setValueDelimiter, setValueDelimiter, setValueDelimiterMatcher, setVariablePrefix, setVariablePrefix, setVariablePrefixMatcher, setVariableResolver, setVariableSuffix, setVariableSuffix, setVariableSuffixMatcher, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ConsulSubstitutor

      public ConsulSubstitutor(org.kiwiproject.consul.Consul consul)
    • ConsulSubstitutor

      public ConsulSubstitutor(org.kiwiproject.consul.Consul consul, boolean strict)
    • ConsulSubstitutor

      public ConsulSubstitutor(org.kiwiproject.consul.Consul consul, boolean strict, boolean substitutionInVariables)
      Constructor
      Parameters:
      consul - Consul client
      strict - true if looking up undefined environment variables should throw a UndefinedEnvironmentVariableException, false otherwise.
      substitutionInVariables - a flag whether substitution is done in variable names.
      See Also:
      • StringSubstitutor.setEnableSubstitutionInVariables(boolean)