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 void
generateId(OnmsAcknowledgment ack)
Integer
getId(OnmsAcknowledgment ack)
void
processAck(OnmsAcknowledgment ack)
processAckvoid
processAcks(Collection<OnmsAcknowledgment> acks)
processAcksvoid
updateAckable(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:
generateId
in classAbstractMockDao<OnmsAcknowledgment,Integer>
-
getId
public Integer getId(OnmsAcknowledgment ack)
- Specified by:
getId
in classAbstractMockDao<OnmsAcknowledgment,Integer>
-
findAcknowledgables
public List<Acknowledgeable> findAcknowledgables(OnmsAcknowledgment ack)
Description copied from interface:AcknowledgmentDao
findAcknowledgables
- Specified by:
findAcknowledgables
in interfaceAcknowledgmentDao
- Parameters:
ack
- aOnmsAcknowledgment
object.- Returns:
- a
List
object.
-
updateAckable
public void updateAckable(Acknowledgeable ackable)
Description copied from interface:AcknowledgmentDao
updateAckable
- Specified by:
updateAckable
in interfaceAcknowledgmentDao
- Parameters:
ackable
- aAcknowledgeable
object.
-
processAck
public void processAck(OnmsAcknowledgment ack)
Description copied from interface:AcknowledgmentDao
processAck
- Specified by:
processAck
in interfaceAcknowledgmentDao
- Parameters:
ack
- aOnmsAcknowledgment
object.
-
processAcks
public void processAcks(Collection<OnmsAcknowledgment> acks)
Description copied from interface:AcknowledgmentDao
processAcks
- Specified by:
processAcks
in interfaceAcknowledgmentDao
- Parameters:
acks
- aCollection
object.
-
findLatestAcks
public List<OnmsAcknowledgment> findLatestAcks(Date from)
Description copied from interface:AcknowledgmentDao
findLatestAcks
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:
findLatestAcks
in 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:AcknowledgmentDao
findLatestAckForRefId
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:
findLatestAckForRefId
in 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
-
-