Class ConfigUtils
java.lang.Object
org.springframework.cloud.kubernetes.commons.config.ConfigUtils
Utility class that works with configuration properties.
- Author:
- Ioannis Canellos
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ConfigUtils.PrefixfindPrefix(String explicitPrefix, Boolean useNameAsPrefix, boolean defaultUseNameAsPrefix, String normalizedName) static StringgetApplicationName(org.springframework.core.env.Environment env, String configName, String configurationTarget) static booleanincludeProfileSpecificSources(boolean defaultIncludeProfileSpecificSources, Boolean includeProfileSpecificSources) keysWithPrefix(Map<String, String> map, String prefix) append prefix to the keys and return a new Map with the new values.static voidonException(boolean failFast, Exception e) action to take when an Exception happens when dealing with a source.static MultipleSourcesContainerprocessLabeledData(List<StrippedSourceContainer> containers, org.springframework.core.env.Environment environment, Map<String, String> labels, String namespace, boolean decode) Transforms raw data from one or multiple sources into an entry of source names and flattened data that they all hold (potentially overriding entries without any defined order).static MultipleSourcesContainerprocessNamedData(List<StrippedSourceContainer> strippedSources, org.springframework.core.env.Environment environment, LinkedHashSet<String> sourceNames, String namespace, boolean decode, boolean includeDefaultProfileData) Transforms raw data from one or multiple sources into an entry of source names and flattened data that they all hold (potentially overriding entries without any defined order).static <T> voidregisterSingle(org.springframework.boot.bootstrap.ConfigurableBootstrapContext bootstrapContext, Class<T> cls, T instance, String name) static <T> voidregisterSingle(org.springframework.boot.bootstrap.ConfigurableBootstrapContext bootstrapContext, Class<T> cls, T instance, String name, org.springframework.context.ApplicationListener<?> listener) static StringsourceName(String target, String applicationName, String namespace) static StringsourceName(String target, String applicationName, String namespace, String[] profiles)
-
Method Details
-
getApplicationName
-
findPrefix
public static ConfigUtils.Prefix findPrefix(String explicitPrefix, Boolean useNameAsPrefix, boolean defaultUseNameAsPrefix, String normalizedName) - Parameters:
explicitPrefix- value of 'spring.cloud.kubernetes.config|secrets.sources.explicitPrefix'useNameAsPrefix- value of 'spring.cloud.kubernetes.config|secrets.sources.useNameAsPrefix'defaultUseNameAsPrefix- value of 'spring.cloud.kubernetes.config|secrets.defaultUseNameAsPrefix'normalizedName- either the name of 'spring.cloud.kubernetes.config|secrets.sources.name' or 'spring.cloud.kubernetes.config|secrets.name'- Returns:
- prefix to use in normalized sources
-
includeProfileSpecificSources
public static boolean includeProfileSpecificSources(boolean defaultIncludeProfileSpecificSources, Boolean includeProfileSpecificSources) - Parameters:
defaultIncludeProfileSpecificSources- value of 'spring.cloud.kubernetes.config.includeProfileSpecificSources'includeProfileSpecificSources- value of 'spring.cloud.kubernetes.config.sources.includeProfileSpecificSources'- Returns:
- useProfileNameAsPrefix to be used in normalized sources
-
onException
action to take when an Exception happens when dealing with a source. -
sourceName
-
sourceName
-
processNamedData
public static MultipleSourcesContainer processNamedData(List<StrippedSourceContainer> strippedSources, org.springframework.core.env.Environment environment, LinkedHashSet<String> sourceNames, String namespace, boolean decode, boolean includeDefaultProfileData) Transforms raw data from one or multiple sources into an entry of source names and flattened data that they all hold (potentially overriding entries without any defined order). -
processLabeledData
public static MultipleSourcesContainer processLabeledData(List<StrippedSourceContainer> containers, org.springframework.core.env.Environment environment, Map<String, String> labels, String namespace, boolean decode) Transforms raw data from one or multiple sources into an entry of source names and flattened data that they all hold (potentially overriding entries without any defined order). -
registerSingle
-
registerSingle
-
keysWithPrefix
-