if (isDebugOn())
debug("getGetNextHandlers","Received MIB request : " + req);
AcmChecker checker = new AcmChecker(req);
int index=0;
SnmpVarBind var = null;
final int ver= req.getVersion();
SnmpOid original = null;
// For each varbind, finds the handling node.
// This function has the side effect of transforming a GET-NEXT
// request into a valid GET request, replacing the OIDs in the
// original GET-NEXT request with the OID of the first leaf that
// follows.
for (Enumeration e= req.getElements(); e.hasMoreElements(); index++) {
var = (SnmpVarBind) e.nextElement();
SnmpOid result = null;
try {
// Find the node handling the OID that follows the varbind
// OID. `result' contains this next leaf OID.
//ACM loop.
if (isDebugOn())
debug("getGetNextHandlers"," Next Oid of :" + var.oid);
result = new SnmpOid(root.findNextHandlingNode
(var,var.oid.longValue(false),0,
0,handlers, checker));
if (isDebugOn())
debug("getGetNextHandlers"," is :" + result);
// We replace the varbind original OID with the OID of the
// leaf object we have to return.
var.oid = result;
} catch(SnmpStatusException x) {
// if (isDebugOn())
// debug("getGetNextHandlers",
// "Couldn't find a handling node for "
// + var.oid.toString());
if (ver == SnmpDefinitions.snmpVersionOne) {
if (isDebugOn())
debug("getGetNextHandlers","\tThrowing exception" +
x.toString());
// The index in the exception must correspond to the
// SNMP index ...
//
throw new SnmpStatusException(x, index + 1);
}
if (isDebugOn())
debug("getGetNextHandlers","Exception : " + x.getStatus());
var.setSnmpValue(SnmpVarBind.endOfMibView);
}
}
return handlers;
}