Class ConfigArgsConfigSource
- java.lang.Object
-
- io.smallrye.config.common.AbstractConfigSource
-
- io.smallrye.config.common.MapBackedConfigSource
-
- io.smallrye.config.PropertiesConfigSource
-
- org.keycloak.quarkus.runtime.configuration.ConfigArgsConfigSource
-
- All Implemented Interfaces:
Serializable,org.eclipse.microprofile.config.spi.ConfigSource
public class ConfigArgsConfigSource extends io.smallrye.config.PropertiesConfigSourceA configuration source for mapping configuration arguments to their corresponding properties so that they can be recognized when building and running the server.
The mapping is based on the system property
kc.config.args, where the value is a comma-separated list of the arguments passed during build or runtime. E.g: "--http-enabled=true,--http-port=8180,--database-vendor=postgres".Each argument is going to be mapped to its corresponding configuration property by prefixing the key with the
MicroProfileConfigProvider.NS_KEYCLOAKnamespace.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedConfigArgsConfigSource()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static List<String>getAllCliArgs()Reads the previously set system property for the originally command.static ConfigArgsConfigSourcegetInstance()StringgetValue(String propertyName)static booleanhasOptionValue(Predicate<String> keyMatcher, String expectedValue)static voidparseConfigArgs(BiConsumer<String,String> cliArgConsumer)static voidsetCliArgs(String[] args)-
Methods inherited from class io.smallrye.config.common.MapBackedConfigSource
getProperties, getPropertyNames
-
-
-
-
Field Detail
-
CLI_ARGS
public static final String CLI_ARGS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static ConfigArgsConfigSource getInstance()
-
setCliArgs
public static void setCliArgs(String[] args)
-
getAllCliArgs
public static List<String> getAllCliArgs()
Reads the previously set system property for the originally command. Use the System variable, when you trigger other command executions internally, but need a reference to the actually invoked command.- Returns:
- the invoked command from the CLI, or empty List if not set.
-
getValue
public String getValue(String propertyName)
- Specified by:
getValuein interfaceorg.eclipse.microprofile.config.spi.ConfigSource- Overrides:
getValuein classio.smallrye.config.common.MapBackedConfigSource
-
hasOptionValue
public static boolean hasOptionValue(Predicate<String> keyMatcher, String expectedValue)
-
parseConfigArgs
public static void parseConfigArgs(BiConsumer<String,String> cliArgConsumer)
-
-