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 ofEnvironmentRepositorythat 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 org.springframework.cloud.config.server.environment.SearchPathLocator
SearchPathLocator.Locations
-
-
Constructor Summary
Constructors Constructor Description NativeEnvironmentRepository(org.springframework.core.env.ConfigurableEnvironment environment, NativeEnvironmentProperties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Environmentclean(Environment env)protected Environmentclean(Environment env, Map<org.springframework.core.env.PropertySource<?>,org.springframework.cloud.config.server.environment.NativeEnvironmentRepository.PropertySourceConfigData> propertySourceToConfigData)EnvironmentfindOne(String config, String profile, String label)EnvironmentfindOne(String config, String profile, String label, boolean includeOrigin)StringgetDefaultLabel()SearchPathLocator.LocationsgetLocations(String application, String profile, String label)intgetOrder()String[]getSearchLocations()StringgetVersion()booleanisAddLabelLocations()booleanisFailOnError()voidsetAddLabelLocations(boolean addLabelLocations)voidsetDefaultLabel(String defaultLabel)voidsetFailOnError(boolean failOnError)voidsetOrder(int order)voidsetSearchLocations(String... locations)voidsetVersion(String version)
-
-
-
Constructor Detail
-
NativeEnvironmentRepository
public NativeEnvironmentRepository(org.springframework.core.env.ConfigurableEnvironment environment, NativeEnvironmentProperties properties)
-
-
Method Detail
-
isFailOnError
public boolean isFailOnError()
-
setFailOnError
public void setFailOnError(boolean failOnError)
-
isAddLabelLocations
public boolean isAddLabelLocations()
-
setAddLabelLocations
public void setAddLabelLocations(boolean addLabelLocations)
-
getDefaultLabel
public String getDefaultLabel()
-
setDefaultLabel
public void setDefaultLabel(String defaultLabel)
-
findOne
public Environment findOne(String config, String profile, String label)
- Specified by:
findOnein interfaceEnvironmentRepository
-
findOne
public Environment findOne(String config, String profile, String label, boolean includeOrigin)
- Specified by:
findOnein interfaceEnvironmentRepository
-
getLocations
public SearchPathLocator.Locations getLocations(String application, String profile, String label)
- Specified by:
getLocationsin interfaceSearchPathLocator
-
clean
protected Environment clean(Environment env)
-
clean
protected Environment clean(Environment env, Map<org.springframework.core.env.PropertySource<?>,org.springframework.cloud.config.server.environment.NativeEnvironmentRepository.PropertySourceConfigData> propertySourceToConfigData)
-
getSearchLocations
public String[] getSearchLocations()
-
setSearchLocations
public void setSearchLocations(String... locations)
-
getVersion
public String getVersion()
-
setVersion
public void setVersion(String version)
-
getOrder
public int getOrder()
- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
setOrder
public void setOrder(int order)
-
-