com.adventnet.services.proxy
Class TrapListenerAndForwarder

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by com.adventnet.services.proxy.TrapListenerAndForwarder
All Implemented Interfaces:
SnmpClient, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter

public class TrapListenerAndForwarder
extends javax.management.NotificationBroadcasterSupport
implements SnmpClient


Field Summary
(package private)  int count
           
(package private)  java.lang.String[] indexNames
           
(package private)  java.lang.Object[] indexVal
           
(package private)  javax.management.MBeanAttributeInfo[] mBeanAttrInfo
           
(package private)  javax.management.ObjectName mbeanObject
           
(package private)  javax.management.modelmbean.ModelMBeanInfo minfo
           
(package private)  javax.management.modelmbean.ModelMBeanAttributeInfo[] modelMBeanAttrInfo
           
(package private)  long seq
           
(package private)  boolean tabular
           
 
Constructor Summary
TrapListenerAndForwarder()
           
TrapListenerAndForwarder(JmxProxy proxy, javax.management.MBeanServer server, int port)
           
 
Method Summary
 boolean authenticate(SnmpPDU pdu, java.lang.String community)
          This function needs to be supplied by the user of the API to add authentication.
 boolean callback(SnmpSession session, SnmpPDU pdu, int requestID)
          This function needs to be supplied by the user of the API to use callbacks.
 java.lang.Object[] convertInstToObjectArray(int[] inst)
           
 void debugPrint(java.lang.String debug)
          This function needs to be supplied by the user of the API to obtain a means of manipulating debugging output.
 java.util.Hashtable getAttributeDetails(java.lang.String snmpOid)
           
 java.lang.String getAttributeName(java.lang.String oid)
           
 javax.management.MBeanServer getServer()
           
 void setMBeanServer()
           
 void setUserDataForNotification(javax.management.Notification notification)
          This method creates and sets the UserData Object for the Notification.
 void stop()
          Method to close the API and Session instantiated by this ListenerAndForwarder.
 void storeUserData(javax.management.Notification notif)
           
 
Methods inherited from class javax.management.NotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

seq

long seq

mbeanObject

javax.management.ObjectName mbeanObject

minfo

javax.management.modelmbean.ModelMBeanInfo minfo

indexNames

java.lang.String[] indexNames

mBeanAttrInfo

javax.management.MBeanAttributeInfo[] mBeanAttrInfo

modelMBeanAttrInfo

javax.management.modelmbean.ModelMBeanAttributeInfo[] modelMBeanAttrInfo

tabular

boolean tabular

count

int count

indexVal

java.lang.Object[] indexVal
Constructor Detail

TrapListenerAndForwarder

public TrapListenerAndForwarder()

TrapListenerAndForwarder

public TrapListenerAndForwarder(JmxProxy proxy,
                                javax.management.MBeanServer server,
                                int port)
Method Detail

getServer

public javax.management.MBeanServer getServer()

setMBeanServer

public void setMBeanServer()

setUserDataForNotification

public void setUserDataForNotification(javax.management.Notification notification)
This method creates and sets the UserData Object for the Notification. The UserData will be a List of Hashtables.


authenticate

public boolean authenticate(SnmpPDU pdu,
                            java.lang.String community)
Description copied from interface: SnmpClient
This function needs to be supplied by the user of the API to add authentication. If not, no authentication will be done. If this method returns false, a message will be printed to Standard Error Output and the PDU will be dropped at the receiver end.

Specified by:
authenticate in interface SnmpClient

callback

public boolean callback(SnmpSession session,
                        SnmpPDU pdu,
                        int requestID)
Description copied from interface: SnmpClient
This function needs to be supplied by the user of the API to use callbacks. If not, a null callback in SnmpAPI class will be used. If it returns true, no further processing will be done at the receiver, e.g. won't be in response queue. In case of multiple calbacks, if any of them returns true no further processing on PDU will occur. Callback on a client gets invoked only if the client authenticate returns true.

Specified by:
callback in interface SnmpClient

debugPrint

public void debugPrint(java.lang.String debug)
Description copied from interface: SnmpClient
This function needs to be supplied by the user of the API to obtain a means of manipulating debugging output. If not, the debugging output will be printed to stdout in SnmpAPI class. System.err.println will still be used for errors in either case.

Specified by:
debugPrint in interface SnmpClient

getAttributeName

public java.lang.String getAttributeName(java.lang.String oid)

storeUserData

public void storeUserData(javax.management.Notification notif)

getAttributeDetails

public java.util.Hashtable getAttributeDetails(java.lang.String snmpOid)

convertInstToObjectArray

public java.lang.Object[] convertInstToObjectArray(int[] inst)

stop

public void stop()
Method to close the API and Session instantiated by this ListenerAndForwarder. Idealy stops this TrapListenerAndForwarder.