Package org.opennms.netmgt.snmp
Class TrapInformation
- java.lang.Object
-
- org.opennms.netmgt.snmp.TrapInformation
-
- Direct Known Subclasses:
Snmp4JTrapNotifier.Snmp4JV1TrapInformation,Snmp4JTrapNotifier.Snmp4JV2TrapInformation,V1TrapInformation,V2TrapInformation
public abstract class TrapInformation extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTrapInformation(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.InetAddressgetAgentAddress()Returns the sending agent's internet addressjava.lang.StringgetCommunity()Returns the SNMP community string from the received packet.longgetCreationTime()java.lang.StringgetLocation()abstract intgetPduLength()protected abstract java.lang.IntegergetRequestId()abstract SnmpVarBindDTOgetSnmpVarBindDTO(int i)java.lang.StringgetSystemId()abstract longgetTimeStamp()Get the SNMP TimeTicks value for the sysUpTime of the agent that generated the trap.abstract java.net.InetAddressgetTrapAddress()abstract TrapIdentitygetTrapIdentity()abstract java.lang.StringgetVersion()voidsetCreationTime(long creationTime)voidsetLocation(java.lang.String location)voidsetSystemId(java.lang.String systemId)voidvalidate()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 SnmpExceptionValidate 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)
-
-