|
MySnmpCrawler API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--snmp.session.SnmpSession
The SnmpSession is the runnable object created by the SnmpAdaptor when the server receives the request. The SnmpSession encapsulates the information of the SNMP request. The SnmpSession will notify the listeners about the new session. The listeners will take appropriate actions to fulfill the different types of requests.
Field Summary | |
private java.net.DatagramPacket |
packet
|
private static java.util.ArrayList |
sessionEventListeners
|
private SnmpMessage |
snmpMessage
|
private java.net.DatagramSocket |
socket
|
Constructor Summary | |
SnmpSession(java.net.DatagramSocket socket,
java.net.DatagramPacket packet)
Constructs the new SnmpSession object for the SNMP request. |
Method Summary | |
private static void |
addSessionListener(SnmpSessionEventListener listener)
Adds the listener to the listener list. |
protected void |
doRun()
This method defines the routines to process the SNMP session. |
SnmpMessage |
getSnmpMessage()
Gets the snmpMessage that encapsulates the SNMP request header and PDU. |
private void |
notifyListeners()
Notify all listeners that a new session has been created. |
protected void |
processSession()
This method contains the necessary routines to process the current SNMP session. |
void |
run()
Invoked by the available thread to execute the doRun() method. |
void |
send()
Sends the encapsulated snmpMessage back to the requesting manager. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static java.util.ArrayList sessionEventListeners
private java.net.DatagramSocket socket
private java.net.DatagramPacket packet
private SnmpMessage snmpMessage
Constructor Detail |
public SnmpSession(java.net.DatagramSocket socket, java.net.DatagramPacket packet) throws SnmpException
socket
- The socket of the SNMP agentpacket
- The received SNMP data packet
SnmpException
- thrown when any exception occurs during the
object initializationMethod Detail |
public void run()
run
in interface java.lang.Runnable
public SnmpMessage getSnmpMessage()
public void send() throws SnmpException
SnmpException
protected void doRun()
protected void processSession() throws SnmpException
SnmpException
- thrown when any exception occursprivate void notifyListeners()
private static void addSessionListener(SnmpSessionEventListener listener)
|
MySnmpCrawler API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |