use of org.opennms.core.criteria.CriteriaBuilder in project opennms by OpenNMS.
the class AlarmStatsRestService method getNewestUnacknowledged.
private OnmsAlarm getNewestUnacknowledged(final OnmsSeverity severity) {
final CriteriaBuilder builder = getCriteriaBuilder(severity);
builder.orderBy("lastEventTime").desc();
builder.orderBy("id").desc();
builder.limit(1);
final Criteria criteria = builder.toCriteria();
LOG.debug("getNewestUnacknowledged({}) criteria = {}", severity, criteria);
return m_statisticsService.getUnacknowledged(criteria);
}
use of org.opennms.core.criteria.CriteriaBuilder in project opennms by OpenNMS.
the class AlarmStatsRestService method getOldestAcknowledged.
protected OnmsAlarm getOldestAcknowledged(final OnmsSeverity severity) {
final CriteriaBuilder builder = getCriteriaBuilder(severity);
builder.orderBy("firstEventTime").asc();
builder.orderBy("id").asc();
builder.limit(1);
final Criteria criteria = builder.toCriteria();
LOG.debug("getOldestAcknowledged({}) criteria = {}", severity, criteria);
return m_statisticsService.getAcknowledged(criteria);
}
use of org.opennms.core.criteria.CriteriaBuilder in project opennms by OpenNMS.
the class AlarmStatsRestService method getOldestUnacknowledged.
private OnmsAlarm getOldestUnacknowledged(final OnmsSeverity severity) {
final CriteriaBuilder builder = getCriteriaBuilder(severity);
builder.orderBy("firstEventTime").asc();
builder.orderBy("id").asc();
builder.limit(1);
final Criteria criteria = builder.toCriteria();
LOG.debug("getOldestUnacknowledged({}) criteria = {}", severity, criteria);
return m_statisticsService.getUnacknowledged(criteria);
}
use of org.opennms.core.criteria.CriteriaBuilder in project opennms by OpenNMS.
the class AlarmRestServiceBase method getCriteria.
protected Criteria getCriteria(final MultivaluedMap<String, String> params, final boolean stripOrdering) {
final CriteriaBuilder cb = getCriteriaBuilder(params, stripOrdering);
final Criteria criteria = cb.toCriteria();
LOG.debug("criteria = {}", criteria);
return criteria;
}
use of org.opennms.core.criteria.CriteriaBuilder in project opennms by OpenNMS.
the class EventRestService method getCriteriaBuilder.
private static CriteriaBuilder getCriteriaBuilder(final MultivaluedMap<String, String> params) {
final CriteriaBuilder builder = new CriteriaBuilder(OnmsEvent.class);
builder.alias("node", "node", JoinType.LEFT_JOIN);
builder.alias("node.snmpInterfaces", "snmpInterface", JoinType.LEFT_JOIN);
builder.alias("node.ipInterfaces", "ipInterface", JoinType.LEFT_JOIN);
builder.alias("node.location", "location", JoinType.LEFT_JOIN);
builder.alias("serviceType", "serviceType", JoinType.LEFT_JOIN);
applyQueryFilters(params, builder);
return builder;
}
Aggregations