com.adventnet.snmp.mibs
Class MibTrap

java.lang.Object
  |
  +--com.adventnet.snmp.mibs.MibTrap
All Implemented Interfaces:
java.io.Serializable

public class MibTrap
extends java.lang.Object
implements java.io.Serializable

The TRAP-TYPE construct in SNMPv1 MIB modules is used to specify the events that an agent can report to SNMP managers. A Trap is an SNMPv1 event report message, which is identified by the values of fields enterprise, generic-trap, and specific-trap. This class enables storage of defined traps based on parsing a MIB module.

See Also:
Serialized Form

Method Summary
 java.lang.String getDescription()
          Gets the value of the DESCRIPTION clause.
 SnmpOID getEnterprise()
          Gets the enterprise value for this trap.
 java.lang.String getEnterpriseString()
          Gets the enterprise name of this trap.
 java.lang.String getModuleName()
          Returns the name of the module this trap is defined.
 java.lang.String getName()
          Returns the name of this trap.
 java.lang.String getReference()
          Gets the value of the REFERENCE clause.
 byte getTrapType()
          Used to know whether this TRAP is generic or specific type.
 int getValue()
          Gets the generic or specific trap number.
 java.util.Vector getVariables()
          Gets the variables as a vector of strings.
 java.lang.String toString()
          Returns the name of this trap.
 java.lang.String toTagString()
          Gives the name and complete description of the trap like the MIB definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getModuleName

public java.lang.String getModuleName()
Returns the name of the module this trap is defined.

getName

public java.lang.String getName()
Returns the name of this trap.

getValue

public int getValue()
Gets the generic or specific trap number. The type of the trap whether generic or specific type can be known from the getTrapType() method.
Returns:
int - a non-negative value.
See Also:
getTrapType()

getEnterprise

public SnmpOID getEnterprise()
Gets the enterprise value for this trap.
Returns:
SnmpOID instance. The SnmpOID value of this enterprise string.
See Also:
getEnterpriseString()

getEnterpriseString

public java.lang.String getEnterpriseString()
Gets the enterprise name of this trap. When the value specified for the ENTERPRISE clause is 'snmp' (iso(1).org(3).dod(6).internet(1).mgmt(2).mib(1).snmp(11)), then the value is for the generic trap field.
Otherwise the value is for the specific-trap field.
Returns:
the Enterprise string for this trap

getVariables

public java.util.Vector getVariables()
Gets the variables as a vector of strings. The optional VARIABLES clause of the TRAP-TYPE construct is used to specify one or more scalar or columnar objects whose value describes the event.
Returns:
Vector of variable names if present, else empty string.

getDescription

public java.lang.String getDescription()
Gets the value of the DESCRIPTION clause.
Returns:
The description string if present, else empty string.

getReference

public java.lang.String getReference()
Gets the value of the REFERENCE clause.
Returns:
String. The reference string if present, else empty string.

toString

public java.lang.String toString()
Returns the name of this trap. Similar to getName()
Overrides:
toString in class java.lang.Object
See Also:
getName()

toTagString

public java.lang.String toTagString()
Gives the name and complete description of the trap like the MIB definition.
Returns:
a detailed description of this trap.

getTrapType

public byte getTrapType()
Used to know whether this TRAP is generic or specific type.
Returns:
the byte value.
If the value is 0, it is generic trap type or else if the value is 1, then it is a specific trap type.


Copyright (c)AdventNet Inc., 1996-2004