use of org.opennms.netmgt.model.OnmsSnmpInterfaceList in project opennms by OpenNMS.
the class OnmsSnmpInterfaceResource method getSnmpInterfaces.
/**
* <p>getSnmpInterfaces</p>
*
* @param nodeCriteria a {@link java.lang.String} object.
* @return a {@link org.opennms.netmgt.model.OnmsSnmpInterfaceList} object.
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public OnmsSnmpInterfaceList getSnmpInterfaces(@Context final UriInfo uriInfo, @PathParam("nodeCriteria") final String nodeCriteria) {
final OnmsNode node = m_nodeDao.get(nodeCriteria);
final MultivaluedMap<String, String> params = uriInfo.getQueryParameters();
final CriteriaBuilder builder = new CriteriaBuilder(OnmsSnmpInterface.class);
builder.ne("collect", "D");
builder.limit(20);
applyQueryFilters(params, builder);
builder.eq("node.id", node.getId());
final OnmsSnmpInterfaceList snmpList = new OnmsSnmpInterfaceList(m_snmpInterfaceDao.findMatching(builder.toCriteria()));
snmpList.setTotalCount(m_snmpInterfaceDao.countMatching(builder.count().toCriteria()));
return snmpList;
}
Aggregations