org.jboss.jmx.adaptor.snmp.agent
Interface NotificationWrapper

All Known Implementing Classes:
NotificationWrapperSupport (src)

public interface NotificationWrapper

NotificationWrapper is a "wide" read only interface providing "unstructured" access to agent internals and paylod carried by notifications. The alternatives were: 1. Precompile assumptions regarding the notification stucture and its payload in the trap factory 2. Use introspection but with a potential large execution overhead. The use of delegated wrappers stands somewhere in the middle. Trap factory can be extended with the definition and use of new wpappers that will be able to cope with any kind of notfications. Run time overhead is minimal as wrappers can be instantiated only once. Tags used to locate attributes in the notification fixed (i.e. excluding user defined fields) payload are defined. Implementations should not use these tags in any of the notification payload. To avoid conflicts the following convention is proposed: standard notification payload is qualified by the "n:" prefix. Agent properties are qualified by the "a:" prefix. User defined payload can be qualified with e.g. the "u:" prefix


Field Summary
static java.lang.String ALL_TAG
           
static java.lang.String CLASS_TAG
           
static java.lang.String MESSAGE_TAG
           
static java.lang.String SEQNO_TAG
           
static java.lang.String STARTTIME_TAG
           
static java.lang.String TRAPCOUNT_TAG
           
static java.lang.String TSTAMP_TAG
           
static java.lang.String TYPE_TAG
           
static java.lang.String UPTIME_TAG
           
 
Method Summary
 java.lang.Object get(java.lang.String attrTag)
          Defines the communication protocol between the caller and the data source (notification).
 void prime(Notification (src)  n)
          Sets notification to be used as the data source
 void set(Clock (src)  uptime, Counter (src)  count)
          Sets the uptime clock and trap counter
 

Field Detail

MESSAGE_TAG

public static final java.lang.String MESSAGE_TAG
See Also:
Constant Field Values (src)

SEQNO_TAG

public static final java.lang.String SEQNO_TAG
See Also:
Constant Field Values (src)

TSTAMP_TAG

public static final java.lang.String TSTAMP_TAG
See Also:
Constant Field Values (src)

TYPE_TAG

public static final java.lang.String TYPE_TAG
See Also:
Constant Field Values (src)

ALL_TAG

public static final java.lang.String ALL_TAG
See Also:
Constant Field Values (src)

CLASS_TAG

public static final java.lang.String CLASS_TAG
See Also:
Constant Field Values (src)

STARTTIME_TAG

public static final java.lang.String STARTTIME_TAG
See Also:
Constant Field Values (src)

UPTIME_TAG

public static final java.lang.String UPTIME_TAG
See Also:
Constant Field Values (src)

TRAPCOUNT_TAG

public static final java.lang.String TRAPCOUNT_TAG
See Also:
Constant Field Values (src)
Method Detail

set

public void set(Clock (src)  uptime,
                Counter (src)  count)
Sets the uptime clock and trap counter


prime

public void prime(Notification (src)  n)
Sets notification to be used as the data source

Parameters:
n - the notification to be used as a data source at subsequent calls of method get

get

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

Parameters:
attrTag - 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