use of org.opennms.core.criteria.restrictions.BetweenRestriction in project opennms by OpenNMS.
the class LocationBroadcastProcessor method afterPropertiesSet.
/**
* <p>afterPropertiesSet</p>
*
* @throws java.lang.Exception if any.
*/
@Override
public void afterPropertiesSet() throws Exception {
BeanUtils.assertAutowiring(this);
m_task = new TimerTask() {
private Date m_lastRun = new Date();
@Override
public void run() {
final Date now = new Date();
final Criteria criteria = new Criteria(OnmsEvent.class).addRestriction(new BetweenRestriction("eventTime", m_lastRun, now)).addRestriction(new InRestriction("eventUei", m_events));
for (final OnmsEvent e : m_eventDao.findMatching(criteria)) {
handleLocationEvent(e);
}
m_lastRun = now;
}
};
//m_timer.schedule(m_task, UPDATE_PERIOD, UPDATE_PERIOD);
}
Aggregations