net.sf.snmpadaptor4j.object
Class SnmpTrap

java.lang.Object
  extended by net.sf.snmpadaptor4j.object.SnmpTrap
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
GenericSnmpTrap, SpecificSnmpTrap

public abstract class SnmpTrap
extends Object
implements Serializable

Object representing a specific or generic SNMP trap.

Author:
Jean-Philippe MINETTI
See Also:
Serialized Form

Constructor Summary
protected SnmpTrap(long timeStamp, SnmpOid source, Map<SnmpOid,SnmpTrapData> dataMap)
          Hidden constructor (abstract class).
 
Method Summary
 boolean equals(Object obj)
           
 Map<SnmpOid,SnmpTrapData> getDataMap()
          Returns the map of "interesting" information.
 SnmpOid getSource()
          Returns the OID indexing the source of the trap.
 long getTimeStamp()
          Returns the elapsed time in 100th of second since the application launch.
 int hashCode()
           
static GenericSnmpTrap newInstance(long timeStamp, SnmpOid source, GenericSnmpTrapType type, Map<SnmpOid,SnmpTrapData> dataMap)
          Creates and returns an object representing a generic SNMP trap.
static SpecificSnmpTrap newInstance(long timeStamp, SnmpOid source, int type, Map<SnmpOid,SnmpTrapData> dataMap)
          Creates and returns an object representing a specific SNMP trap.
abstract  void traceTo(org.apache.log4j.Logger logger)
          Traces the content of SNMP trap to logs.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SnmpTrap

protected SnmpTrap(long timeStamp,
                   SnmpOid source,
                   Map<SnmpOid,SnmpTrapData> dataMap)
Hidden constructor (abstract class).

Parameters:
timeStamp - Elapsed time in 100th of second since the application launch.
source - OID indexing the source of the trap.
dataMap - Map of "interesting" information.
Method Detail

newInstance

public static SpecificSnmpTrap newInstance(long timeStamp,
                                           SnmpOid source,
                                           int type,
                                           Map<SnmpOid,SnmpTrapData> dataMap)
Creates and returns an object representing a specific SNMP trap.

Parameters:
timeStamp - Elapsed time in 100th of second since the application launch.
source - OID indexing the source of the trap (must not be NULL).
type - Trap type.
dataMap - Map of "interesting" information.
Returns:
Object representing a specific SNMP trap.

newInstance

public static GenericSnmpTrap newInstance(long timeStamp,
                                          SnmpOid source,
                                          GenericSnmpTrapType type,
                                          Map<SnmpOid,SnmpTrapData> dataMap)
Creates and returns an object representing a generic SNMP trap.

Parameters:
timeStamp - Elapsed time in 100th of second since the application launch.
source - OID indexing the source of the trap (must not be NULL).
type - Trap type (must not be NULL).
dataMap - Map of "interesting" information.
Returns:
Object representing a generic SNMP trap.

getTimeStamp

public final long getTimeStamp()
Returns the elapsed time in 100th of second since the application launch.

Returns:
Elapsed time in 100th of second since the application launch.

getSource

public final SnmpOid getSource()
Returns the OID indexing the source of the trap.

Returns:
OID indexing the source of the trap.

getDataMap

public final Map<SnmpOid,SnmpTrapData> getDataMap()
Returns the map of "interesting" information.

Returns:
Map of "interesting" information (never NULL).

traceTo

public abstract void traceTo(org.apache.log4j.Logger logger)
Traces the content of SNMP trap to logs.

Parameters:
logger - Logger (must not be NULL).

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2012-2013 snmpAdaptor4j. All Rights Reserved.