Package org.opennms.netmgt.snmp
Class TrapInformation
- java.lang.Object
-
- org.opennms.netmgt.snmp.TrapInformation
-
- Direct Known Subclasses:
Snmp4JTrapNotifier.Snmp4JV1TrapInformation
,Snmp4JTrapNotifier.Snmp4JV2V3TrapInformation
,V1TrapInformation
,V2TrapInformation
public abstract class TrapInformation extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TrapInformation(java.net.InetAddress agent, java.lang.String community)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.net.InetAddress
getAgentAddress()
Returns the sending agent's internet addressjava.lang.String
getCommunity()
Returns the SNMP community string from the received packet.long
getCreationTime()
java.lang.String
getLocation()
abstract int
getPduLength()
protected abstract java.lang.Integer
getRequestId()
abstract SnmpVarBindDTO
getSnmpVarBindDTO(int i)
java.lang.String
getSystemId()
abstract long
getTimeStamp()
Get the SNMP TimeTicks value for the sysUpTime of the agent that generated the trap.abstract java.net.InetAddress
getTrapAddress()
abstract TrapIdentity
getTrapIdentity()
abstract java.lang.String
getVersion()
void
setCreationTime(long creationTime)
void
setLocation(java.lang.String location)
void
setSystemId(java.lang.String systemId)
void
validate()
Validate the trap.
-
-
-
Method Detail
-
getTrapAddress
public abstract java.net.InetAddress getTrapAddress()
- Returns:
- The source IP address of the trap. For SNMPv2 traps, this value
is always the same as the value of
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.
-
getSystemId
public final java.lang.String getSystemId()
-
setSystemId
public final void setSystemId(java.lang.String systemId)
-
getLocation
public final java.lang.String getLocation()
-
setLocation
public final void setLocation(java.lang.String location)
-
getCommunity
public final java.lang.String getCommunity()
Returns the SNMP community string from the received packet.
-
validate
public void validate() throws SnmpException
Validate the trap.- Throws:
SnmpException
- on validation error.
-
getAgentAddress
public final java.net.InetAddress getAgentAddress()
Returns the sending agent's internet address
-
getCreationTime
public final long getCreationTime()
-
setCreationTime
public final void setCreationTime(long creationTime)
-
getVersion
public abstract java.lang.String getVersion()
-
getPduLength
public abstract int getPduLength()
-
getTimeStamp
public abstract long getTimeStamp()
Get 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.
-
getTrapIdentity
public abstract TrapIdentity getTrapIdentity()
-
getRequestId
protected abstract java.lang.Integer getRequestId()
-
getSnmpVarBindDTO
public abstract SnmpVarBindDTO getSnmpVarBindDTO(int i)
-
-