Search in sources :

Example 1 with OnmsMinionCollection

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

the class MinionRestService method getMinions.

@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.APPLICATION_ATOM_XML })
@Transactional
public OnmsMinionCollection getMinions(@Context final UriInfo uriInfo) throws ParseException {
    final CriteriaBuilder builder = getCriteriaBuilder(uriInfo.getQueryParameters());
    final OnmsMinionCollection coll = new OnmsMinionCollection(m_minionDao.findMatching(builder.toCriteria()));
    coll.setTotalCount(m_minionDao.countMatching(builder.clearOrder().toCriteria()));
    return coll;
}
Also used : CriteriaBuilder(org.opennms.core.criteria.CriteriaBuilder) OnmsMinionCollection(org.opennms.netmgt.model.OnmsMinionCollection) 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 OnmsMinionCollection (org.opennms.netmgt.model.OnmsMinionCollection)1 Transactional (org.springframework.transaction.annotation.Transactional)1