org.jboss.jmx.adaptor.snmp.agent
Class NotificationWrapperSupport

java.lang.Object
  extended byorg.jboss.jmx.adaptor.snmp.agent.NotificationWrapperSupport
All Implemented Interfaces:
NotificationWrapper (src)

public class NotificationWrapperSupport
extends java.lang.Object
implements NotificationWrapper (src)

NotificationWrapperSupport provides a base NotificationWrapper implementation


Field Summary
protected  Clock (src) clock
          Provides uptime
protected  java.util.Map payload
          Holds the notification payload keyed on the attibute name
protected  Counter (src) trapCount
          Provides trap count
 
Fields inherited from interface org.jboss.jmx.adaptor.snmp.agent.NotificationWrapper (src)
ALL_TAG, CLASS_TAG, MESSAGE_TAG, SEQNO_TAG, STARTTIME_TAG, TRAPCOUNT_TAG, TSTAMP_TAG, TYPE_TAG, UPTIME_TAG
 
Constructor Summary
NotificationWrapperSupport()
          CTOR
 
Method Summary
 java.lang.Object get(java.lang.String tagName)
          Implements the communication protocol between the caller and the data source (notification and agent) based on tags.
 void prime(Notification (src)  n)
          Set the notification to be used as the data source.
 void set(Clock (src)  uptime, Counter (src)  count)
          Loads the hashmap with the DCAs of interest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

payload

protected java.util.Map payload
Holds the notification payload keyed on the attibute name


clock

protected Clock (src)  clock
Provides uptime


trapCount

protected Counter (src)  trapCount
Provides trap count

Constructor Detail

NotificationWrapperSupport

public NotificationWrapperSupport()
CTOR

Method Detail

set

public void set(Clock (src)  uptime,
                Counter (src)  count)
Loads the hashmap with the DCAs of interest. Note that the keys are used as attribute tags in the mapping resource file

Specified by:
set in interface NotificationWrapper (src)

prime

public void prime(Notification (src)  n)
Set the notification to be used as the data source. Load the hashmap with all of the notification contents. Note that the keys are used as attribute tags in the mapping resource file

Specified by:
prime in interface NotificationWrapper (src)
Parameters:
n - the notification to be used as data source at subsequent calls of get()

get

public java.lang.Object get(java.lang.String tagName)
                     throws MappingFailedException (src) 
Implements the communication protocol between the caller and the data source (notification and agent) based on tags. Implementations are expected to map the provided attribute name to some aspect of the notification payload. The later is defined by method prime.

Specified by:
get in interface NotificationWrapper (src)
Parameters:
tagName - the tag of the attribute the value of which is required
Returns:
the content attrTag maps to
Throws:
MappingFailedException (src) - if for any reason the requested attribute can not be found