Class AsnObject

java.lang.Object
uk.co.westhawk.snmp.stack.AsnObject
All Implemented Interfaces:
SnmpConstants
Direct Known Subclasses:
AsnInteger, AsnNull, AsnObjectId, AsnOctets, AsnPrimitive, AsnUnsInteger, AsnUnsInteger64

public abstract class AsnObject extends Object implements SnmpConstants
This class represents the ASN.1 base class. SMIv1 RFC1155-SMI. SMIv2 SNMPv2-SMI.
 <ASN Object> = <type> <length> <ASN Object>
 or
 <ASN Object> = <type> <length> <value>
 
Version:
$Revision: 3.30 $ $Date: 2006/03/23 14:54:09 $
Author:
Tim Panton
  • Field Details

    • debug

      public static int debug
      Indicates the level of debug printed. By default this is none (0).
      See Also:
  • Constructor Details

    • AsnObject

      public AsnObject()
  • Method Details

    • toString

      public abstract String toString()
      Returns a string representation of the object.
      Overrides:
      toString in class Object
      Returns:
      The string
    • setDebug

      public static void setDebug(int newDebug)
      Sets the new, global level of debug information for the stack package. The default value is zero, i.e. no debug info at all. All debug messages are printed to System.out.

      The following messages will appear when debug is > (greater than):

      • 0 - IOExceptions that won't be thrown to the user
      • 1 - DecodingExceptions that won't be thrown to the user (received message with wrong SNMP version)
      • 2 - DecodingExceptions when trying to decode traps
      • 3 - processIncomingResponse errors: (corresponding Pdu cannot be found)
      • 4 - Discovery of EngineId, Timeline
      • 5 - Receiving traps, version/host do not correspond
      • 6 - Pdu messages, sending etc
      • 10 - Asn decoding of incoming messages
      • 12 - Transmitter messages, Socket messages
      • 15 - Not so important IOExceptions, like InterruptedIOException
      Parameters:
      newDebug - the new debug value
    • getRespType

      public byte getRespType()
      Returns the type of this Asn object, such as ASN_INTEGER or IPADDRESS. Note, the name of this method is deceiving; It has nothing (more) to do with a response.
      Returns:
      The AsnObject type.
      See Also:
    • getRespTypeString

      public String getRespTypeString()
      Returns the object type as string, such as "ASN_INTEGER" or "IPADDRESS". Note, the name of this method is deceiving; It has nothing (more) to do with a response.
      Returns:
      The AsnObject type.
      See Also: