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, setSystemIdpublic 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 TrapInformationpublic long getTimeStamp()
TrapInformationgetTimeStamp in class TrapInformationpublic TrapIdentity getTrapIdentity()
getTrapIdentity in class TrapInformationpublic InetAddress getTrapAddress()
TrapInformation.getAgentAddress().getTrapAddress in class TrapInformationTrapInformation.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 TrapInformationpublic void validate()
throws SnmpException
TrapInformationvalidate in class TrapInformationSnmpException - on validation error.public SnmpVarBindDTO getSnmpVarBindDTO(int i)
getSnmpVarBindDTO in class TrapInformationprotected Integer getRequestId()
getRequestId in class TrapInformationCopyright © 2021. All rights reserved.