本文整理汇总了Java中org.opennms.netmgt.model.OnmsEvent.setEventAckUser方法的典型用法代码示例。如果您正苦于以下问题:Java OnmsEvent.setEventAckUser方法的具体用法?Java OnmsEvent.setEventAckUser怎么用?Java OnmsEvent.setEventAckUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opennms.netmgt.model.OnmsEvent
的用法示例。
在下文中一共展示了OnmsEvent.setEventAckUser方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processEventAck
import org.opennms.netmgt.model.OnmsEvent; //导入方法依赖的package包/类
private void processEventAck(final OnmsEvent event, final Boolean ack) {
if (ack) {
event.setEventAckTime(new Date());
event.setEventAckUser(m_securityContext.getUserPrincipal().getName());
} else {
event.setEventAckTime(null);
event.setEventAckUser(null);
}
m_eventDao.save(event);
}
示例2: acknowledgeMatchingEvents
import org.opennms.netmgt.model.OnmsEvent; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Transactional
public void acknowledgeMatchingEvents(String user, Date timestamp, EventCriteria criteria) {
List<OnmsEvent> events = m_eventDao.findMatching(getOnmsCriteria(criteria));
Iterator<OnmsEvent> eventsIt = events.iterator();
while(eventsIt.hasNext()){
OnmsEvent event = eventsIt.next();
event.setEventAckUser(user);
event.setEventAckTime(timestamp);
m_eventDao.update(event);
}
}
示例3: unacknowledgeMatchingEvents
import org.opennms.netmgt.model.OnmsEvent; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Transactional
public void unacknowledgeMatchingEvents(EventCriteria criteria) {
List<OnmsEvent> events = m_eventDao.findMatching(getOnmsCriteria(criteria));
for(OnmsEvent event : events) {
event.setEventAckUser(null);
event.setEventAckTime(null);
m_eventDao.update(event);
}
}
示例4: processEventAck
import org.opennms.netmgt.model.OnmsEvent; //导入方法依赖的package包/类
private void processEventAck(final OnmsEvent event, final Boolean ack) {
if (ack) {
event.setEventAckTime(new Date());
event.setEventAckUser(m_securityContext.getUserPrincipal().getName());
} else {
event.setEventAckTime(null);
event.setEventAckUser(null);
}
m_eventDao.save(event);
}