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 Summary
Constructors Constructor Description ConsulPropertySource(String context, com.ecwid.consul.v1.ConsulClient source, ConsulConfigProperties configProperties)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected PropertiesgenerateProperties(String value, ConsulConfigProperties.Format format)protected ConsulConfigPropertiesgetConfigProperties()protected StringgetContext()StringgetDecoded(String value)Deprecated.As of 1.1.0 useGetValue.getDecodedValue().LonggetInitialIndex()protected Map<String,Object>getProperties()ObjectgetProperty(String name)String[]getPropertyNames()voidinit()protected voidparsePropertiesInKeyValueFormat(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.protected voidparsePropertiesWithNonKeyValueFormat(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.protected voidparseValue(com.ecwid.consul.v1.kv.model.GetValue getValue, ConsulConfigProperties.Format format)
-
-
-
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 parseformat- 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 useGetValue.getDecodedValue().- Parameters:
value- encoded value- Returns:
- the decoded string
-
getConfigProperties
protected ConsulConfigProperties getConfigProperties()
-
getContext
protected String getContext()
-
getProperty
public Object getProperty(String name)
- Specified by:
getPropertyin classorg.springframework.core.env.PropertySource<com.ecwid.consul.v1.ConsulClient>
-
getPropertyNames
public String[] getPropertyNames()
- Specified by:
getPropertyNamesin classorg.springframework.core.env.EnumerablePropertySource<com.ecwid.consul.v1.ConsulClient>
-
-