Class AbstractRestClientConfigBuilder

java.lang.Object
io.quarkus.restclient.config.AbstractRestClientConfigBuilder
All Implemented Interfaces:
ConfigBuilder

public abstract class AbstractRestClientConfigBuilder extends Object implements ConfigBuilder
Registers and force load REST Client configuration.

Usually, named configuration is mapped using a Map because the names are dynamic and unknown to Quarkus. In the case of the REST Client, configuration names are fixed and known at build time, but not to the point where the names can be mapped statically, so they still need to be mapped in a Map.

To populate a Map, because the names are dynamic, the Config system has to rely on the list of property names provided by each source. This also applies to the REST Client, but since the names are known to Quarkus, the REST Client configuration could be loaded even for sources that don't provide a list of property names. To achieve such behaviour, we provide a dummy configuration under each REST Client name to force the Config system to look up the remaining configuration in the same tree.

The concrete implementation is bytecode generated in io.quarkus.restclient.config.deployment.RestClientConfigUtils#generateRestClientConfigBuilder

  • Constructor Details

    • AbstractRestClientConfigBuilder

      public AbstractRestClientConfigBuilder()
  • Method Details

    • configBuilder

      public io.smallrye.config.SmallRyeConfigBuilder configBuilder(io.smallrye.config.SmallRyeConfigBuilder builder)
      Specified by:
      configBuilder in interface ConfigBuilder
    • getRestClients

      public abstract List<RegisteredRestClient> getRestClients()
    • getIgnoreNames

      public Set<String> getIgnoreNames()
      Builds a list of base names from RestClientsConfig to ignore when rewriting the REST Client configuration. Only configuration from RestClientsConfig.clients() requires rewriting, but they share the same path of the base names due to WithParentName in the member.
      Returns:
      a Set with the names to ignore.
    • configMappingNames

      @Deprecated(forRemoval=true) static <T> Map<String,Map<String,Set<String>>> configMappingNames(Class<T> implementationClass)
      Deprecated, for removal: This API element is subject to removal in a future version.
      TODO - Generate this in RestClientConfigUtils - The list can be collected during build time and generated
    • indexOfRestClient

      static int indexOfRestClient(String name)