Class ConfigurationUpdateHelper

java.lang.Object
org.apache.unomi.persistence.spi.config.ConfigurationUpdateHelper

public class ConfigurationUpdateHelper extends Object
Utility class to handle configuration updates in ManagedService implementations. This class provides generic methods to process configuration property changes without hardcoding specific property names.
  • Constructor Details

    • ConfigurationUpdateHelper

      public ConfigurationUpdateHelper()
  • Method Details

    • processConfigurationUpdates

      public static void processConfigurationUpdates(Dictionary<String,?> properties, org.slf4j.Logger logger, String serviceName, Map<String,ConfigurationUpdateHelper.PropertyMapping> propertyMappings)
      Processes configuration updates using a property mapping.
      Parameters:
      properties - The configuration properties dictionary
      logger - The logger to use for debug messages
      serviceName - The name of the service for logging purposes
      propertyMappings - Map of property names to their setters and types
    • booleanProperty

      public static ConfigurationUpdateHelper.PropertyMapping booleanProperty(Consumer<Boolean> setter)
      Creates a boolean property mapping.
      Parameters:
      setter - The setter function to call with the boolean value
      Returns:
      PropertyMapping for boolean properties
    • stringProperty

      public static ConfigurationUpdateHelper.PropertyMapping stringProperty(Consumer<String> setter)
      Creates a string property mapping.
      Parameters:
      setter - The setter function to call with the string value
      Returns:
      PropertyMapping for string properties
    • integerProperty

      public static ConfigurationUpdateHelper.PropertyMapping integerProperty(Consumer<Integer> setter)
      Creates an integer property mapping.
      Parameters:
      setter - The setter function to call with the integer value
      Returns:
      PropertyMapping for integer properties
    • longProperty

      public static ConfigurationUpdateHelper.PropertyMapping longProperty(Consumer<Long> setter)
      Creates a long property mapping.
      Parameters:
      setter - The setter function to call with the long value
      Returns:
      PropertyMapping for long properties
    • customProperty

      Creates a custom property mapping for special cases.
      Parameters:
      processor - The custom processor function
      Returns:
      PropertyMapping for custom properties