Package org.opennms.netmgt.dao.mock
Class MockAcknowledgmentDao
- java.lang.Object
-
- org.opennms.netmgt.dao.mock.AbstractMockDao<OnmsAcknowledgment,Integer>
-
- org.opennms.netmgt.dao.mock.MockAcknowledgmentDao
-
- All Implemented Interfaces:
AcknowledgmentDao,LegacyOnmsDao<OnmsAcknowledgment,Integer>,OnmsDao<OnmsAcknowledgment,Integer>,org.springframework.beans.factory.InitializingBean
public class MockAcknowledgmentDao extends AbstractMockDao<OnmsAcknowledgment,Integer> implements AcknowledgmentDao
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opennms.netmgt.dao.mock.AbstractMockDao
AbstractMockDao.NullEventForwarder
-
-
Constructor Summary
Constructors Constructor Description MockAcknowledgmentDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Acknowledgeable>findAcknowledgables(OnmsAcknowledgment ack)findAcknowledgablesOptional<OnmsAcknowledgment>findLatestAckForRefId(Integer refId)findLatestAckForRefIdList<OnmsAcknowledgment>findLatestAcks(Date from)findLatestAcksprotected voidgenerateId(OnmsAcknowledgment ack)IntegergetId(OnmsAcknowledgment ack)voidprocessAck(OnmsAcknowledgment ack)processAckvoidprocessAcks(Collection<OnmsAcknowledgment> acks)processAcksvoidupdateAckable(Acknowledgeable ackable)updateAckable-
Methods inherited from class org.opennms.netmgt.dao.mock.AbstractMockDao
afterPropertiesSet, clear, countAll, countMatching, countMatching, delete, delete, findAll, findMatching, findMatching, flush, get, getAlarmAssociationDao, getAlarmDao, getAssetRecordDao, getCategoryDao, getDistPollerDao, getEventDao, getIpInterfaceDao, getMonitoredServiceDao, getMonitoringLocationDao, getNodeDao, getServiceRegistry, getServiceTypeDao, getSnmpInterfaceDao, initialize, load, lock, save, saveOrUpdate, update
-
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.OnmsDao
clear, countAll, countMatching, delete, delete, findAll, findMatching, flush, get, initialize, load, lock, save, saveOrUpdate, update
-
-
-
-
Method Detail
-
generateId
protected void generateId(OnmsAcknowledgment ack)
- Specified by:
generateIdin classAbstractMockDao<OnmsAcknowledgment,Integer>
-
getId
public Integer getId(OnmsAcknowledgment ack)
- Specified by:
getIdin classAbstractMockDao<OnmsAcknowledgment,Integer>
-
findAcknowledgables
public List<Acknowledgeable> findAcknowledgables(OnmsAcknowledgment ack)
Description copied from interface:AcknowledgmentDaofindAcknowledgables
- Specified by:
findAcknowledgablesin interfaceAcknowledgmentDao- Parameters:
ack- aOnmsAcknowledgmentobject.- Returns:
- a
Listobject.
-
updateAckable
public void updateAckable(Acknowledgeable ackable)
Description copied from interface:AcknowledgmentDaoupdateAckable
- Specified by:
updateAckablein interfaceAcknowledgmentDao- Parameters:
ackable- aAcknowledgeableobject.
-
processAck
public void processAck(OnmsAcknowledgment ack)
Description copied from interface:AcknowledgmentDaoprocessAck
- Specified by:
processAckin interfaceAcknowledgmentDao- Parameters:
ack- aOnmsAcknowledgmentobject.
-
processAcks
public void processAcks(Collection<OnmsAcknowledgment> acks)
Description copied from interface:AcknowledgmentDaoprocessAcks
- Specified by:
processAcksin interfaceAcknowledgmentDao- Parameters:
acks- aCollectionobject.
-
findLatestAcks
public List<OnmsAcknowledgment> findLatestAcks(Date from)
Description copied from interface:AcknowledgmentDaofindLatestAcks
Finds the latest acknowledgement for each refId. The latest acknowledgement is selected based on the most recent ackTime (and highest Id in the case of multiple occuring at the same time).- Specified by:
findLatestAcksin interfaceAcknowledgmentDao- Parameters:
from- limit results to acks created on or after- Returns:
- the list of latest acks (empty list in the case of no acks found)
-
findLatestAckForRefId
public Optional<OnmsAcknowledgment> findLatestAckForRefId(Integer refId)
Description copied from interface:AcknowledgmentDaofindLatestAckForRefId
Finds the latest acknowledgement for the given refId. The latest acknowledgement is selected based on the most recent ackTime (and highest Id in the case of multiple occurring at the same time).- Specified by:
findLatestAckForRefIdin interfaceAcknowledgmentDao- Parameters:
refId- the refId to search for- Returns:
- an optional containing the latest ack for the given refId or Optional.empty() if none found
-
-