private SnmpMessage makeResponseMessage(SnmpMessage reqMsg) {
SnmpMessage respMsg = null ;
// Transform the request message into a request pdu
//
SnmpPduPacket reqPdu;
Object userData = null;
try {
reqPdu = (SnmpPduPacket)pduFactory.decodeSnmpPdu(reqMsg) ;
if (reqPdu != null && userDataFactory != null)
userData = userDataFactory.allocateUserData(reqPdu);
}
catch(SnmpStatusException x) {
reqPdu = null ;
SnmpAdaptorServer snmpServer = (SnmpAdaptorServer)adaptorServer ;
snmpServer.incSnmpInASNParseErrs(1) ;
if (x.getStatus()== SnmpDefinitions.snmpWrongSnmpVersion)
snmpServer.incSnmpInBadVersions(1) ;
if (SNMP_ADAPTOR_LOGGER.isLoggable(Level.FINEST)) {
SNMP_ADAPTOR_LOGGER.logp(Level.FINEST, dbgTag,
"makeResponseMessage", "message decoding failed", x);
}
}
// Make the response pdu if any
//
SnmpPduPacket respPdu = null ;
if (reqPdu != null) {
respPdu = makeResponsePdu(reqPdu,userData) ;
try {
if (userDataFactory != null)
userDataFactory.releaseUserData(userData,respPdu);