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

      public String getDefaultLabel()
    • setDefaultLabel

      public void setDefaultLabel(String defaultLabel)
    • findOne

      public org.springframework.cloud.config.environment.Environment findOne(String config, String profile, String label)
      Specified by:
      findOne in interface EnvironmentRepository
    • findOne

      public org.springframework.cloud.config.environment.Environment findOne(String config, String profile, String label, boolean includeOrigin)
      Specified by:
      findOne in interface EnvironmentRepository
    • getLocations

      public SearchPathLocator.Locations getLocations(String application, String profile, String label)
      Specified by:
      getLocations in interface SearchPathLocator
    • 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

      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:
      getOrder in interface org.springframework.core.Ordered
    • setOrder

      public void setOrder(int order)