Class OnmsThreshdDao
- java.lang.Object
-
- org.opennms.netmgt.config.dao.thresholding.impl.AbstractThreshdDao
-
- org.opennms.netmgt.config.dao.thresholding.impl.OnmsThreshdDao
-
- All Implemented Interfaces:
ReadableDao<ThreshdConfiguration>,WriteableDao<ThreshdConfiguration>,ReadableThreshdDao,WriteableThreshdDao
public class OnmsThreshdDao extends AbstractThreshdDao implements WriteableThreshdDao
-
-
Field Summary
-
Fields inherited from class org.opennms.netmgt.config.dao.thresholding.impl.AbstractThreshdDao
JSON_STORE_KEY
-
-
Constructor Summary
Constructors Constructor Description OnmsThreshdDao(JsonStore jsonStore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThreshdConfigurationgetReadOnlyConfig()Get the current configuration.ThreshdConfigurationgetWriteableConfig()This method returns the mutable configuration object for which any changes made to it will be persisted and reflected after a call toWriteableDao.saveConfig().voidonConfigChanged()Notify the DAO that the configuration it tracks has changed.voidreload()Subclasses should call this reload after they have performed their reload logic.voidsaveConfig()Save the current configuration held by the DAO.-
Methods inherited from class org.opennms.netmgt.config.dao.thresholding.impl.AbstractThreshdDao
interfaceInPackage, rebuildPackageIpListMap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.netmgt.config.dao.thresholding.api.ReadableThreshdDao
interfaceInPackage, rebuildPackageIpListMap
-
-
-
-
Constructor Detail
-
OnmsThreshdDao
public OnmsThreshdDao(JsonStore jsonStore) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getReadOnlyConfig
public ThreshdConfiguration getReadOnlyConfig()
Description copied from interface:ReadableDaoGet the current configuration. Whether or not this configuration is in sync with the backing data source is up to the implementation, seeReadableDao.reload(). The value returned by this method may be the result of merging multiple objects together. As a result, mutations to this object may not be visible to other readers and are not permitted. For cases where mutation and/or persistence of changes is required seeWriteableDao.getWriteableConfig().- Specified by:
getReadOnlyConfigin interfaceReadableDao<ThreshdConfiguration>- Returns:
- the merged configuration consisting of the filesystem configuration and any configuration provided by extensions
-
getWriteableConfig
public ThreshdConfiguration getWriteableConfig()
Description copied from interface:WriteableDaoThis method returns the mutable configuration object for which any changes made to it will be persisted and reflected after a call toWriteableDao.saveConfig().- Specified by:
getWriteableConfigin interfaceWriteableDao<ThreshdConfiguration>- Returns:
- just the configuration from the filesystem since configuration provided by extensions is read only
-
reload
public void reload()
Description copied from class:AbstractThreshdDaoSubclasses should call this reload after they have performed their reload logic.- Specified by:
reloadin interfaceReadableDao<ThreshdConfiguration>- Overrides:
reloadin classAbstractThreshdDao
-
saveConfig
public void saveConfig()
Description copied from interface:WriteableDaoSave the current configuration held by the DAO.The configuration held by the DAO may not necessarily be the same configuration reference as returned by
WriteableDao.getWriteableConfig()if the config has been reloaded in between calls. This implies any changes to the reference returned byWriteableDao.getWriteableConfig()will not be reflected when saved in this case.- Specified by:
saveConfigin interfaceWriteableDao<ThreshdConfiguration>
-
onConfigChanged
public void onConfigChanged()
Description copied from interface:WriteableDaoNotify the DAO that the configuration it tracks has changed.Call this method after updating the filesystem configuration directly or after providing a config extension.
- Specified by:
onConfigChangedin interfaceWriteableDao<ThreshdConfiguration>
-
-