public class ConfigurationUpdater extends Object implements ConfigurationPersistencePlugin
ConfigInstaller with our own implementation that
properly updates the etc directory.
This configuration installer handles writeback like the Felix one did and does a few other things:
ConfigurationAdmin
felix.fileinstall.filename by third parties,
which could disrupt the dropping of config files
enableConfigSave in custom.properties should be set to false.| Constructor and Description |
|---|
ConfigurationUpdater(ConfigurationAdmin ddfConfigAdmin,
List strategies,
EncryptionService encryptionService) |
| Modifier and Type | Method and Description |
|---|---|
void |
handleDelete(String pid)
Given the pid of a configuration about to be deleted, perform processing before the
configuration is deleted.
|
void |
handleStore(ConfigurationContext context)
Given the
ConfigurationContext of a configuration about to be written, perform
processing before the results get stored. |
void |
initialize(Set<ConfigurationContext> state)
Provide an initialization hook for synchronous resource allocation after a plugin is
available to be called, unlike an OSGi life-cycle
init() method, which is called prior
to the service becoming available. |
public ConfigurationUpdater(ConfigurationAdmin ddfConfigAdmin, List strategies, EncryptionService encryptionService)
public void initialize(Set<ConfigurationContext> state)
ConfigurationPersistencePlugininit() method, which is called prior
to the service becoming available.initialize in interface ConfigurationPersistencePluginstate - the current configuration state of the system.ConfigurationPersistencePluginpublic void handleStore(ConfigurationContext context) throws IOException
ConfigurationPersistencePluginConfigurationContext of a configuration about to be written, perform
processing before the results get stored.handleStore in interface ConfigurationPersistencePlugincontext - an object of relevant info that is safe to access during a config operation.IOException - to abort the configuration update operation and indicate to the user that
it failed.public void handleDelete(String pid) throws IOException
Remove config files from etc when a delete occurs but only if felix is tracking the file.
handleDelete in interface ConfigurationPersistencePluginpid - the pid pointing to the configuration to delete.IOException - to abort the configuration delete operation and indicate to the user that
it failed.This work is licensed under a Creative Commons Attribution 4.0 International License.