Search in sources :

Example 1 with GtRestriction

use of org.opennms.core.criteria.restrictions.GtRestriction in project opennms by OpenNMS.

the class HypericAckProcessor method fetchUnclearedHypericAlarms.

/**
     * <p>fetchUnclearedHypericAlarms</p>
     *
     * @return a {@link java.util.List} object.
     */
public List<OnmsAlarm> fetchUnclearedHypericAlarms() {
    // Query for existing, unacknowledged alarms in OpenNMS that were generated based on Hyperic alerts
    Criteria criteria = new Criteria(OnmsAlarm.class);
    // criteria.add(Restrictions.isNull("alarmAckUser"));
    // Restrict to Hyperic alerts
    criteria.addRestriction(new EqRestriction("uei", "uei.opennms.org/external/hyperic/alert"));
    // Only consider alarms that are above severity NORMAL
    // {@see org.opennms.netmgt.model.OnmsSeverity}
    criteria.addRestriction(new GtRestriction("severity", OnmsSeverity.NORMAL));
    // Query list of outstanding alerts with remote platform identifiers
    return m_alarmDao.findMatching(criteria);
}
Also used : EqRestriction(org.opennms.core.criteria.restrictions.EqRestriction) Criteria(org.opennms.core.criteria.Criteria) GtRestriction(org.opennms.core.criteria.restrictions.GtRestriction)

Aggregations

Criteria (org.opennms.core.criteria.Criteria)1 EqRestriction (org.opennms.core.criteria.restrictions.EqRestriction)1 GtRestriction (org.opennms.core.criteria.restrictions.GtRestriction)1