Class ConsulPropertySource

  • Direct Known Subclasses:
    ConsulFilesPropertySource

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

      • ConsulPropertySource

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

      • 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
      • getDecoded

        @Deprecated
        public String getDecoded​(String value)
        Deprecated.
        As of 1.1.0 use GetValue.getDecodedValue().
        Parameters:
        value - encoded value
        Returns:
        the decoded string
      • 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>