Package org.opennms.netmgt.snmp.joesnmp
Class V2TrapInformation
- java.lang.Object
-
- org.opennms.netmgt.snmp.TrapInformation
-
- org.opennms.netmgt.snmp.joesnmp.V2TrapInformation
-
public class V2TrapInformation extends TrapInformation
V2 Trap information object for processing by the queue reader
-
-
Constructor Summary
Constructors Constructor Description V2TrapInformation(InetAddress agent, String community, SnmpPduPacket pdu)Constructs a new trap information instance that contains the sending agent, the community string, and the Protocol Data Unit.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetPduLength()protected IntegergetRequestId()SnmpVarBindDTOgetSnmpVarBindDTO(int i)longgetTimeStamp()Get the SNMP TimeTicks value for the sysUpTime of the agent that generated the trap.InetAddressgetTrapAddress()TrapIdentitygetTrapIdentity()StringgetVersion()StringtoString()voidvalidate()Validate the trap.-
Methods inherited from class org.opennms.netmgt.snmp.TrapInformation
getAgentAddress, getCommunity, getCreationTime, getLocation, getSystemId, setCreationTime, setLocation, setSystemId
-
-
-
-
Constructor Detail
-
V2TrapInformation
public V2TrapInformation(InetAddress agent, String community, SnmpPduPacket pdu)
Constructs a new trap information instance that contains the sending agent, the community string, and the Protocol Data Unit.- Parameters:
agent- The sending agent's addresscommunity- The community string from the SNMP packet.pdu- The encapsulated Protocol Data Unit.
-
-
Method Detail
-
getPduLength
public int getPduLength()
- Specified by:
getPduLengthin classTrapInformation
-
getTimeStamp
public long getTimeStamp()
Description copied from class:TrapInformationGet the SNMP TimeTicks value for the sysUpTime of the agent that generated the trap. Note that the units for this value are 1/100ths of a second instead of milliseconds.- Specified by:
getTimeStampin classTrapInformation
-
getTrapIdentity
public TrapIdentity getTrapIdentity()
- Specified by:
getTrapIdentityin classTrapInformation
-
getTrapAddress
public InetAddress getTrapAddress()
- Specified by:
getTrapAddressin classTrapInformation- Returns:
- The source IP address of the trap. For SNMPv2 traps, this value
is always the same as the value of
TrapInformation.getAgentAddress()but for SNMPv1 traps, the value can be different if the trap has been forwarded. It then represents the true source IP address of the trap event.
-
getVersion
public String getVersion()
- Specified by:
getVersionin classTrapInformation
-
validate
public void validate() throws SnmpExceptionDescription copied from class:TrapInformationValidate the trap.- Overrides:
validatein classTrapInformation- Throws:
SnmpException- on validation error.
-
getSnmpVarBindDTO
public SnmpVarBindDTO getSnmpVarBindDTO(int i)
- Specified by:
getSnmpVarBindDTOin classTrapInformation
-
getRequestId
protected Integer getRequestId()
- Specified by:
getRequestIdin classTrapInformation
-
-