Package snmp

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

See:
          Description

Class Summary
SNMPBERCodec SNMPBERCodec defines methods for converting from ASN.1 BER encoding to SNMPObject subclasses.
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.
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.
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.
SNMPv1CommunicationInterface The class SNMPv1CommunicationInterface defines methods for communicating with SNMP entities.
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,
SNMPGetException Exception thrown when attempt to get value of SNMP OID from 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.