public class UsmBeingDiscoveredBean extends java.lang.Object implements RequestPduListener
This bean handles being discovered as an authoritative engine by an non-authoritative engine (SNMPv3 only).
The discovery process consists of two steps:
1. first the SNMP engine ID has to be discovered,
second the timeline details of the SNMP engine ID have to be discovered.
2. For the last step the username of the principal is needed.
All these parameters should be provided by (your own) UsmAgent.
This class is not very efficient. The private context discEngineIdContextIn will be the same for every SnmpContextv3 that creates this bean.
SnmpContextv3.addRequestPduListener(uk.co.westhawk.snmp.event.RequestPduListener, uk.co.westhawk.snmp.stack.ListeningContextPool)
Constructor and Description |
---|
UsmBeingDiscoveredBean(SnmpContextv3 myContext,
UsmAgent myUsmAgent)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addRequestPduListener(ListeningContextPool lcontext) |
void |
freeResources()
Destroys all the contexts in use.
|
void |
removeRequestPduListener(ListeningContextPool lcontext) |
void |
requestPduReceived(RequestPduEvent evt)
Receiving an incoming (discovery) PDU request.
|
protected void |
sendEngineIdReport(Pdu orgPdu,
int port)
Send back the snmp engine ID.
|
protected void |
sendTimeLineReport(Pdu orgPdu,
int port)
Send back the time lininess
|
public UsmBeingDiscoveredBean(SnmpContextv3 myContext, UsmAgent myUsmAgent) throws java.io.IOException
myUsmAgent
- The usmAgent that will provide all the
authoritative engine parametersmyContext
- The contextjava.io.IOException
SnmpContextv3.addRequestPduListener(uk.co.westhawk.snmp.event.RequestPduListener, uk.co.westhawk.snmp.stack.ListeningContextPool)
public void addRequestPduListener(ListeningContextPool lcontext) throws java.io.IOException
lcontext
- The listening context for incoming (discovery) requestsjava.io.IOException
SnmpContextv3.addRequestPduListener(uk.co.westhawk.snmp.event.RequestPduListener, uk.co.westhawk.snmp.stack.ListeningContextPool)
public void removeRequestPduListener(ListeningContextPool lcontext) throws java.io.IOException
lcontext
- Stop listening on this listening context for incoming (discovery) requestsjava.io.IOException
SnmpContextv3.removeRequestPduListener(uk.co.westhawk.snmp.event.RequestPduListener, uk.co.westhawk.snmp.stack.ListeningContextPool)
public void requestPduReceived(RequestPduEvent evt)
requestPduReceived
in interface RequestPduListener
protected void sendEngineIdReport(Pdu orgPdu, int port)
protected void sendTimeLineReport(Pdu orgPdu, int port)
public void freeResources()