public class OnmsPollOutagesDao extends AbstractPollOutagesDao implements WriteablePollOutagesDao
JSON_STORE_KEY
Constructor and Description |
---|
OnmsPollOutagesDao(JsonStore jsonStore) |
Modifier and Type | Method and Description |
---|---|
Lock |
getReadLock() |
Outages |
getReadOnlyConfig()
Get the current configuration.
|
Outages |
getWriteableConfig()
This DAO doesn't currently merge any configuration so we can serve the read only configuration directly.
|
Lock |
getWriteLock() |
void |
onConfigChanged()
Notify the DAO that the configuration it tracks has changed.
|
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) |
getEndOfOutage, getEndOfOutage, getInterfaces, getNodeIds, getOutageTimes, getOutageType, isCurTimeInOutage, isCurTimeInOutage, isInterfaceInOutage, isInterfaceInOutage, isNodeIdInOutage, isNodeIdInOutage, isTimeInOutage, isTimeInOutage, isTimeInOutage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEndOfOutage, getEndOfOutage, getInterfaces, getNodeIds, getOutageTimes, getOutageType, isCurTimeInOutage, isCurTimeInOutage, isInterfaceInOutage, isInterfaceInOutage, isNodeIdInOutage, isNodeIdInOutage, isTimeInOutage, isTimeInOutage, isTimeInOutage
public OnmsPollOutagesDao(JsonStore jsonStore) throws IOException
IOException
public Lock getReadLock()
getReadLock
in interface WriteablePollOutagesDao
public Lock getWriteLock()
getWriteLock
in interface WriteablePollOutagesDao
public void withWriteLock(java.util.function.Consumer<Outages> consumerWithLock)
withWriteLock
in interface WriteablePollOutagesDao
public void saveConfig()
WriteableDao
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 by WriteableDao.getWriteableConfig()
will not be reflected when saved in this case.
saveConfig
in interface WriteableDao<Outages>
public Outages getReadOnlyConfig()
ReadableDao
ReadableDao.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 see WriteableDao.getWriteableConfig()
.getReadOnlyConfig
in interface ReadableDao<Outages>
public Outages getWriteableConfig()
getWriteableConfig
in interface WriteableDao<Outages>
public void reload()
ReadableDao
ReadableDao.getReadOnlyConfig()
yields the up to date configuration.reload
in interface ReadableDao<Outages>
public void onConfigChanged()
WriteableDao
Call this method after updating the filesystem configuration directly or after providing a config extension.
onConfigChanged
in interface WriteableDao<Outages>
Copyright © 2020. All rights reserved.