Search in sources :

Example 1 with OnmsAcknowledgmentCollection

use of org.opennms.netmgt.model.OnmsAcknowledgmentCollection in project opennms by OpenNMS.

the class AcknowledgmentRestService method getAcks.

/**
     * <p>getAcks</p>
     *
     * @return a {@link org.opennms.netmgt.model.OnmsAcknowledgmentCollection} object.
     */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_ATOM_XML })
@Transactional
public OnmsAcknowledgmentCollection getAcks(@Context final UriInfo uriInfo) {
    final CriteriaBuilder builder = getQueryFilters(uriInfo.getQueryParameters());
    OnmsAcknowledgmentCollection coll = new OnmsAcknowledgmentCollection(m_ackDao.findMatching(builder.toCriteria()));
    //For getting totalCount
    builder.clearOrder();
    builder.limit(null);
    builder.offset(null);
    coll.setTotalCount(m_ackDao.countMatching(builder.toCriteria()));
    return coll;
}
Also used : CriteriaBuilder(org.opennms.core.criteria.CriteriaBuilder) OnmsAcknowledgmentCollection(org.opennms.netmgt.model.OnmsAcknowledgmentCollection) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) Transactional(org.springframework.transaction.annotation.Transactional)

Aggregations

GET (javax.ws.rs.GET)1 Produces (javax.ws.rs.Produces)1 CriteriaBuilder (org.opennms.core.criteria.CriteriaBuilder)1 OnmsAcknowledgmentCollection (org.opennms.netmgt.model.OnmsAcknowledgmentCollection)1 Transactional (org.springframework.transaction.annotation.Transactional)1