Class TrapPduv1

Direct Known Subclasses:
OneTrapPduv1, PassiveTrapPduv1

public class TrapPduv1 extends Pdu
This class represents the ASN SNMPv1 Trap PDU object. See RFC1157-SNMP.

Note that the SNMPv1 Trap PDU is the only PDU with a different PDU format. It has additional fields like enterprise, ipAddress, genericTrap, specificTrap and timeTicks.

Version:
$Revision: 3.14 $ $Date: 2007/10/17 10:44:09 $
Author:
Birgit Arkesteijn
See Also:
  • Constructor Details

    • TrapPduv1

      public TrapPduv1(SnmpContext con)
      Constructor.
      Parameters:
      con - The context (v1) of the TrapPduv1
      See Also:
    • TrapPduv1

      public TrapPduv1(SnmpContextPool con)
      Constructor.
      Parameters:
      con - The context pool (v1) of the TrapPduv1
      See Also:
  • Method Details

    • setEnterprise

      public void setEnterprise(String var)
      Sets the type of object generating the trap. This parameter is based on the sysObjectId.
    • getEnterprise

      public String getEnterprise()
      Returns the type of object generating the trap.
    • setIpAddress

      public void setIpAddress(byte[] var)
      Sets the IP Address of the object generating the trap.
    • getIpAddress

      public byte[] getIpAddress()
      Returns the IP Address of the object generating the trap.
    • setGenericTrap

      public void setGenericTrap(int var)
      Sets the generic trap type. By default the warmStart is sent.
      See Also:
    • getGenericTrap

      public int getGenericTrap()
      Returns the generic trap type.
    • getGenericTrapString

      public String getGenericTrapString()
      Returns the string representation of the generic trap.
      Returns:
      the generic trap string
      See Also:
    • setSpecificTrap

      public void setSpecificTrap(int var)
      Sets the specific trap code.
    • getSpecificTrap

      public int getSpecificTrap()
      Returns the specific trap code.
    • setTimeTicks

      public void setTimeTicks(long var)
      Sets the sysUpTime of the agent.

      RFC1155-SMI: TimeTicks:
      This application-wide type represents a non-negative integer which counts the time in hundredths of a second since some epoch. When object types are defined in the MIB which use this ASN.1 type, the description of the object type identifies the reference epoch.

    • getTimeTicks

      public long getTimeTicks()
      Returns the sysUpTime of the agent.
      See Also:
    • send

      public boolean send() throws IOException, PduException
      Sends the TrapPduv1. Since the Trap v1 PDU has a different format (sigh), a different encoding message has to be called. Note that all properties of the context have to be set before this point.
      Overrides:
      send in class Pdu
      Throws:
      IOException
      PduException
    • toString

      public String toString()
      Returns the string representation of this object.
      Overrides:
      toString in class Pdu
      Returns:
      The string of the PDU