ObjectIdentifierValue []oids = req.getVarBindList().getNames();
for (i = 0; i < oids.length; i++) {
SnmpValue attr = getMBean(oids[i]);
VarBindValue varBind;
if (attr != null)
varBind = new VarBindValue(oids[i], attr);
else {
varBind = new VarBindValue(oids[i], NullValue.NULL);
if (error.getLong() == 0) {
error = new IntegerValue(NO_SUCH_NAME);
errorIndex = new IntegerValue(i + 1);
}
}
varBindList.add(varBind);
}
break;
}
case SnmpValue.GET_NEXT_REQUEST_PDU:
{
break;
}
case SnmpValue.SET_REQUEST_PDU:
{
break;
}
default:
log.fine(L.l("invalid pdu type {0}", req.getType()));
throw new SnmpRuntimeException(L.l("invalid pdu type {0}",
req.getType()));
}
}
catch (Exception e) {
if (error.getLong() == 0) {
error = new IntegerValue(GENERAL_ERROR);
errorIndex = new IntegerValue(i + 1);
}
if (req.getVarBindList().size() > i) {
VarBindValue varBind
= new VarBindValue(req.getVarBindList().get(i).getName(),
new OctetStringValue(e.getMessage()));
varBindList.add(varBind);
}
}