return;
}
}
// Cache the translated notification
SnmpPduTrap v1TrapPdu = null;
SnmpPduPacket v2TrapPdu = null;
// Send trap. Synchronise on the subscription collection while
// iterating
synchronized(this.managers) {
// Iterate over sessions and emit the trap on each one
Iterator i = this.managers.iterator();
while (i.hasNext()) {
ManagerRecord s = (ManagerRecord)i.next();
try {
switch (s.getVersion()) {
case SnmpAgentService.SNMPV1:
if (v1TrapPdu == null)
v1TrapPdu = this.trapFactory.generateV1Trap(n);
// fix the agent ip in the trap depending on which local address is bound
v1TrapPdu.setAgentAddress(new SnmpIPAddress(s.getLocalAddress()));
// Advance the trap counter
this.trapCount.advance();
// Send