Package de.vinado.boot.secrets
Class SecretsEnvironmentPostProcessor
java.lang.Object
de.vinado.boot.secrets.SecretsEnvironmentPostProcessor
- All Implemented Interfaces:
org.springframework.boot.env.EnvironmentPostProcessor,Ordered
- Direct Known Subclasses:
EnvironmentConfigDataSecretsEnvironmentPostProcessor,EnvironmentSecretsPropertyEnvironmentPostProcessor,FilenameConfigDataSecretsEnvironmentPostProcessor,FilenameSecretsEnvironmentPostProcessor
public abstract class SecretsEnvironmentPostProcessor
extends Object
implements org.springframework.boot.env.EnvironmentPostProcessor, Ordered
An EnvironmentPostProcessor that loads and applies a SecretsEnvironment to Spring's
Environment.
This component implements Ordered to draw attention to the fact, that SecretsEnvironmentPostProcessor
must be executed after ConfigDataEnvironmentPostProcessor in order to override configuration properties. I'd
recommend to set the value to ConfigDataEnvironmentPostProcessor.ORDER + n.
- Author:
- Vincent Nadoll
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionSecretsEnvironmentPostProcessor(org.springframework.boot.logging.DeferredLogFactory logFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected SecretsEnvironmentcreateSecretsEnvironment(ConfigurableEnvironment environment, ResourceLoader resourceLoader) Creates a new instance ofSecretsEnvironment.intgetOrder()protected abstract PropertyIndexSuppliergetPropertyIndexSupplier(ConfigurableEnvironment environment) Creates a new instance ofPropertyIndexSupplierproviding a map of configuration property keys and its locations.protected SecretResolvergetSecretResolver(ResourceLoader resourceLoader) Creates a new instance of aSecretResolver.voidpostProcessEnvironment(ConfigurableEnvironment environment, org.springframework.boot.SpringApplication application)
-
Constructor Details
-
SecretsEnvironmentPostProcessor
public SecretsEnvironmentPostProcessor(org.springframework.boot.logging.DeferredLogFactory logFactory)
-
-
Method Details
-
postProcessEnvironment
public void postProcessEnvironment(ConfigurableEnvironment environment, org.springframework.boot.SpringApplication application) - Specified by:
postProcessEnvironmentin interfaceorg.springframework.boot.env.EnvironmentPostProcessor
-
createSecretsEnvironment
protected SecretsEnvironment createSecretsEnvironment(ConfigurableEnvironment environment, ResourceLoader resourceLoader) Creates a new instance ofSecretsEnvironment.- Parameters:
environment- the environment to post-processresourceLoader- the resource loader to be used- Returns:
- new instance of
SecretsEnvironment
-
getSecretResolver
Creates a new instance of aSecretResolver.- Parameters:
resourceLoader- Spring'sResourceLoadercreatingResources; never null- Returns:
- a new instance of a
SecretResolver
-
getPropertyIndexSupplier
protected abstract PropertyIndexSupplier getPropertyIndexSupplier(ConfigurableEnvironment environment) Creates a new instance ofPropertyIndexSupplierproviding a map of configuration property keys and its locations. UsePropertyIndexSupplier.substituteValues(org.springframework.core.env.PropertyResolver)if you provided values which has to be substituted first.- Parameters:
environment- the currentConfigurableEnvironmentandPropertyResolver; never null- Returns:
- a new instance of a
PropertyIndexSupplier
-
getOrder
public int getOrder()
-