public static class Snmp4JTrapNotifier.Snmp4JV2TrapInformation extends TrapInformation
Constructor and Description |
---|
Snmp4JV2TrapInformation(InetAddress agent,
String community,
org.snmp4j.PDU pdu)
Constructs a new trap information instance that contains the sending
agent, the community string, and the Protocol Data Unit.
|
Modifier and Type | Method and Description |
---|---|
org.snmp4j.PDU |
getPdu()
Returns the Protocol Data Unit that was encapsulated within the SNMP
Trap message
|
int |
getPduLength() |
protected Integer |
getRequestId() |
SnmpVarBindDTO |
getSnmpVarBindDTO(int i) |
long |
getTimeStamp()
Get the SNMP TimeTicks value for the sysUpTime of the agent that
generated the trap.
|
InetAddress |
getTrapAddress()
For SNMPv2 traps, this returns the same value as
TrapInformation.getAgentAddress() . |
TrapIdentity |
getTrapIdentity() |
protected org.snmp4j.smi.VariableBinding |
getVarBindAt(int index) |
String |
getVersion() |
String |
toString() |
void |
validate()
Validate the trap.
|
getAgentAddress, getCommunity, getCreationTime, getLocation, getSystemId, setCreationTime, setLocation, setSystemId
public Snmp4JV2TrapInformation(InetAddress agent, String community, org.snmp4j.PDU pdu)
agent
- The sending agent's addresscommunity
- The community string from the SNMP packet.pdu
- The encapsulated Protocol Data Unit.public org.snmp4j.PDU getPdu()
public int getPduLength()
getPduLength
in class TrapInformation
public long getTimeStamp()
TrapInformation
getTimeStamp
in class TrapInformation
public TrapIdentity getTrapIdentity()
getTrapIdentity
in class TrapInformation
public InetAddress getTrapAddress()
TrapInformation.getAgentAddress()
.getTrapAddress
in class TrapInformation
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.protected org.snmp4j.smi.VariableBinding getVarBindAt(int index)
public String getVersion()
getVersion
in class TrapInformation
public void validate() throws SnmpException
TrapInformation
validate
in class TrapInformation
SnmpException
- on validation error.public SnmpVarBindDTO getSnmpVarBindDTO(int i)
getSnmpVarBindDTO
in class TrapInformation
protected Integer getRequestId()
getRequestId
in class TrapInformation
Copyright © 2021. All rights reserved.