Class ConsulPropertySource

java.lang.Object
org.springframework.core.env.PropertySource<T>
org.springframework.core.env.EnumerablePropertySource<com.ecwid.consul.v1.ConsulClient>
org.springframework.cloud.consul.config.ConsulPropertySource
Direct Known Subclasses:
ConsulFilesPropertySource

public class ConsulPropertySource extends org.springframework.core.env.EnumerablePropertySource<com.ecwid.consul.v1.ConsulClient>
Author:
Spencer Gibb
  • Constructor Details

    • ConsulPropertySource

      public ConsulPropertySource(String context, com.ecwid.consul.v1.ConsulClient source, ConsulConfigProperties configProperties)
  • Method Details

    • init

      public void init()
    • getInitialIndex

      public Long getInitialIndex()
    • parsePropertiesInKeyValueFormat

      protected void parsePropertiesInKeyValueFormat(List<com.ecwid.consul.v1.kv.model.GetValue> values)
      Parses the properties in key value style i.e., values are expected to be either a sub key or a constant.
      Parameters:
      values - values to parse
    • parsePropertiesWithNonKeyValueFormat

      protected void parsePropertiesWithNonKeyValueFormat(List<com.ecwid.consul.v1.kv.model.GetValue> values, ConsulConfigProperties.Format format)
      Parses the properties using the format which is not a key value style i.e., either java properties style or YAML style.
      Parameters:
      values - values to parse
      format - format in which the values should be parsed
    • parseValue

      protected void parseValue(com.ecwid.consul.v1.kv.model.GetValue getValue, ConsulConfigProperties.Format format)
    • generateProperties

      protected Properties generateProperties(String value, ConsulConfigProperties.Format format)
    • getDecoded

      @Deprecated public String getDecoded(String value)
      Deprecated.
      As of 1.1.0 use GetValue.getDecodedValue().
      Parameters:
      value - encoded value
      Returns:
      the decoded string
    • getProperties

      protected Map<String,Object> getProperties()
    • getConfigProperties

      protected ConsulConfigProperties getConfigProperties()
    • getContext

      protected String getContext()
    • getProperty

      public Object getProperty(String name)
      Specified by:
      getProperty in class org.springframework.core.env.PropertySource<com.ecwid.consul.v1.ConsulClient>
    • getPropertyNames

      public String[] getPropertyNames()
      Specified by:
      getPropertyNames in class org.springframework.core.env.EnumerablePropertySource<com.ecwid.consul.v1.ConsulClient>