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

        public void setOrder​(int order)