Package org.snmp4j.mp
The org.snmp4j.mp classes provide services to process SNMP
messages. The services provided are defined in the
MessageProcessingModel interface and include the following:
- Prepare data elements from an incoming SNMP message as described in RFC3412 §7.2.
- Prepare a response message as defined in RFC3412 §7.1.
- Prepare an outgoing message as defined in RFC3412 §7.1.
This interface is implemented
by the message processing model classes for the SNMP versions 1, v2c, and v3:
MPv1, MPv2c, and MPv3.
The MessageDispatcherImpl chooses which message processing model
it uses to process an outgoing or incoming SNMP message based on the SNMP
version of the message. The SNMP version is either extracted from the message
header (incoming message) or from the Target instance associated
with the outgoing PDU (ougoing message).
To be able to match requests and responses SNMP uses request IDs. Since request
IDs are created by the command generator, the request IDs are unique within
such a command generator only. SNMP4J therefore has to abstract from request IDs
and uses PduHandle instances instead.
If a PDU is processed for sending by the SNMP4J
MessageDispatcherImpl and
the PDU's request ID is set to 0, then a SNMP4J application wide unique ID
is generated and set as request ID of the supplied PDU. In any case, the
PDU's request ID will be used as transaction ID of the outgoing message. The
transaction ID identifies a messages PduHandle.
If a PDU is received by the SNMP4J
MessageDispatcherImpl a unique transaction ID is generated so
that command responders as well as the message processing model can match
requests and responses.
The following UML class diagram shows the most important classes of the
org.snmp4j.mp package and their relationships
(relationships to other packages are not shown):

-
Interface Summary Interface Description EngineIdCacheSize The interfaceEngineIdCacheSizedefines the maximum engine ID cache size when the cache size is about to increase.MessageID TheMessageIDinterface defines the characteristics of a SNMP message ID as defined by RFC 3412 §6.2.MessageProcessingModel TheMessageProcessingModelinterface defines common methods to all SNMP message processing models.MPv3.EngineIdCacheFactory TheEngineIdCacheFactorycreates an engine ID cache with upper limit.PduHandleCallback<P> ThePduHandleCallbackcan be used to get informed about aPduHandlecreation before a request is actually sent out.RequestStatistics TheRequestStatisticsinterface defines statistic values about request processing. -
Class Summary Class Description CounterSupport TheCounterSupportclass provides support to fireCounterEventto registered listeners.DefaultCounterListener TheDefaultCounterListeneris the default implementation of theCounterListenerinterface.MPv1 TheMPv1is the message processing model for SNMPv1.MPv2c TheMPv2cis the message processing model for SNMPv2c (community based SNMPv2).MPv3 TheMPv3is the message processing model for SNMPv3.MPv3.Cache TheCachestores state reference information for the MPv3.MPv3.CacheEntry<A extends Address> TheCacheEntryclass holds state reference information for the MPv3 message processing model for a single message.MPv3.HeaderData TheHeaderDatarepresents the message header information of SNMPv3 message.MutableStateReference<A extends Address> TheMutableStateReferenceencapsulates aStateReferencefor read/write access.PduHandle ThePduHandleclass represents an unique key for a SNMP PDU.SimpleMessageID TheSimpleMessageIDimplements the simplest possibleMessageIDwith a minimum memory footprint.SnmpConstants TheSnmpConstantsclass holds constants, ObjectIDs and Message strings used within SNMP4J.StateReference<A extends Address> TheStateReferenceclass represents state information associated with SNMP messages.StatusInformation TheStatusInformationclass represents status information of a SNMPv3 message that is needed to return a report message.TimedMessageID TheTimedMessageIDadds system time information to the message ID that allows to measure response times and detect lost messages with SNMPv3. -
Enum Summary Enum Description SnmpConstants.StorageTypeEnum Enumeration of the textual convention StorageType defined in SNMPv2-TC MIB.