com.adventnet.services.proxy
Class JMXSnmpProxyModelMBean

java.lang.Object
  extended by javax.management.modelmbean.RequiredModelMBean
      extended by com.adventnet.services.proxy.JMXSnmpProxyModelMBean
All Implemented Interfaces:
com.adventnet.utils.jmx.JmxTableModelListener, javax.management.DynamicMBean, javax.management.MBeanRegistration, javax.management.modelmbean.ModelMBean, javax.management.modelmbean.ModelMBeanNotificationBroadcaster, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, javax.management.PersistentMBean

public class JMXSnmpProxyModelMBean
extends javax.management.modelmbean.RequiredModelMBean
implements com.adventnet.utils.jmx.JmxTableModelListener, javax.management.MBeanRegistration


Constructor Summary
JMXSnmpProxyModelMBean(java.util.Hashtable propertyHash, JmxProxy proxy)
           
 
Method Summary
 void addRow(java.lang.Object[] indexObjects, javax.jmx.openmbean.CompositeData entry)
          When the manager is trying to add a row in the table, this method will be called.
 void deleteRow(java.lang.Object[] indexObjects)
          When the manager is trying to delete a row in the table, this method will be called.
 java.lang.Object getAttribute(java.lang.String attribute)
           
 java.util.List getEntries(int startIndex, int endIndex)
          This method gives an List of the CompositeData instances in this table starting from the startIndex through till the EndIndex.
 javax.jmx.openmbean.CompositeData getEntry(java.lang.Object[] indexObjects)
          To get the entry for the given row (identified by the instance)
 javax.jmx.openmbean.CompositeData getFirstEntry()
          To get the first entry in the table
 java.lang.String[] getIndexNames()
           
 javax.jmx.openmbean.CompositeData getNextEntry(java.lang.Object[] indexObjects)
          To get the next entry for the given row (identified by the instance)
 java.lang.Object invoke(java.lang.String actionName, java.lang.Object[] params, java.lang.String[] signature)
           
 void modifyRow(java.lang.Object[] indexObjects, javax.jmx.openmbean.CompositeData entry)
          When the manager is trying to modify a row in the table, this method will be called.
 void postDeregister()
          Allows the MBean to perform any operations needed after having been de-registered in the MBeanServer.
 void postRegister(java.lang.Boolean registrationDone)
          Allows the MBean to perform any operations needed after having been registered in the MBeanServer or after the registration has failed.
 void preDeregister()
          Allows the MBean to perform any operations it needs before being de-registered by the MBeanServer.
 javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
          Allows the MBean to perform any operations it needs before being registered in the MBeanServer.
 void setAttribute(javax.management.Attribute attribute)
           
 void setCommunity(java.lang.String community)
           
 void setHost(java.lang.String host)
           
 void setIndexNames(java.lang.String indexNames)
           
 void setJmxProxy(JmxProxy proxy)
           
 void setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo mbi)
           
 void setObjectName(java.lang.String objectName)
           
 void setPort(java.lang.String port)
           
 void setSNMPVersion(java.lang.String version)
           
 int totalRows()
          This method gives the total number of rows in the table.
 
Methods inherited from class javax.management.modelmbean.RequiredModelMBean
addAttributeChangeNotificationListener, addNotificationListener, getAttributes, getClassLoaderRepository, getMBeanInfo, getNotificationInfo, load, removeAttributeChangeNotificationListener, removeNotificationListener, removeNotificationListener, sendAttributeChangeNotification, sendAttributeChangeNotification, sendNotification, sendNotification, setAttributes, setManagedResource, store
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JMXSnmpProxyModelMBean

public JMXSnmpProxyModelMBean(java.util.Hashtable propertyHash,
                              JmxProxy proxy)
                       throws javax.management.MBeanException,
                              javax.management.RuntimeOperationsException
Throws:
javax.management.MBeanException
javax.management.RuntimeOperationsException
Method Detail

setObjectName

public void setObjectName(java.lang.String objectName)

setHost

public void setHost(java.lang.String host)

setPort

public void setPort(java.lang.String port)

setIndexNames

public void setIndexNames(java.lang.String indexNames)

getIndexNames

public java.lang.String[] getIndexNames()

setSNMPVersion

public void setSNMPVersion(java.lang.String version)

setCommunity

public void setCommunity(java.lang.String community)

setJmxProxy

public void setJmxProxy(JmxProxy proxy)

getEntry

public javax.jmx.openmbean.CompositeData getEntry(java.lang.Object[] indexObjects)
To get the entry for the given row (identified by the instance)

Specified by:
getEntry in interface com.adventnet.utils.jmx.JmxTableModelListener
Parameters:
indexObjects - the object array with index objects which identifies the row
Returns:
instance of javax.jmx.openmbean.CompositeData with the entry information. Otherwise null.

getNextEntry

public javax.jmx.openmbean.CompositeData getNextEntry(java.lang.Object[] indexObjects)
To get the next entry for the given row (identified by the instance)

Specified by:
getNextEntry in interface com.adventnet.utils.jmx.JmxTableModelListener
Parameters:
indexObjects - the object array with index objects which identifies the row
Returns:
instance of javax.jmx.openmbean.CompositeData with the entry information. Otherwise null.

getFirstEntry

public javax.jmx.openmbean.CompositeData getFirstEntry()
To get the first entry in the table

Specified by:
getFirstEntry in interface com.adventnet.utils.jmx.JmxTableModelListener
Returns:
instance of javax.jmx.openmbean.CompositeData with the entry information. Otherwise null.

addRow

public void addRow(java.lang.Object[] indexObjects,
                   javax.jmx.openmbean.CompositeData entry)
            throws java.lang.Exception
