Class ConfigurationUpdateHelper
java.lang.Object
org.apache.unomi.persistence.spi.config.ConfigurationUpdateHelper
Utility class to handle configuration updates in ManagedService implementations.
This class provides generic methods to process configuration property changes
without hardcoding specific property names.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Functional interface for property processing.static interface
Functional interface for custom property processing. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanProperty
(Consumer<Boolean> setter) Creates a boolean property mapping.Creates a custom property mapping for special cases.integerProperty
(Consumer<Integer> setter) Creates an integer property mapping.longProperty
(Consumer<Long> setter) Creates a long property mapping.static void
processConfigurationUpdates
(Dictionary<String, ?> properties, org.slf4j.Logger logger, String serviceName, Map<String, ConfigurationUpdateHelper.PropertyMapping> propertyMappings) Processes configuration updates using a property mapping.stringProperty
(Consumer<String> setter) Creates a string property mapping.
-
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 dictionarylogger
- The logger to use for debug messagesserviceName
- The name of the service for logging purposespropertyMappings
- Map of property names to their setters and types
-
booleanProperty
Creates a boolean property mapping.- Parameters:
setter
- The setter function to call with the boolean value- Returns:
- PropertyMapping for boolean properties
-
stringProperty
Creates a string property mapping.- Parameters:
setter
- The setter function to call with the string value- Returns:
- PropertyMapping for string properties
-
integerProperty
Creates an integer property mapping.- Parameters:
setter
- The setter function to call with the integer value- Returns:
- PropertyMapping for integer properties
-
longProperty
Creates a long property mapping.- Parameters:
setter
- The setter function to call with the long value- Returns:
- PropertyMapping for long properties
-
customProperty
public static ConfigurationUpdateHelper.PropertyMapping customProperty(ConfigurationUpdateHelper.PropertyProcessor processor) Creates a custom property mapping for special cases.- Parameters:
processor
- The custom processor function- Returns:
- PropertyMapping for custom properties
-