use of org.snmp4j.mp.PduHandle in project opennms by OpenNMS.
the class Snmp4JStrategy method sendTest.
public void sendTest(String agentAddress, int port, String community, PDU pdu) {
for (RegistrationInfo info : s_registrations.values()) {
if (port == info.getPort()) {
final Snmp snmp = info.getSession();
Snmp4JStrategy.trackSession(snmp);
MessageDispatcher dispatcher = snmp.getMessageDispatcher();
TransportMapping<UdpAddress> transport = info.getTransportMapping();
int securityModel = (pdu instanceof PDUv1 ? SecurityModel.SECURITY_MODEL_SNMPv1 : SecurityModel.SECURITY_MODEL_SNMPv2c);
int messageModel = (pdu instanceof PDUv1 ? MessageProcessingModel.MPv1 : MessageProcessingModel.MPv2c);
CommandResponderEvent e = new CommandResponderEvent(dispatcher, transport, new IpAddress(agentAddress), messageModel, securityModel, community.getBytes(), SecurityLevel.NOAUTH_NOPRIV, new PduHandle(), pdu, 1000, null);
info.getHandler().processPdu(e);
}
}
}
Aggregations