Class 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:
    Serialized Form
    • Constructor Detail

      • ConfigArgsConfigSource

        protected ConfigArgsConfigSource()
    • Method Detail

      • 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
      • hasOptionValue

        public static boolean hasOptionValue​(Predicate<String> keyMatcher,
                                             String expectedValue)