Package snmp

The snmp package defines classes used to communicate with SNMP devices.

See:
          Description

Interface Summary
SNMPRequestListener SNMPRequestListener is an interface that must be implemented by any class which wishes to act as a handler for request messages sent from remote SNMP management entities.
SNMPv1TrapListener SNMPv1TrapListener is an interface that must be implemented by any class which wishes to act as a "listener" for trap messages sent from remote SNMP entities to an instance of the SNMPTrapListenerInterface class.
SNMPv2InformRequestListener SNMPv2InformRequestListener is an interface that must be implemented by any class which wishes to act as a "listener" for SNMPv2 inform request messages sent from remote SNMP entities to an instance of the SNMPTrapListenerInterface class.
SNMPv2TrapListener SNMPv2TrapListener is an interface that must be implemented by any class which wishes to act as a "listener" for SNMPv2 trap messages sent from remote SNMP entities to an instance of the SNMPTrapListenerInterface class.
 

Class Summary
SNMPBERCodec SNMPBERCodec defines methods for converting from ASN.1 BER encoding to SNMPObject subclasses.
SNMPBitString Class representing a general string of bits.
SNMPCounter32 Defines a 32-bit counter, whose value wraps if initialized with a larger value.
SNMPCounter64 Defines a 64-bit counter, whose value wraps if initialized with a larger value.
SNMPGauge32 Defines a 32-bit gauge, whose value "pegs" at the maximum if initialized with a larger value.
SNMPInformRequestSenderInterface The class SNMPInformRequestSenderInterface implements an interface for sending SNMPv2 inform request messages to a remote SNMP manager.
SNMPInteger Defines an arbitrarily-sized integer value; there is no limit on size due to the use of Java.lang.BigInteger to store the value internally.
SNMPIPAddress Class to hold IP addresses; special case of SNMP Octet String.
SNMPMessage Defines the SNMPMessage class as a special case of SNMPSequence.
SNMPNSAPAddress Defines class for holding physical 6-byte addresses.
SNMPNull Object representing the SNMP Null data type.
SNMPObject Abstract base class of all SNMP data type classes.
SNMPObjectIdentifier Class representing ASN.1 object identifiers.
SNMPOctetString Class representing a general string of octets.
SNMPPDU The SNMPPDU class represents an SNMP PDU from RFC 1157, as indicated below.
SNMPSequence One of the most important SNMP classes.
SNMPTimeTicks SNMP datatype used to represent time value.
SNMPTrapReceiverInterface The class SNMPTrapListenerInterface implements a server which listens for trap and inform request messages sent from remote SNMP entities.
SNMPTrapSenderInterface The class SNMPTrapSenderInterface implements an interface for sending SNMPv1 and SNMPv2 trap messages to a remote SNMP manager.
SNMPUInteger32 Defines a 32-bit unsigned integer value; wraps if initialized with a larger value.
SNMPUnknownObject Used when an unknown SNMP object type is encountered.
SNMPv1AgentInterface The class SNMPv1AgentInterface implements an interface for responding to requests sent from a remote SNMP manager.
SNMPv1CommunicationInterface The class SNMPv1CommunicationInterface defines methods for communicating with SNMP entities.
SNMPv1TrapPDU The SNMPTrapPDU class represents an SNMPv1 Trap PDU from RFC 1157, as indicated below.
SNMPv2BulkRequestPDU The SNMPv2BulkRequestPDU class represents an SNMPv2 Bulk Request PDU from RFC 1905, as indicated below.
SNMPv2InformRequestPDU The SNMPv2InformRequestPDU class represents an SNMPv2 Trap PDU from RFC 1448, as indicated below.
SNMPv2TrapPDU The SNMPv2TrapPDU class represents an SNMPv2 Trap PDU from RFC 1448, as indicated below.
SNMPVarBindList The SNMPVarBindList class is a specialization of SNMPSequence that contains a list of SNMPVariablePair objects.
SNMPVariablePair The SNMPVariablePair class implements the VarBind specification detailed below from RFC 1157.
 

Exception Summary
SNMPBadValueException Exception thrown whenever attempt made to create SNMPObject subclass with inappropriate data, or to set its value with inappropriate data,
SNMPException Exception thrown when attempt to set or get value of SNMP OID fails.
SNMPGetException Exception thrown when attempt to get value of SNMP OID from device fails.
SNMPRequestException Exception thrown when request to get or set the value of an SNMP OID on a device fails.
SNMPSetException Exception thrown when attempt to set the value of an SNMP OID on a device fails.
 

Package snmp Description

The snmp package defines classes used to communicate with SNMP devices. Classes corresponding to each of the basic SNMP data types are defined, each extending the SNMPObject abstarct class. In addition, some utility classes provide additional functionality.

Each of the SNMPObject subclasses defines methods to create an object, either from a "reasonable" representation (e.g., Java.lang.Integer for an SNMPInteger object, or a suitable String such as "1.2.1.1.3.2.1.1.0" for an SNMPObjectIdentifier), or from a byte array presumed to contain a valid ASN.1 Basic Encoding Rules (BER) encoding of a value of the appropriate type. The objects also define methods that permit their values to be set, and generate their BER encodings.

SNMPSequence subclasses, in particular, contain Vectors of other SNMPObject subclasses. They can be created "manually", with objects added as desired, or can be created from a BER encoding of the sequence contents, recursively creating the contained objects. BER generation also recursively generates the BER for each contained component; thus calling  mySequence.getBerEncoding() automatically generates the encoding for the entire sequence, including the contained components. SNMPBERCodec contains a number of static utility methods for converting to and from BER encodings, as well as constants used by the various classes.

Finally, SNMPv1CommunicationsInterface defines methods for sending SNMP Get and Set requests to devices; this class handles all of the communication tasks needed for developing simple SNMP applications.