}
// The index in the exception must correspond to the
// SNMP index ...
//
final SnmpStatusException sse =
new SnmpStatusException(x, index + 1);
sse.initCause(x);
throw sse;
} else if ((type == SnmpDefinitions.pduWalkRequest) ||
(type == SnmpDefinitions.pduSetRequestPdu)) {
final int status =
SnmpRequestTree.mapSetException(x.getStatus(),ver);
if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
SnmpMib.class.getName(),
"getHandlers", "\tSET: Throwing exception");
}
final SnmpStatusException sse =
new SnmpStatusException(status, index + 1);
sse.initCause(x);
throw sse;
} else if (atomic) {
// Should never come here...
if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
SnmpMib.class.getName(),
"getHandlers", "\tATOMIC: Throwing exception");
}
final SnmpStatusException sse =
new SnmpStatusException(x, index + 1);
sse.initCause(x);
throw sse;
}
final int status =
SnmpRequestTree.mapGetException(x.getStatus(),ver);
if (status == SnmpStatusException.noSuchInstance) {
if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
SnmpMib.class.getName(),
"getHandlers",
"\tGET: Registering noSuchInstance");
}
var.value= SnmpVarBind.noSuchInstance;
} else if (status == SnmpStatusException.noSuchObject) {
if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
SnmpMib.class.getName(),
"getHandlers",
"\tGET: Registering noSuchObject");
}
var.value= SnmpVarBind.noSuchObject;
} else {
if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
SNMP_ADAPTOR_LOGGER.logp(Level.FINEST,
SnmpMib.class.getName(),
"getHandlers",
"\tGET: Registering global error: " + status);
}
final SnmpStatusException sse =
new SnmpStatusException(status, index + 1);
sse.initCause(x);
throw sse;
}
}
}
return handlers;