Search in sources :

Example 26 with OnmsAcknowledgment

use of org.opennms.netmgt.model.OnmsAcknowledgment in project opennms by OpenNMS.

the class DaoWebNotificationRepository method acknowledgeMatchingNotification.

/**
 * {@inheritDoc}
 */
@Transactional
@Override
public void acknowledgeMatchingNotification(String user, Date timestamp, NotificationCriteria criteria) {
    List<OnmsNotification> notifs = m_notificationDao.findMatching(getOnmsCriteria(criteria));
    for (OnmsNotification notif : notifs) {
        OnmsAcknowledgment ack = new OnmsAcknowledgment(notif, user);
        ack.setAckAction(AckAction.ACKNOWLEDGE);
        ack.setAckTime(timestamp);
        m_ackDao.processAck(ack);
    }
}
Also used : OnmsAcknowledgment(org.opennms.netmgt.model.OnmsAcknowledgment) OnmsNotification(org.opennms.netmgt.model.OnmsNotification) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

OnmsAcknowledgment (org.opennms.netmgt.model.OnmsAcknowledgment)26 OnmsAlarm (org.opennms.netmgt.model.OnmsAlarm)14 Test (org.junit.Test)11 Transactional (org.springframework.transaction.annotation.Transactional)10 Date (java.util.Date)6 OnmsNotification (org.opennms.netmgt.model.OnmsNotification)6 Message (javax.mail.Message)4 OnmsEvent (org.opennms.netmgt.model.OnmsEvent)4 OnmsNode (org.opennms.netmgt.model.OnmsNode)4 ArrayList (java.util.ArrayList)3 InternetAddress (javax.mail.internet.InternetAddress)3 MimeMessage (javax.mail.internet.MimeMessage)3 Consumes (javax.ws.rs.Consumes)3 SendmailMessage (org.opennms.netmgt.config.javamail.SendmailMessage)3 Properties (java.util.Properties)2 Address (javax.mail.Address)2 MessagingException (javax.mail.MessagingException)2 PUT (javax.ws.rs.PUT)2 JUnitTemporaryDatabase (org.opennms.core.test.db.annotations.JUnitTemporaryDatabase)2 OnmsCriteria (org.opennms.netmgt.model.OnmsCriteria)2