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
ConstructorDescriptionSecretsEnvironmentPostProcessor
(org.springframework.boot.logging.DeferredLogFactory logFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected SecretsEnvironment
createSecretsEnvironment
(ConfigurableEnvironment environment, ResourceLoader resourceLoader) Creates a new instance ofSecretsEnvironment
.int
getOrder()
protected abstract PropertyIndexSupplier
getPropertyIndexSupplier
(ConfigurableEnvironment environment) Creates a new instance ofPropertyIndexSupplier
providing a map of configuration property keys and its locations.protected SecretResolver
getSecretResolver
(ResourceLoader resourceLoader) Creates a new instance of aSecretResolver
.void
postProcessEnvironment
(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:
postProcessEnvironment
in 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'sResourceLoader
creatingResource
s; never null- Returns:
- a new instance of a
SecretResolver
-
getPropertyIndexSupplier
protected abstract PropertyIndexSupplier getPropertyIndexSupplier(ConfigurableEnvironment environment) Creates a new instance ofPropertyIndexSupplier
providing 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 currentConfigurableEnvironment
andPropertyResolver
; never null- Returns:
- a new instance of a
PropertyIndexSupplier
-
getOrder
public int getOrder()
-