HOME

com.ireasoning.protocol.snmp
Class SnmpBaseSession

java.lang.Object
  extended bycom.ireasoning.protocol.ListenerManager
      extended bycom.ireasoning.protocol.Session
          extended bycom.ireasoning.protocol.snmp.SnmpBaseSession
All Implemented Interfaces:
Serializable, State
Direct Known Subclasses:
SnmpSession, SnmpTrapdSession

public class SnmpBaseSession
extends Session

This class provides basic methods of SNMP session implementation.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ireasoning.protocol.Session
_localAddr, _localPort, _state, _target, _thread, _timeout, _transportLayer, _tries, DEFAULT_TIME_OUT, TCP, UDP
 
Fields inherited from class com.ireasoning.protocol.ListenerManager
_listeners
 
Fields inherited from interface com.ireasoning.core.jmx.State
STARTED, STARTING, STATES, STOPPED, STOPPING, UNINITIALIZED
 
Method Summary
 void addEngine(byte[] engineID)
          Adds a new SnmpEngine
 void addEngine(SnmpEngine engine)
          Adds a new SnmpEngine
 SnmpEngine lookupEngine(byte[] engineID)
          Looks up SnmpEngine instance based on engineID
 SnmpEngine lookupEngine(String host, int port)
          Looks up SnmpEngine instance based on host name and port
 SnmpEngine lookupEngine(Target target)
          Looks up SnmpEngine instance based on host name and port
protected  UsmUser lookupUsmUser(String userName, byte[] engineID)
          Looks up USM user based on passed user name and engineID.
protected  Object receiveObject()
          Not applicable for this class
 SnmpEngine removeEngine(byte[] engineID)
          Removes SnmpEngine from engine table
 SnmpEngine removeEngine(SnmpEngine engine)
          Removes SnmpEngine from engine table
 SnmpEngine removeEngine(String host, int port)
          Removes SnmpEngine from engine table
 SnmpEngine removeEngine(Target target)
          Removes SnmpEngine from engine table
 void removeUsmUser(String userName, byte[] engineID)
          Removes a UserUser instance from internal map.
 
Methods inherited from class com.ireasoning.protocol.Session
close, finalize, getRetries, getState, getStateString, getTarget, getTimeout, getTransportLayer, getTransportLayer, open, open, open, reopen, setRetries, setTarget, setTimeout, setTransportLayer, setTransportLayer, startThread
 
Methods inherited from class com.ireasoning.protocol.ListenerManager
addListener, listenerExists, notifyListeners, notifyListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

lookupEngine

public SnmpEngine lookupEngine(String host,
                               int port)
Looks up SnmpEngine instance based on host name and port

Returns:
SnmpEngine instance if found, null otherwise.
Since:
SnmpV3

lookupEngine

public SnmpEngine lookupEngine(Target target)
Looks up SnmpEngine instance based on host name and port

Returns:
SnmpEngine instance if found, null otherwise.
Since:
SnmpV3

lookupEngine

public SnmpEngine lookupEngine(byte[] engineID)
Looks up SnmpEngine instance based on engineID

Returns:
SnmpEngine instance if found, null otherwise.
Since:
SnmpV3

addEngine

public void addEngine(SnmpEngine engine)
Adds a new SnmpEngine

Parameters:
engine - a instance of SnmpEngine to be added
Since:
SnmpV3

addEngine

public void addEngine(byte[] engineID)
Adds a new SnmpEngine

Parameters:
engineID - engine ID of the SnmpEngine to be added

removeEngine

public SnmpEngine removeEngine(byte[] engineID)
Removes SnmpEngine from engine table

Parameters:
engineID - the engine ID of the engine to be removed
Returns:
the SnmpEngine object removed, null if engine not found.

removeEngine

public SnmpEngine removeEngine(Target target)
Removes SnmpEngine from engine table

Parameters:
target - the target object of the engine to be removed
Returns:
the SnmpEngine object removed, null if engine not found.

removeEngine

public SnmpEngine removeEngine(String host,
                               int port)
Removes SnmpEngine from engine table

Parameters:
host - the host name of the engine to be removed
port - the port number of the engine to be removed
Returns:
the SnmpEngine object removed, null if engine not found.

removeEngine

public SnmpEngine removeEngine(SnmpEngine engine)
Removes SnmpEngine from engine table

Parameters:
engine - the engine to be removed
Returns:
the SnmpEngine object removed, null if engine not found.

removeUsmUser

public void removeUsmUser(String userName,
                          byte[] engineID)
Removes a UserUser instance from internal map.


lookupUsmUser

protected UsmUser lookupUsmUser(String userName,
                                byte[] engineID)
Looks up USM user based on passed user name and engineID. This method is invoked for SNMPv3 packets only, and before decoder starts to decode SNMPv3 PDU.

Parameters:
userName - USM user name contained in the PDU
engineID - SNMPv3 engine ID

receiveObject

protected Object receiveObject()
                        throws IOException
Not applicable for this class

Specified by:
receiveObject in class Session
Throws:
IOException

HOME

Copyright © 2002 iReasoning Inc. All Rights Reserved.