Class NativeEnvironmentRepository
java.lang.Object
org.springframework.cloud.config.server.environment.NativeEnvironmentRepository
- All Implemented Interfaces:
EnvironmentRepository, SearchPathLocator, org.springframework.core.Ordered
public class NativeEnvironmentRepository
extends Object
implements EnvironmentRepository, SearchPathLocator, org.springframework.core.Ordered
Simple implementation of
EnvironmentRepository that uses a SpringApplication
and configuration files located through the normal protocols. The resulting Environment
is composed of property sources located using the application name as the config file
stem (spring.config.name) and the environment name as a Spring profile.- Author:
- Dave Syer, Roy Clarkson, Venil Noronha, Daniel Lavoie
-
Nested Class Summary
Nested classes/interfaces inherited from interface SearchPathLocator
SearchPathLocator.Locations -
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionNativeEnvironmentRepository(org.springframework.core.env.ConfigurableEnvironment environment, NativeEnvironmentProperties properties, io.micrometer.observation.ObservationRegistry observationRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.cloud.config.environment.Environmentclean(org.springframework.cloud.config.environment.Environment env) protected org.springframework.cloud.config.environment.Environmentclean(org.springframework.cloud.config.environment.Environment env, Map<org.springframework.core.env.PropertySource<?>, org.springframework.cloud.config.server.environment.NativeEnvironmentRepository.PropertySourceConfigData> propertySourceToConfigData) org.springframework.cloud.config.environment.Environmentorg.springframework.cloud.config.environment.EnvironmentgetLocations(String application, String profile, String label) intgetOrder()String[]booleanbooleanvoidsetAddLabelLocations(boolean addLabelLocations) voidsetDefaultLabel(String defaultLabel) voidsetFailOnError(boolean failOnError) voidsetOrder(int order) voidsetSearchLocations(String... locations) voidsetVersion(String version)
-
Constructor Details
-
NativeEnvironmentRepository
public NativeEnvironmentRepository(org.springframework.core.env.ConfigurableEnvironment environment, NativeEnvironmentProperties properties, io.micrometer.observation.ObservationRegistry observationRegistry)
-
-
Method Details
-
isFailOnError
public boolean isFailOnError() -
setFailOnError
public void setFailOnError(boolean failOnError) -
isAddLabelLocations
public boolean isAddLabelLocations() -
setAddLabelLocations
public void setAddLabelLocations(boolean addLabelLocations) -
getDefaultLabel
-
setDefaultLabel
-
findOne
public org.springframework.cloud.config.environment.Environment findOne(String config, String profile, String label) - Specified by:
findOnein interfaceEnvironmentRepository
-
findOne
public org.springframework.cloud.config.environment.Environment findOne(String config, String profile, String label, boolean includeOrigin) - Specified by:
findOnein interfaceEnvironmentRepository
-
getLocations
- Specified by:
getLocationsin interfaceSearchPathLocator
-
clean
protected org.springframework.cloud.config.environment.Environment clean(org.springframework.cloud.config.environment.Environment env) -
clean
protected org.springframework.cloud.config.environment.Environment clean(org.springframework.cloud.config.environment.Environment env, Map<org.springframework.core.env.PropertySource<?>, org.springframework.cloud.config.server.environment.NativeEnvironmentRepository.PropertySourceConfigData> propertySourceToConfigData) -
getSearchLocations
-
setSearchLocations
-
getVersion
-
setVersion
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
setOrder
public void setOrder(int order)
-