Package 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:
Cloneable
,Runnable
,EventListener
,RawPduListener
,SnmpContextBasisFace
,SnmpContextv3Face
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.11 $ $Date: 2009/03/05 13:12:50 $
- Author:
- Birgit Arkesteijn
- See Also:
-
Field Summary
Fields inherited from class uk.co.westhawk.snmp.stack.SnmpContextv3Basis
AES128_KEY_LENGTH, AES192_KEY_LENGTH, AES256_KEY_LENGTH
Fields inherited from interface uk.co.westhawk.snmp.stack.SnmpContextBasisFace
DEFAULT_PORT, MAXPDU, MSS, STANDARD_SOCKET, TCP_SOCKET
Fields inherited from interface uk.co.westhawk.snmp.stack.SnmpContextv3Face
AES_ENCRYPT, AES_PRIVACY_PROTOCOLS, AES192_ENCRYPT, AES256_ENCRYPT, AUTH_PROTOCOLS, DEFAULT_CONTEXT_NAME, DEFAULT_USERNAME, DES_ENCRYPT, MD5_PROTOCOL, NO_AUTH_PROTOCOL, PRIVACY_PROTOCOLS, PROTOCOL_NAMES, SHA1_PROTOCOL, SHA224_PROTOCOL, SHA256_PROTOCOL, SHA384_PROTOCOL, SHA512_PROTOCOL, SNMPv1_Security_Model, SNMPv2c_Security_Model, USM_Security_Model
-
Constructor Summary
ConstructorsConstructorDescriptionSnmpContextv3Discovery
(String host, int port) Constructor.SnmpContextv3Discovery
(String host, int port, String typeSocketA) Constructor.SnmpContextv3Discovery
(String host, int port, String bindAddress, String typeSocketA) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a clone of this SnmpContextv3.processIncomingPdu
(byte[] message) Processes an incoming Discovery (and only Discovery) PDU.Methods inherited from class uk.co.westhawk.snmp.stack.SnmpContextv3Basis
addDiscoveryPdu, addPdu, addRequestPduListener, cloneParameters, encodeDiscoveryPacket, encodePacket, getAuthenticationProtocol, getContextEngineId, getContextName, getHashKey, getPrivacyProtocol, getUserAuthenticationPassword, getUserName, getUserPrivacyPassword, getUsmAgent, getVersion, isUseAuthentication, isUsePrivacy, removePdu, setAuthenticationProtocol, setContextEngineId, setContextName, setPrivacyProtocol, setUseAuthentication, setUsePrivacy, setUserAuthenticationPassword, setUserName, setUserPrivacyPassword, setUsmAgent, toString
Methods inherited from class uk.co.westhawk.snmp.stack.AbstractSnmpContext
addRequestPduListener, addRequestPduListener, addTrapListener, addTrapListener, addTrapListener, destroy, 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, 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 Details
-
SnmpContextv3Discovery
Constructor.- Parameters:
host
- The host to which the PDU will be sentport
- The port where the SNMP server will be- Throws:
IOException
- See Also:
-
AbstractSnmpContext(String, int)
-
SnmpContextv3Discovery
Constructor. Parameter typeSocketA should be either STANDARD_SOCKET, TCP_SOCKET or a fully qualified classname.- Parameters:
host
- The host to which the Pdu will be sentport
- The port where the SNMP server will betypeSocketA
- The local address the server will bind to- Throws:
IOException
- See Also:
-
AbstractSnmpContext(String, int, String)
-
SnmpContextv3Discovery
public SnmpContextv3Discovery(String host, int port, String bindAddress, String typeSocketA) throws IOException Constructor. Parameter typeSocketA should be either STANDARD_SOCKET, TCP_SOCKET or a fully qualified classname.- Parameters:
host
- The host to which the PDU will be sentport
- The port where the SNMP server will bebindAddress
- The local address the server will bind totypeSocketA
- The type of socket to use.- Throws:
IOException
- Since:
- 4_14
- See Also:
-
AbstractSnmpContext(String, int, String, String)
SnmpContextBasisFace.STANDARD_SOCKET
SnmpContextBasisFace.TCP_SOCKET
-
-
Method Details
-
processIncomingPdu
Processes an incoming Discovery (and only Discovery) PDU.- Specified by:
processIncomingPdu
in interfaceSnmpContextBasisFace
- Specified by:
processIncomingPdu
in classAbstractSnmpContext
- Throws:
DecodingException
IOException
- See Also:
-
clone
Returns a clone of this SnmpContextv3.- Specified by:
clone
in interfaceSnmpContextBasisFace
- Specified by:
clone
in classAbstractSnmpContext
- Throws:
CloneNotSupportedException
- Thrown when the constructor generates an IOException
-