SNMP Stack 5_1

uk.co.westhawk.snmp.stack
Class SnmpContextv3Discovery

java.lang.Object
  |
  +--uk.co.westhawk.snmp.stack.AbstractSnmpContext
        |
        +--uk.co.westhawk.snmp.stack.SnmpContextv3Basis
              |
              +--uk.co.westhawk.snmp.stack.SnmpContextv3Discovery
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, RawPduListener, java.lang.Runnable, SnmpContextBasisFace, SnmpContextv3Face

public class SnmpContextv3Discovery
extends SnmpContextv3Basis

This class contains the SNMP v3 discovery context that is used by UsmBeingDiscoveredBean, when this stack is being discovered. Most of the work is done by SnmpContextv3Basis.

Now that the stack can send traps and receive requests, it needs to be able to act as an authoritative SNMP engine. This is done via the interface UsmAgent. The DefaultUsmAgent is not guaranteed to work; agents (or rather authoritative engines) should provide a better implementation.

Since:
4_14
Version:
$Revision: 3.9 $ $Date: 2006/03/23 14:54:10 $
Author:
Birgit Arkesteijn
See Also:
DefaultUsmAgent, UsmBeingDiscoveredBean

Field Summary
 
Fields inherited from class uk.co.westhawk.snmp.stack.SnmpContextv3Basis
authenticationProtocol, contextEngineId, contextName, useAuthentication, usePrivacy, userAuthenticationPassword, userAuthKeyMD5, userAuthKeySHA1, userName, userPrivacyPassword, userPrivKeyMD5, userPrivKeySHA1, usmAgent
 
Fields inherited from class uk.co.westhawk.snmp.stack.AbstractSnmpContext
anyPduExpectingResponse, bindAddr, hostname, hostPort, isDestroyed, maxRecvSize, pduSupport, trapSupport, typeSocket
 
Fields inherited from interface uk.co.westhawk.snmp.stack.SnmpContextv3Face
Default_ContextName, Default_UserName, MD5_PROTOCOL, ProtocolNames, SHA1_PROTOCOL, SNMPv1_Security_Model, SNMPv2c_Security_Model, USM_Security_Model, version_id
 
Fields inherited from interface uk.co.westhawk.snmp.stack.SnmpContextBasisFace
DEFAULT_PORT, KVM_SOCKET, MAXPDU, MSS, NETSCAPE_SOCKET, STANDARD_SOCKET, TCP_SOCKET
 
Fields inherited from interface uk.co.westhawk.snmp.event.RawPduListener
version_id
 
Constructor Summary
SnmpContextv3Discovery(java.lang.String host, int port)
          Constructor.
SnmpContextv3Discovery(java.lang.String host, int port, java.lang.String typeSocketA)
          Constructor.
SnmpContextv3Discovery(java.lang.String host, int port, java.lang.String bindAddress, java.lang.String typeSocketA)
          Constructor.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this SnmpContextv3.
 Pdu processIncomingPdu(byte[] message)
          Processes an incoming Discovery (and only Discovery) PDU.
 
Methods inherited from class uk.co.westhawk.snmp.stack.SnmpContextv3Basis
actualEncodePacket, addDiscoveryPdu, addPdu, addPdu, addRequestPduListener, checkContextSanity, cloneParameters, createUsmAgent, encodeDiscoveryPacket, encodePacket, getAuthenticationProtocol, getContextEngineId, getContextName, getHashKey, getUserAuthenticationPassword, getUserName, getUserPrivacyPassword, getUsmAgent, getVersion, isAuthoritative, isUseAuthentication, isUsePrivacy, processIncomingResponse, removePdu, setAuthenticationProtocol, setContextEngineId, setContextName, setUseAuthentication, setUsePrivacy, setUserAuthenticationPassword, setUserName, setUserPrivacyPassword, setUsmAgent, toString
 
Methods inherited from class uk.co.westhawk.snmp.stack.AbstractSnmpContext
activate, addRequestPduListener, addRequestPduListener, addTrapListener, addTrapListener, addTrapListener, destroy, freeTransmitters, getBindAddress, getDebugString, getHost, getHostAddress, getMaxRecvSize, getPort, getReceivedFromHostAddress, getSendToHostAddress, getTypeSocket, isDestroyed, rawPduReceived, removeRequestPduListener, removeRequestPduListener, removeRequestPduListener, removeTrapListener, removeTrapListener, removeTrapListener, run, sendPacket, setMaxRecvSize, stop
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface uk.co.westhawk.snmp.stack.SnmpContextBasisFace
addRequestPduListener, addRequestPduListener, addTrapListener, addTrapListener, addTrapListener, destroy, getBindAddress, getHost, getPort, getReceivedFromHostAddress, getSendToHostAddress, getTypeSocket, isDestroyed, removeRequestPduListener, removeRequestPduListener, removeRequestPduListener, removeTrapListener, removeTrapListener, removeTrapListener, sendPacket
 

Constructor Detail

SnmpContextv3Discovery

public SnmpContextv3Discovery(java.lang.String host,
                              int port)
                       throws java.io.IOException
Constructor.

Parameters:
host - The host to which the PDU will be sent
port - The port where the SNMP server will be
See Also:
AbstractSnmpContext.AbstractSnmpContext(String, int)

SnmpContextv3Discovery

public SnmpContextv3Discovery(java.lang.String host,
                              int port,
                              java.lang.String typeSocketA)
                       throws java.io.IOException
Constructor.

Parameters:
host - The host to which the Pdu will be sent
port - The port where the SNMP server will be
typeSocketA - The local address the server will bind to
See Also:
AbstractSnmpContext.AbstractSnmpContext(String, int, String)

SnmpContextv3Discovery

public SnmpContextv3Discovery(java.lang.String host,
                              int port,
                              java.lang.String bindAddress,
                              java.lang.String typeSocketA)
                       throws java.io.IOException
Constructor.

Parameters:
host - The host to which the PDU will be sent
port - The port where the SNMP server will be
bindAddress - The local address the server will bind to
typeSocketA - The type of socket to use.
Since:
4_14
See Also:
AbstractSnmpContext.AbstractSnmpContext(String, int, String, String), SnmpContextBasisFace.STANDARD_SOCKET, SnmpContextBasisFace.TCP_SOCKET, SnmpContextBasisFace.NETSCAPE_SOCKET, SnmpContextBasisFace.KVM_SOCKET
Method Detail

processIncomingPdu

public Pdu processIncomingPdu(byte[] message)
                       throws DecodingException,
                              java.io.IOException
Processes an incoming Discovery (and only Discovery) PDU.

See SNMP-USER-BASED-SM-MIB.

Specified by:
processIncomingPdu in interface SnmpContextBasisFace
Specified by:
processIncomingPdu in class AbstractSnmpContext
DecodingException
java.io.IOException
See Also:
AbstractSnmpContext.rawPduReceived(uk.co.westhawk.snmp.event.RawPduEvent)

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a clone of this SnmpContextv3.

Specified by:
clone in interface SnmpContextBasisFace
Specified by:
clone in class AbstractSnmpContext
Throws:
java.lang.CloneNotSupportedException - Thrown when the constructor generates an IOException

SNMP Stack 5_1