Package org.opennms.netmgt.dao.hibernate
Class OutageDaoHibernate
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- org.springframework.orm.hibernate3.support.HibernateDaoSupport
-
- org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate<OnmsOutage,java.lang.Integer>
-
- org.opennms.netmgt.dao.hibernate.OutageDaoHibernate
-
- All Implemented Interfaces:
LegacyOnmsDao<OnmsOutage,java.lang.Integer>
,OnmsDao<OnmsOutage,java.lang.Integer>
,OutageDao
,org.springframework.beans.factory.InitializingBean
public class OutageDaoHibernate extends AbstractDaoHibernate<OnmsOutage,java.lang.Integer> implements OutageDao
-
-
Field Summary
-
Fields inherited from class org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate
m_criteriaConverter
-
-
Constructor Summary
Constructors Constructor Description OutageDaoHibernate()
Constructor for OutageDaoHibernate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
countOutagesByNode()
Get the number of nodes with outages.java.lang.Integer
currentOutageCount()
currentOutageCountOnmsOutage
currentOutageForService(OnmsMonitoredService service)
Return the current open outage for the service or if the service is up and has no open outage, return null.OnmsOutage
currentOutageForServiceFromPerspective(OnmsMonitoredService service, OnmsMonitoringLocation perspective)
java.util.Collection<OnmsOutage>
currentOutages()
currentOutagesjava.util.Collection<OnmsOutage>
currentOutagesForServiceFromPerspectivePoller(OnmsMonitoredService service)
Return all current open outages for the given service be it detected from Perspective Poller.java.util.Collection<OnmsOutage>
findAll(java.lang.Integer offset, java.lang.Integer limit)
findAlljava.util.List<HeatMapElement>
getHeatMapItemsForEntity(java.lang.String entityNameColumn, java.lang.String entityIdColumn, java.lang.String restrictionColumn, java.lang.String restrictionValue, java.lang.String... groupByColumns)
Retrieves heatmap elements for a given combination of database columns.java.util.List<OutageSummary>
getNodeOutageSummaries(int rows)
Get the list of current outages, one per node.java.util.Collection<OnmsOutage>
getStatusChangesForApplicationIdBetween(java.util.Date startDate, java.util.Date endDate, java.lang.Integer applicationId)
java.util.Collection<OnmsOutage>
matchingCurrentOutages(ServiceSelector selector)
Finds all current (unresolved) outages that match the given service selector.java.util.Collection<CurrentOutageDetails>
newestCurrentOutages(java.util.List<java.lang.String> serviceNames)
Finds the latest (unresolved) outages that match the given services.-
Methods inherited from class org.opennms.netmgt.dao.hibernate.AbstractDaoHibernate
buildHibernateCallback, bulkDelete, clear, countAll, countMatching, countMatching, delete, delete, deleteAll, find, find, findAll, findMatching, findMatching, findObjects, findUnique, flush, get, initDao, initialize, load, lock, merge, queryInt, queryInt, save, saveOrUpdate, update
-
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
-
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.dao.api.LegacyOnmsDao
countMatching, findMatching
-
Methods inherited from interface org.opennms.netmgt.dao.api.OnmsDao
clear, countAll, countMatching, delete, delete, findAll, findMatching, flush, get, initialize, load, lock, save, saveOrUpdate, update
-
-
-
-
Method Detail
-
currentOutageCount
public java.lang.Integer currentOutageCount()
currentOutageCount
- Specified by:
currentOutageCount
in interfaceOutageDao
- Returns:
- a
Integer
object.
-
currentOutages
public java.util.Collection<OnmsOutage> currentOutages()
currentOutages
- Specified by:
currentOutages
in interfaceOutageDao
- Returns:
- a
Collection
object.
-
currentOutageForService
public OnmsOutage currentOutageForService(OnmsMonitoredService service)
Description copied from interface:OutageDao
Return the current open outage for the service or if the service is up and has no open outage, return null.- Specified by:
currentOutageForService
in interfaceOutageDao
-
currentOutageForServiceFromPerspective
public OnmsOutage currentOutageForServiceFromPerspective(OnmsMonitoredService service, OnmsMonitoringLocation perspective)
- Specified by:
currentOutageForServiceFromPerspective
in interfaceOutageDao
-
currentOutagesForServiceFromPerspectivePoller
public java.util.Collection<OnmsOutage> currentOutagesForServiceFromPerspectivePoller(OnmsMonitoredService service)
Description copied from interface:OutageDao
Return all current open outages for the given service be it detected from Perspective Poller.- Specified by:
currentOutagesForServiceFromPerspectivePoller
in interfaceOutageDao
-
findAll
public java.util.Collection<OnmsOutage> findAll(java.lang.Integer offset, java.lang.Integer limit)
findAll
-
newestCurrentOutages
public java.util.Collection<CurrentOutageDetails> newestCurrentOutages(java.util.List<java.lang.String> serviceNames)
Finds the latest (unresolved) outages that match the given services.- Specified by:
newestCurrentOutages
in interfaceOutageDao
- Parameters:
serviceNames
- a list of services- Returns:
- a
Collection
of outages
-
matchingCurrentOutages
public java.util.Collection<OnmsOutage> matchingCurrentOutages(ServiceSelector selector)
Finds all current (unresolved) outages that match the given service selector.- Specified by:
matchingCurrentOutages
in interfaceOutageDao
- Parameters:
selector
- a service selector (filter + service list)- Returns:
- a
Collection
of outages
-
countOutagesByNode
public int countOutagesByNode()
Get the number of nodes with outages.- Specified by:
countOutagesByNode
in interfaceOutageDao
- Returns:
- the number of nodes with outages.
-
getNodeOutageSummaries
public java.util.List<OutageSummary> getNodeOutageSummaries(int rows)
Get the list of current outages, one per node. If a node has more than one outage, the oldest outstanding outage is returned.- Specified by:
getNodeOutageSummaries
in interfaceOutageDao
- Parameters:
rows
- The maximum number of outages to return.- Returns:
- A list of outages.
-
getHeatMapItemsForEntity
public java.util.List<HeatMapElement> getHeatMapItemsForEntity(java.lang.String entityNameColumn, java.lang.String entityIdColumn, java.lang.String restrictionColumn, java.lang.String restrictionValue, java.lang.String... groupByColumns)
Description copied from interface:OutageDao
Retrieves heatmap elements for a given combination of database columns.- Specified by:
getHeatMapItemsForEntity
in interfaceOutageDao
- Parameters:
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 clause- Returns:
- the heatmap elements for this query
-
getStatusChangesForApplicationIdBetween
public java.util.Collection<OnmsOutage> getStatusChangesForApplicationIdBetween(java.util.Date startDate, java.util.Date endDate, java.lang.Integer applicationId)
- Specified by:
getStatusChangesForApplicationIdBetween
in interfaceOutageDao
-
-