Class ConfigurationUpdater
java.lang.Object
org.codice.ddf.admin.configuration.ConfigurationUpdater
- All Implemented Interfaces:
org.codice.felix.cm.internal.ConfigurationPersistencePlugin
public class ConfigurationUpdater
extends Object
implements org.codice.felix.cm.internal.ConfigurationPersistencePlugin
Addresses shortcomings of the Felix
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:
- Removes files from etc when they are deleted from
ConfigurationAdmin - Protects against tampering with the
felix.fileinstall.filenameby third parties, which could disrupt the dropping of config files - Ensures password fields in config files are encrypted
enableConfigSave in custom.properties should be set to false.-
Constructor Summary
ConstructorsConstructorDescriptionConfigurationUpdater(org.codice.ddf.admin.core.api.ConfigurationAdmin ddfConfigAdmin, List strategies, ddf.security.encryption.EncryptionService encryptionService) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidhandleDelete(String pid) final voidhandleStore(org.codice.felix.cm.internal.ConfigurationContext context) voidinitialize(Set<org.codice.felix.cm.internal.ConfigurationContext> state) voidsetSecurityLogger(ddf.security.audit.SecurityLogger securityLogger)
-
Constructor Details
-
ConfigurationUpdater
public ConfigurationUpdater(org.codice.ddf.admin.core.api.ConfigurationAdmin ddfConfigAdmin, List strategies, ddf.security.encryption.EncryptionService encryptionService)
-
-
Method Details
-
initialize
- Specified by:
initializein interfaceorg.codice.felix.cm.internal.ConfigurationPersistencePlugin
-
handleStore
public final void handleStore(org.codice.felix.cm.internal.ConfigurationContext context) throws IOException - Specified by:
handleStorein interfaceorg.codice.felix.cm.internal.ConfigurationPersistencePlugin- Throws:
IOException
-
handleDelete
Remove config files from etc when a delete occurs but only if felix is tracking the file.
- Specified by:
handleDeletein interfaceorg.codice.felix.cm.internal.ConfigurationPersistencePlugin- Parameters:
pid- the pid pointing to the configuration to delete.- Throws:
IOException
-
setSecurityLogger
public void setSecurityLogger(ddf.security.audit.SecurityLogger securityLogger)
-