Class StorkConfigUtils

java.lang.Object
io.smallrye.stork.utils.StorkConfigUtils

public class StorkConfigUtils extends Object
  • Field Details

    • LOAD_BALANCER

      public static final String LOAD_BALANCER
      The load-balancer segment used in the configuration key.
      See Also:
    • LOAD_BALANCER_EMBEDDED

      public static final String LOAD_BALANCER_EMBEDDED
      The load balancer type configuration key.
      See Also:
    • SERVICE_DISCOVERY

      public static final String SERVICE_DISCOVERY
      The service-discovery segment used in the configuration key.
      See Also:
    • SERVICE_DISCOVERY_EMBEDDED

      public static final String SERVICE_DISCOVERY_EMBEDDED
      The service discovery type configuration key.
      See Also:
    • SERVICE_REGISTRAR

      public static final String SERVICE_REGISTRAR
      The service-registrar segment used in the configuration key.
      See Also:
    • SERVICE_REGISTRAR_EMBEDDED

      public static final String SERVICE_REGISTRAR_EMBEDDED
      The service discovery type configuration key.
      See Also:
  • Constructor Details

    • StorkConfigUtils

      public StorkConfigUtils()
  • Method Details

    • computeServiceProperty

      public static void computeServiceProperty(Map<String,Map<String,String>> propertiesByServiceName, String propertyName, String propertyValue)
      Computes and stores service properties based on the provided property name and value.

      This method processes a property name and value, extracting relevant information and storing it in a map based on the service name. The property name is expected to follow a specific pattern associated with SmallRye Stork, and it's used to determine the service name and property key. If the property name does not match the expected pattern, it will be logged as a warning.

      Parameters:
      propertiesByServiceName - A map containing service properties indexed by service name.
      propertyName - The name of the property to compute.
      propertyValue - The value of the property to store.
    • buildServiceConfig

      public static SimpleServiceConfig buildServiceConfig(Map.Entry<String,Map<String,String>> serviceEntry)
    • unwrapFromQuotes

      public static String unwrapFromQuotes(String text)
    • propertyKey

      public static String propertyKey(String text)
    • propertiesForPrefix

      public static Map<String,String> propertiesForPrefix(String prefix, Map<String,String> original)