net.sf.snmpadaptor4j.core.trap
Class SnmpTrapBuilder

java.lang.Object
  extended by net.sf.snmpadaptor4j.core.trap.SnmpTrapBuilder
All Implemented Interfaces:
Serializable

public class SnmpTrapBuilder
extends Object
implements Serializable

Builder of SNMP traps from JMX notifications for an MBean.

Author:
Jean-Philippe MINETTI
See Also:
Serialized Form

Constructor Summary
SnmpTrapBuilder(Map<String,SnmpTrapMapping> mappingMap, SystemInfo systemInfo)
          Constructor.
 
Method Summary
 Map<String,SnmpTrapMapping> getMappingMap()
          Returns the map of mappings to build SNMP traps for each notification type.
protected  Map<SnmpOid,SnmpTrapData> newDataMap(DataMapTrapMapping mapping, Notification notification)
          Creates and returns a new dataMap of SnmpTrap by a JMX notification.
 SnmpTrap newTrap(Notification notification)
          Creates and returns a new SNMP trap by a JMX notification.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SnmpTrapBuilder

public SnmpTrapBuilder(Map<String,SnmpTrapMapping> mappingMap,
                       SystemInfo systemInfo)
Constructor.

Parameters:
mappingMap - Map of mappings to build SNMP traps for each notification type.
systemInfo - Informations on the system.
Method Detail

getMappingMap

public Map<String,SnmpTrapMapping> getMappingMap()
Returns the map of mappings to build SNMP traps for each notification type.

Returns:
Map of mappings to build SNMP traps for each notification type.

newTrap

public SnmpTrap newTrap(Notification notification)
Creates and returns a new SNMP trap by a JMX notification.

Parameters:
notification - JMX notification generated by a MBean.
Returns:
New SNMP trap or NULL if the notification is not mapped.

newDataMap

protected final Map<SnmpOid,SnmpTrapData> newDataMap(DataMapTrapMapping mapping,
                                                     Notification notification)
Creates and returns a new dataMap of SnmpTrap by a JMX notification.

Parameters:
mapping - Mapping to build the dataMap field of SnmpTrap from a JMX notification.
notification - JMX notification generated by a MBean.
Returns:
New dataMap of SnmpTrap.

toString

public final String toString()
Overrides:
toString in class Object


Copyright © 2012-2013 snmpAdaptor4j. All Rights Reserved.