public class MockOutageDao extends AbstractMockDao<OnmsOutage,Integer> implements OutageDao
AbstractMockDao.NullEventForwarder
Constructor and Description |
---|
MockOutageDao() |
Modifier and Type | Method and Description |
---|---|
int |
countOutagesByNode()
Get the number of nodes with outages.
|
Integer |
currentOutageCount()
currentOutageCount
|
OnmsOutage |
currentOutageForService(OnmsMonitoredService service)
Return the current open outage for the service or if the service
is up and has no open outage, return null.
|
Collection<OnmsOutage> |
currentOutages()
currentOutages
|
Collection<OnmsOutage> |
findAll(Integer offset,
Integer limit)
findAll
|
protected void |
generateId(OnmsOutage outage) |
List<HeatMapElement> |
getHeatMapItemsForEntity(String entityNameColumn,
String entityIdColumn,
String restrictionColumn,
String restrictionValue,
String... groupByColumns)
Retrieves heatmap elements for a given combination of database columns.
|
protected Integer |
getId(OnmsOutage outage) |
List<OutageSummary> |
getNodeOutageSummaries(int rows)
Get the list of current outages, one per node.
|
Collection<OnmsOutage> |
matchingCurrentOutages(ServiceSelector selector)
matchingCurrentOutages
|
Integer |
save(OnmsOutage entity)
When we save an outage, make sure to add the outage to the currentOutages
property of
OnmsMonitoredService . |
afterPropertiesSet, clear, countAll, countMatching, countMatching, delete, delete, findAll, findMatching, findMatching, flush, get, getAlarmDao, getAssetRecordDao, getCategoryDao, getDistPollerDao, getEventDao, getIpInterfaceDao, getMonitoredServiceDao, getNodeDao, getServiceRegistry, getServiceTypeDao, getSnmpInterfaceDao, initialize, load, lock, saveOrUpdate, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
countMatching, findMatching
clear, countAll, countMatching, delete, delete, findAll, findMatching, flush, get, initialize, load, lock, saveOrUpdate, update
protected void generateId(OnmsOutage outage)
generateId
in class AbstractMockDao<OnmsOutage,Integer>
protected Integer getId(OnmsOutage outage)
getId
in class AbstractMockDao<OnmsOutage,Integer>
public Integer save(OnmsOutage entity)
OnmsMonitoredService
.save
in interface OnmsDao<OnmsOutage,Integer>
save
in class AbstractMockDao<OnmsOutage,Integer>
public Integer currentOutageCount()
OutageDao
currentOutageCount
currentOutageCount
in interface OutageDao
Integer
object.public Collection<OnmsOutage> currentOutages()
OutageDao
currentOutages
currentOutages
in interface OutageDao
Collection
object.public OnmsOutage currentOutageForService(OnmsMonitoredService service)
OutageDao
currentOutageForService
in interface OutageDao
public Collection<OnmsOutage> matchingCurrentOutages(ServiceSelector selector)
OutageDao
matchingCurrentOutages
matchingCurrentOutages
in interface OutageDao
selector
- a ServiceSelector
object.Collection
object.public Collection<OnmsOutage> findAll(Integer offset, Integer limit)
OutageDao
findAll
findAll
in interface OutageDao
offset
- a Integer
object.limit
- a Integer
object.Collection
object.public int countOutagesByNode()
OutageDao
countOutagesByNode
in interface OutageDao
public List<OutageSummary> getNodeOutageSummaries(int rows)
OutageDao
getNodeOutageSummaries
in interface OutageDao
rows
- The maximum number of outages to return.public List<HeatMapElement> getHeatMapItemsForEntity(String entityNameColumn, String entityIdColumn, String restrictionColumn, String restrictionValue, String... groupByColumns)
OutageDao
getHeatMapItemsForEntity
in interface OutageDao
entityNameColumn
- the entity's name columnentityIdColumn
- the entity's id columnrestrictionColumn
- a column used for a restriction of the resultsrestrictionValue
- the value that must match against the restrictionColumngroupByColumns
- columns used for the SQL group-by clauseCopyright © 2016. All rights reserved.