Class OverrideablePollOutagesDaoImpl
- java.lang.Object
-
- org.opennms.netmgt.config.dao.outages.impl.AbstractPollOutagesDao
-
- org.opennms.netmgt.config.dao.outages.impl.OverrideablePollOutagesDaoImpl
-
- All Implemented Interfaces:
OverrideableDao<Outages>
,ReadableDao<Outages>
,WriteableDao<Outages>
,OverrideablePollOutagesDao
,ReadablePollOutagesDao
,WriteablePollOutagesDao
public class OverrideablePollOutagesDaoImpl extends AbstractPollOutagesDao implements OverrideablePollOutagesDao
-
-
Field Summary
-
Fields inherited from class org.opennms.netmgt.config.dao.outages.impl.AbstractPollOutagesDao
JSON_STORE_KEY
-
-
Constructor Summary
Constructors Constructor Description OverrideablePollOutagesDaoImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.concurrent.locks.Lock
getReadLock()
Outages
getReadOnlyConfig()
Get the current configuration.java.util.concurrent.locks.Lock
getWriteLock()
void
onConfigChanged()
Notify the DAO that the configuration it tracks has changed.void
overrideConfig(java.io.InputStream config)
void
overrideConfig(Outages config)
void
reload()
Instructs the DAO to reload the configuration from the backing data source immediately.void
saveConfig()
Save the current configuration held by the DAO.void
withWriteLock(java.util.function.Consumer<Outages> consumerWithLock)
-
Methods inherited from class org.opennms.netmgt.config.dao.outages.impl.AbstractPollOutagesDao
getEndOfOutage, getEndOfOutage, getInterfaces, getNodeIds, getOutageTimes, getOutageType, isCurTimeInOutage, isCurTimeInOutage, isInterfaceInOutage, isInterfaceInOutage, isNodeIdInOutage, isNodeIdInOutage, isTimeInOutage, isTimeInOutage, isTimeInOutage
-
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.common.api.OverrideableDao
getWriteableConfig
-
Methods inherited from interface org.opennms.netmgt.config.dao.outages.api.ReadablePollOutagesDao
getEndOfOutage, getEndOfOutage, getInterfaces, getNodeIds, getOutageTimes, getOutageType, isCurTimeInOutage, isCurTimeInOutage, isInterfaceInOutage, isInterfaceInOutage, isNodeIdInOutage, isNodeIdInOutage, isTimeInOutage, isTimeInOutage, isTimeInOutage
-
-
-
-
Method Detail
-
overrideConfig
public void overrideConfig(java.io.InputStream config)
- Specified by:
overrideConfig
in interfaceOverrideableDao<Outages>
-
overrideConfig
public void overrideConfig(Outages config)
- Specified by:
overrideConfig
in interfaceOverrideableDao<Outages>
-
getReadLock
public java.util.concurrent.locks.Lock getReadLock()
- Specified by:
getReadLock
in interfaceWriteablePollOutagesDao
-
getWriteLock
public java.util.concurrent.locks.Lock getWriteLock()
- Specified by:
getWriteLock
in interfaceWriteablePollOutagesDao
-
withWriteLock
public void withWriteLock(java.util.function.Consumer<Outages> consumerWithLock)
- Specified by:
withWriteLock
in interfaceWriteablePollOutagesDao
-
saveConfig
public void saveConfig()
Description copied from interface:WriteableDao
Save 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:
saveConfig
in interfaceWriteableDao<Outages>
-
onConfigChanged
public void onConfigChanged()
Description copied from interface:WriteableDao
Notify 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:
onConfigChanged
in interfaceWriteableDao<Outages>
-
getReadOnlyConfig
public Outages getReadOnlyConfig()
Description copied from interface:ReadableDao
Get 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:
getReadOnlyConfig
in interfaceReadableDao<Outages>
-
reload
public void reload()
Description copied from interface:ReadableDao
Instructs the DAO to reload the configuration from the backing data source immediately. Whether or not the config actually gets reloaded is up to the implementation as it may already be up to date. However invoking this method should guarantee that a subsequent call toReadableDao.getReadOnlyConfig()
yields the up to date configuration.- Specified by:
reload
in interfaceReadableDao<Outages>
-
-