[SNMP4J] Inform Listener
Madhavilatha_Murthy
Madhavilatha_Murthy at satyam.com
Thu Dec 27 06:27:32 CET 2007
public synchronized void processPdu(CommandResponderEvent e) {
PDU command = e.getPDU();
if (command != null) {
System.out.println(command.toString());
if ((command.getType() != PDU.TRAP)
&& (command.getType() != PDU.V1TRAP)
&& (command.getType() != PDU.REPORT)
&& (command.getType() != PDU.RESPONSE)) {
command.setErrorIndex(0);
command.setErrorStatus(0);
command.setType(PDU.RESPONSE);
StatusInformation statusInformation = new
StatusInformation();
StateReference ref = e.getStateReference();
try {
e.getMessageDispatcher().returnResponsePdu(
e.getMessageProcessingModel(),
e.getSecurityModel(), e.getSecurityName(),
e.getSecurityLevel(), command,
e.getMaxSizeResponsePDU(), ref,
statusInformation);
} catch (MessageException ex) {
System.err.println("Error while sending response: "
+ ex.getMessage());
Logger.getLogger(SnmpRequest.class).error(ex);
}
}
}
}
DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.
More information about the SNMP4J
mailing list