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.PropertiesConfigSource

A 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_KEYCLOAK namespace.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     

    Fields inherited from interface org.eclipse.microprofile.config.spi.ConfigSource

    CONFIG_ORDINAL, DEFAULT_ORDINAL
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<String>
    Reads the previously set system property for the originally command.
    getValue(String propertyName)
     
    static void
     
    static void
     

    Methods inherited from class io.smallrye.config.common.MapBackedConfigSource

    getProperties, getPropertyNames

    Methods inherited from class io.smallrye.config.common.AbstractConfigSource

    getName, getOrdinal, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • ConfigArgsConfigSource

      protected ConfigArgsConfigSource()
  • Method Details

    • 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:
      getValue in interface org.eclipse.microprofile.config.spi.ConfigSource
      Overrides:
      getValue in class io.smallrye.config.common.MapBackedConfigSource
    • parseConfigArgs

      public static void parseConfigArgs(BiConsumer<String,String> cliArgConsumer)