public Collection<OnmsOutage> currentOutagesByRange(Integer offset,
Integer limit, String orderProperty, String direction) {
if (offset == null) {
throw new IllegalArgumentException("argument offset cannot be null");
}
if (limit == null) {
throw new IllegalArgumentException("argument limit cannot be null");
}
if (orderProperty == null) {
throw new IllegalArgumentException("argument orderProperty cannot be null");
}
if (direction == null) {
throw new IllegalArgumentException("argument direction cannot be null");
}
OnmsCriteria crit = new OnmsCriteria(OnmsOutage.class);
Collection<OnmsOutage> outages = new LinkedList<OnmsOutage>();
//Order order = null;
//Order.asc(orderProperty);
crit.add(Restrictions.between("id", offset, limit));
crit.add(Restrictions.isNull("ifRegainedService"));
Date now = new Date();
crit.add(Restrictions.lt("suppressTime", now));
//crit.addOrder(order);
outages = findMatching(crit);
return outages;
}