When the manager is trying to add a row in the table, this method will be called.

Specified by:
addRow in interface com.adventnet.utils.jmx.JmxTableModelListener
Parameters:
indexObjects - the object array with index objects which identifies the row to be added.
entry - the entry value as javax.jmx.openmbean.CompositeData instance.
Throws:
java.lang.Exception

deleteRow

public void deleteRow(java.lang.Object[] indexObjects)
               throws java.lang.Exception
When the manager is trying to delete a row in the table, this method will be called.

Specified by:
deleteRow in interface com.adventnet.utils.jmx.JmxTableModelListener
Parameters:
indexObjects - the object array with index objects which identifies the row to be deleted.
entry - the entry value as javax.jmx.openmbean.CompositeData instance.
Throws:
java.lang.Exception

modifyRow

public void modifyRow(java.lang.Object[] indexObjects,
                      javax.jmx.openmbean.CompositeData entry)
               throws java.lang.Exception
When the manager is trying to modify a row in the table, this method will be called.

Specified by:
modifyRow in interface com.adventnet.utils.jmx.JmxTableModelListener
Parameters:
indexObjects - the object array with index objects which identifies the row to be modified.
entry - the entry value as javax.jmx.openmbean.CompositeData instance.
Throws:
java.lang.Exception

totalRows

public int totalRows()
This method gives the total number of rows in the table. This method will be used by the HTML and TL1 adaptors. Users who wish to have only Snmp interface need not implement this method.

Specified by:
totalRows in interface com.adventnet.utils.jmx.JmxTableModelListener
Returns:
int specifying the number of rows in the Table.

getEntries

public java.util.List getEntries(int startIndex,
                                 int endIndex)
This method gives an List of the CompositeData instances in this table starting from the startIndex through till the EndIndex. This method will be used by the HTML and TL1 adaptors. Users who wish to have only Snmp interface need not implement this method. For example: If the 1st 5 rows have to be retrieved, then the start index will be 1 and the end index will be 5.

Specified by:
getEntries in interface com.adventnet.utils.jmx.JmxTableModelListener
Returns:
List of the instances of the CompositeData.

getAttribute

public java.lang.Object getAttribute(java.lang.String attribute)
                              throws javax.management.AttributeNotFoundException,
                                     javax.management.MBeanException,
                                     javax.management.ReflectionException
Specified by:
getAttribute in interface javax.management.DynamicMBean
Overrides:
getAttribute in class javax.management.modelmbean.RequiredModelMBean
Throws:
javax.management.AttributeNotFoundException
javax.management.MBeanException
javax.management.ReflectionException

setAttribute

public void setAttribute(javax.management.Attribute attribute)
                  throws javax.management.AttributeNotFoundException,
                         javax.management.InvalidAttributeValueException,
                         javax.management.MBeanException,
                         javax.management.ReflectionException
Specified by:
setAttribute in interface javax.management.DynamicMBean
Overrides:
setAttribute in class javax.management.modelmbean.RequiredModelMBean
Throws:
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionException

setModelMBeanInfo

public void setModelMBeanInfo(javax.management.modelmbean.ModelMBeanInfo mbi)
                       throws javax.management.MBeanException,
                              javax.management.RuntimeOperationsException
Specified by:
setModelMBeanInfo in interface javax.management.modelmbean.ModelMBean
Overrides:
setModelMBeanInfo in class javax.management.modelmbean.RequiredModelMBean
Throws:
javax.management.MBeanException
javax.management.RuntimeOperationsException

invoke

public java.lang.Object invoke(java.lang.String actionName,
                               java.lang.Object[] params,
                               java.lang.String[] signature)
                        throws javax.management.MBeanException,
                               javax.management.ReflectionException
Specified by:
invoke in interface javax.management.DynamicMBean
Overrides:
invoke in class javax.management.modelmbean.RequiredModelMBean
Throws:
javax.management.MBeanException
javax.management.ReflectionException

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
                                        throws java.lang.Exception
Allows the MBean to perform any operations it needs before being registered in the MBeanServer. If the name of the MBean is not specified, the MBean can provide a name for its registration. If any exception is raised, the MBean will not be registered in the MBeanServer.

Specified by:
preRegister in interface javax.management.MBeanRegistration
Overrides:
preRegister in class javax.management.modelmbean.RequiredModelMBean
Parameters:
server - The MBeanServer in which the MBean will be registered.
name - The object name of the MBean.
Returns:
The name of the MBean registered.
Throws:
java.lang.Exception - This exception should be caught by the MBeanServer and re-thrown as an MBeanRegistrationException.

postRegister

public void postRegister(java.lang.Boolean registrationDone)
Allows the MBean to perform any operations needed after having been registered in the MBeanServer or after the registration has failed.

Specified by:
postRegister in interface javax.management.MBeanRegistration
Overrides:
postRegister in class javax.management.modelmbean.RequiredModelMBean
Parameters:
registrationDone - Indicates whether or not the MBean has been successfully registered in the MBeanServer. The value false means that either the registration phase has failed.

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Allows the MBean to perform any operations it needs before being de-registered by the MBeanServer.

Specified by:
preDeregister in interface javax.management.MBeanRegistration
Overrides:
preDeregister in class javax.management.modelmbean.RequiredModelMBean
Throws:
java.lang.Exception - This exception should be caught by the MBeanServer and re-thrown as an MBeanRegistrationException.

postDeregister

public void postDeregister()
Allows the MBean to perform any operations needed after having been de-registered in the MBeanServer.

Specified by:
postDeregister in interface javax.management.MBeanRegistration
Overrides:
postDeregister in class javax.management.modelmbean.RequiredModelMBean