com.adventnet.snmp.ui
Class TableBean

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JTable
                          |
                          +--com.adventnet.snmp.ui.TableBean
All Implemented Interfaces:
javax.accessibility.Accessible, javax.swing.event.CellEditorListener, java.util.EventListener, java.awt.image.ImageObserver, javax.swing.event.ListSelectionListener, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable, javax.swing.event.TableColumnModelListener, javax.swing.event.TableModelListener, java.beans.VetoableChangeListener

public class TableBean
extends javax.swing.JTable
implements java.io.Serializable, java.beans.VetoableChangeListener

TableBean component combines the JTable and SnmpTableModel components. It extends JTable and can be used like JTable in user interface applications.

It supports sets and the display of enumerated integer variables in a combo-box in a user-friendly manner.

To use TableBean, instantiate, setup properties, and add it to your UI component. For example:

	TableBean tableBean = new TableBean();
	// set the properties fo the table bean
	tableBean.setTargetHost (host);
	tableBean.setCommunity (community);

	try {
	    tableBean.setMibModules(mibs);
	    tableBean.setTableOID (tableOID);

	} catch (Exception ex) {
	    System.err.println("Error: "+ex);
	}
	
	JScrollPane scrollpane = new JScrollPane(tableBean);
	getContentPane().add(scrollpane);
  

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JTable
javax.swing.JTable.AccessibleJTable
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JTable
AUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS, autoCreateColumnsFromModel, autoResizeMode, cellEditor, cellSelectionEnabled, columnModel, dataModel, defaultEditorsByColumnClass, defaultRenderersByColumnClass, editingColumn, editingRow, editorComp, gridColor, preferredViewportSize, rowHeight, rowMargin, rowSelectionAllowed, selectionBackground, selectionForeground, selectionModel, showHorizontalLines, showVerticalLines, tableHeader
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TableBean()
          Use this constructor for Applications
TableBean(java.applet.Applet applet)
          Use this constructor for Applets
 
Method Summary
 void create_v3_tables()
          v3 only Creates the SNMPv3 tables for authentication and privacy
 void editHeader(int index, java.lang.String newValue)
          Edit/change the name of the column header represented by the index,with a new Value.
 java.lang.String getAuthPassword()
          v3 only Gets the Snmpv3 AuthPassword
 int getAuthProtocol()
          v3 only Gets the Snmpv3 AuthProtocol
 java.lang.String getCharacterEncoding()
          Gets the Character Encoding being used.
 java.lang.String getCommunity()
          Gets the community name.
 java.lang.String getContextID()
          v3 only Gets the SNMP V3 contextID
 java.lang.String getContextName()
          v3 only Gets the SNMP V3 Context name
 boolean getDebug()
          Returns whether Debug option is enabled or not.
 java.lang.String getHost()
          Deprecated. .New method is getTargetHost
 java.lang.String getMibModules()
          Gets the MIB files that are loaded in the TableBean instance.
 java.lang.String getMibPath()
          Gets the search Path in which the Mib Parser will search for the MIB modules.
 java.lang.String[] getObjectIDList()
          Gets the column names of the table that are already set using setObjectIDList() or setTableOID().
 boolean getOverwriteCMI()
          Defines whether the compiled mibs will be overwritten or not NOTE: This applies only when the setLoadFromCompiledMibs is set to true.
 int getPollInterval()
          Gets the Poll Interval in seconds.
 int getPort()
          Deprecated. .New method is setTargetPort
 java.lang.String getPrincipal()
          v3 only Gets the SNMPv3 Principal
 java.lang.String getPrivPassword()
          v3 only Gets the Snmpv3 PrivPassword
 int getRetries()
          Gets the retries value for the table.Default value is 0
 boolean getRetrievalMode()
          Gets the mode of retrieval of table data.
 int getSecurityModel()
          v3 only Gets the SNMP V3 securityModel
 java.lang.String getSerializedMibFileName()
          Gets the name of the Serialized Mib file
 SnmpEngineTable getSnmpEngineTable()
          v3 only Gets a reference for SnmpEngineTable
 SnmpTableModel getSnmpTableModel()
          Gets an instance of SnmpTableModel which handles processing of SNMP tables.
 int getSnmpVersion()
          v2c and v3 only Gets the SNMP Version.
 java.lang.String getTableOID()
          Gets the tableOID that is set in the TableBean instance.
 java.lang.String getTargetHost()
          Gets the agent host or IpAddress for the table
 int getTargetPort()
          Gets the agent port for the table
 int getTimeout()
          Gets the timeout value for the table.Default is 5 seconds.
 USMUserTable getUSMTable()
          v3 only Gets a reference for USMUserTable
 void initJdbcParams(java.lang.String driverName, java.lang.String URL, java.lang.String userName, java.lang.String passWord)
          Initializes the JDBC parameters.This method can be used if you need to use database support for mibs.
 boolean isLoadFromCompiledMibs()
          Defines if mibs will be loaded from CompiledMibs or not
 boolean isLoadFromSerializedMibs()
          Defines if mibs will be loaded from SerializedMibs or not
 boolean isLoadMibsFromDatabase()
          Returns whether mibs will be loaded from database or not.
 boolean isOverwriteMibsInDatabase()
          Returns whether mibs in Database will be overwritten or not.
 boolean isReadDesc()
          Defines if mib descriptions will be read from compiled mibs or not
 boolean isSerializeMibs()
          Defines if the mibs will be serialized or not
 boolean isV3DatabaseFlag()
          v3 only Defines whether V3 database flag is set or not.
 void refreshTable()
          Refreshes the Table data
 void setAuthPassword(java.lang.String key)
          v3 only Sets the Snmpv3 AuthPassword
 void setAuthProtocol(int protocol)
          v3 only Sets the Snmpv3 AuthProtocol
 void setCharacterEncoding(java.lang.String enc)
          Sets the Character Encoding to be used.
 void setColumnsPolled(java.util.Vector v)
          Sets the columns that needs to be polled.
 void setCommunity(java.lang.String community)
          Sets the community name to which the agent belongs.
 void setContextID(java.lang.String ctxtID)
          v3 only Sets the SNMP V3 contextID
 void setContextName(java.lang.String cName)
          v3 only Sets the SNMP V3 Context name
 void setDebug(boolean flag)
          This method is used to enable or disable the debug option.The debug option will be enabled if this is set to true and will be disabled if this is set to false.
 void setFromUI(boolean flag)
          Deprecated. . Not needed for API users.
 void setHost(java.lang.String host)
          Deprecated. .New method is setTargetHost
 void setLoadFromCompiledMibs(boolean flag)
          Defines whether to load mib from compiled MIBs.
 void setLoadFromSerializedMibs(boolean flag)
          Defines whether to load MIBs from serialized file or not.
 void setLoadMibsFromDatabase(boolean flag)
          Defines whether to load mib from DataBase or not.
 void setMibModules(java.lang.String mibs)
          Sets the MIB files to be loaded.Multiple MIB files can be loaded by giving the MIB files as a white space seperated list of files.
 void setMibPath(java.lang.String path)
          Sets the search Path in which the Mib Parser will search for the MIB modules.
protected  void setModel1(javax.swing.table.TableModel newModel)
           
 void setObjectIDList(java.lang.String[] columnNames)
          Sets the column names of the table that needs to be polled.
 void setOverwriteCMI(boolean overWrite)
          Defines whether to overwrite the existing compiled MIB files.
 void setOverwriteMibsInDatabase(boolean overWrite)
          Defines whether to overwrite the MIB in the DataBase.
 void setParams(java.lang.String host, java.lang.String mib, java.lang.String tableOID)
          Sets multiple parameters like TargetHost,MibModule and TableOID
 void setPollInterval(int i)
          Sets the Poll Interval for the table
 void setPort(int port)
          Deprecated. .New method is setTargetPort
 void setPrincipal(java.lang.String s)
          v3 only Sets the SNMPv3 Principal
 void setPrivPassword(java.lang.String key)
          v3 only Sets the Snmpv3 PrivPassword
 void setReadDesc(boolean readFlag)
          Sets the flag to read descriptions from compiled mib modules.
 void setRetries(int retries)
          Sets the retries value for the table.Default value is 0.
 void setRetrievalMode(boolean mode)
          Sets the mode of retrieval of table data.
 void setSecurityModel(int securityModel)
          v3 only Sets the SNMP V3 SecurityModel
 void setSerializedMibFileName(java.lang.String serFileName)
          Defines the name of the MIB File to be serialized.
 void setSerializeMibs(boolean flag)
          Defines whether to serialize the MibModules or not.
 void setSnmpVersion(int i)
          v2c and v3 only Sets the SNMP Version.
 void setTableOID(java.lang.String tableOID)
          Sets the tableOID for the table
 void setTableOIDWoStart(java.lang.String tableOID)
          Sets the tableOID for the table without starting the polling of table data.
 void setTargetHost(java.lang.String host)
          Sets the host name or IpAddress.
 void setTargetPort(int port)
          Sets the target port number for the table
 void setTimeout(int timeout)
          Sets the timeout for the table.Default timeout value is 5 seconds.
 void setV3DatabaseFlag(boolean v3Flag)
          v3 only Set this flag to true if you need to use database support for V3 and false if you donot need database support for V3.
 void startPolling()
          Starts Polling the Table data.The poll interval can be set using setPollInterval() method.The Default poll interval value is 5 secs.
 void stopPolling()
          Stops Polling the Table data.
 void vetoableChange(java.beans.PropertyChangeEvent e)
          This method is called when a vetoableChangeEvent is fired from the PropertySetting bean.
 
Methods inherited from class javax.swing.JTable
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getEditingColumn, getEditingRow, getEditorComponent, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, getValueAt, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setEditingColumn, setEditingRow, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setValueAt, sizeColumnsToFit, sizeColumnsToFit, tableChanged, unconfigureEnclosingScrollPane, updateUI, valueChanged
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableBean

public TableBean()
Use this constructor for Applications


TableBean

public TableBean(java.applet.Applet applet)
Use this constructor for Applets

Method Detail

getSnmpEngineTable

public SnmpEngineTable getSnmpEngineTable()
v3 only Gets a reference for SnmpEngineTable

Returns:
a reference for SnmpEngineTable

getUSMTable

public USMUserTable getUSMTable()
v3 only Gets a reference for USMUserTable

Returns:
a reference for USMUserTable

getSnmpTableModel

public SnmpTableModel getSnmpTableModel()
Gets an instance of SnmpTableModel which handles processing of SNMP tables.

Returns:
SnmpTableModel instance.

setParams

public void setParams(java.lang.String host,
                      java.lang.String mib,
                      java.lang.String tableOID)
Sets multiple parameters like TargetHost,MibModule and TableOID

Parameters:
host - target host or IpAddress
mib - mib file to be loaded in the TableBean instance.
tableOID - OID of the table

setHost

public void setHost(java.lang.String host)
Deprecated. .New method is setTargetHost


setTargetHost

public void setTargetHost(java.lang.String host)
Sets the host name or IpAddress.

Parameters:
host - agent name or IpAddress in String format.

initJdbcParams

public void initJdbcParams(java.lang.String driverName,
                           java.lang.String URL,
                           java.lang.String userName,
                           java.lang.String passWord)
Initializes the JDBC parameters.This method can be used if you need to use database support for mibs.

Parameters:
driverName - the name of the driver to be used.
URL - URL pointing to the DataBase file name
userName - userName
passWord - password

setLoadMibsFromDatabase

public void setLoadMibsFromDatabase(boolean flag)
Defines whether to load mib from DataBase or not. The Jdbc Parameters should be set, using the initJdbcParams(), before calling this method. This flag should be set before loading the MIBs (By default it is set to false). If this flag is set to true, it will parse the mibs,and store it in the database. For ex: RMON2-MIB is loaded, it will parse the mib and store it in the database.

Parameters:
flag - true to load MIBs from database and false otherwise
See Also:
initJdbcParams(String driverName,String URL, String userName, String passWord)

setOverwriteMibsInDatabase

public void setOverwriteMibsInDatabase(boolean overWrite)
Defines whether to overwrite the MIB in the DataBase. NOTE: This applies only when the setLoadFromDataBase is set to true.

Parameters:
overWrite - true to overwrite the MIB in the database and false otherwise.

isOverwriteMibsInDatabase

public boolean isOverwriteMibsInDatabase()
Returns whether mibs in Database will be overwritten or not. NOTE: This applies only when the setLoadFromDataBase is set to true.

Returns:
true if the MIBs in database will be overwritten and false otherwise.

isLoadMibsFromDatabase

public boolean isLoadMibsFromDatabase()
Returns whether mibs will be loaded from database or not.

Returns:
true if MIBs will be loaded from database and false otherwise.

isV3DatabaseFlag

public boolean isV3DatabaseFlag()
v3 only Defines whether V3 database flag is set or not.

Returns:
true if V3 database flag is set and false if it is not set.

setV3DatabaseFlag

public void setV3DatabaseFlag(boolean v3Flag)
v3 only Set this flag to true if you need to use database support for V3 and false if you donot need database support for V3.

Parameters:
v3Flag - true to set the V3 database flag and false otherwise.

setCharacterEncoding

public void setCharacterEncoding(java.lang.String enc)
Sets the Character Encoding to be used. The encoding specified will be used internally to convert String <--> byte[]. The Default value is ISO8859_1.

Parameters:
enc - The name of a character encoding. All the string encoding will be done base on this encoding.

getCharacterEncoding

public java.lang.String getCharacterEncoding()
Gets the Character Encoding being used. This encoding scheme will be used internally to convert String <--> byte[]. The Default value is ISO8859_1.

Returns:
enc The character encoding used.

getHost

public java.lang.String getHost()
Deprecated. .New method is getTargetHost


getTargetHost

public java.lang.String getTargetHost()
Gets the agent host or IpAddress for the table

Returns:
host name or the IpAddress in String format.

setCommunity

public void setCommunity(java.lang.String community)
Sets the community name to which the agent belongs.

Parameters:
community - community name

getRetrievalMode

public boolean getRetrievalMode()
Gets the mode of retrieval of table data. Will return true if the bean will use successive GetNext to retrieve the table data and false if the bean will use GetBulk to retrieve the table data. Default value is true.

Returns:
true if GetNext is the mode of retrieval and false if GetBulk is the mode of retrieval.

setRetrievalMode

public void setRetrievalMode(boolean mode)
Sets the mode of retrieval of table data. This should be set to true to retrieve the table using successive GetNext. By default this is set to true. To use GetBulk this should be set to false.

Parameters:
mode - true to retrieve the table using GetNext and false to retrieve the table using GetBulk.

setColumnsPolled

public void setColumnsPolled(java.util.Vector v)
Sets the columns that needs to be polled. The index vector can have the indices of the columns as Integer Objects.

Parameters:
v - vector of column indices that need to be polled.

getCommunity

public java.lang.String getCommunity()
Gets the community name.

Returns:
community name.

getObjectIDList

public java.lang.String[] getObjectIDList()
Gets the column names of the table that are already set using setObjectIDList() or setTableOID().

Returns:
a single dimensional array of column OIDs.

setObjectIDList

public void setObjectIDList(java.lang.String[] columnNames)
Sets the column names of the table that needs to be polled. If table OID is set using setTableOID method,then all the columns will be polled. If the column names are set using this method,then only these columns will get polled.

Parameters:
columnNames - a single dimensional array of names of those columns that needs to be polled.

setTableOID

public void setTableOID(java.lang.String tableOID)
Sets the tableOID for the table

Parameters:
tableOID - ObjectID of the table.

setTableOIDWoStart

public void setTableOIDWoStart(java.lang.String tableOID)
Sets the tableOID for the table without starting the polling of table data.

Parameters:
tableOID - OID for the table

getTableOID

public java.lang.String getTableOID()
Gets the tableOID that is set in the TableBean instance.

Returns:
table OID

setPollInterval

public void setPollInterval(int i)
Sets the Poll Interval for the table

Parameters:
i - poll interval in seconds.

getPollInterval

public int getPollInterval()
Gets the Poll Interval in seconds.

Returns:
polling interval in seconds.

startPolling

public void startPolling()
Starts Polling the Table data.The poll interval can be set using setPollInterval() method.The Default poll interval value is 5 secs.

See Also:
setPollInterval(int i)

stopPolling

public void stopPolling()
Stops Polling the Table data.


setPort

public void setPort(int port)
Deprecated. .New method is setTargetPort


getPort

public int getPort()
Deprecated. .New method is setTargetPort


setTargetPort

public void setTargetPort(int port)
Sets the target port number for the table

Parameters:
port - agent port.

getTargetPort

public int getTargetPort()
Gets the agent port for the table

Returns:
agent port number

setTimeout

public void setTimeout(int timeout)
Sets the timeout for the table.Default timeout value is 5 seconds.

Parameters:
timeout - timeout in seconds

getTimeout

public int getTimeout()
Gets the timeout value for the table.Default is 5 seconds.

Returns:
the timeout value in seconds

setRetries

public void setRetries(int retries)
Sets the retries value for the table.Default value is 0.

Parameters:
retries - retries value

getRetries

public int getRetries()
Gets the retries value for the table.Default value is 0

Returns:
retries value

getSnmpVersion

public int getSnmpVersion()
v2c and v3 only Gets the SNMP Version. 0 for Version 1 which is the default, 1 for Version V2C and 3 for Version V3.

Returns:
SNMP version

setSnmpVersion

public void setSnmpVersion(int i)
v2c and v3 only Sets the SNMP Version. 0 for Version 1 which is the default, 1 for Version V2C and 3 for Version V3.

Parameters:
i - SNMP Version number

getContextName

public java.lang.String getContextName()
v3 only Gets the SNMP V3 Context name

Returns:
context name

setContextName

public void setContextName(java.lang.String cName)
v3 only Sets the SNMP V3 Context name

Parameters:
cName - context name

getContextID

public java.lang.String getContextID()
v3 only Gets the SNMP V3 contextID

Returns:
Context ID

setContextID

public void setContextID(java.lang.String ctxtID)
v3 only Sets the SNMP V3 contextID

Parameters:
ctxtID - Context ID

getSecurityModel

public int getSecurityModel()
v3 only Gets the SNMP V3 securityModel

Returns:
SecurityModel

setSecurityModel

public void setSecurityModel(int securityModel)
v3 only Sets the SNMP V3 SecurityModel

Parameters:
securityModel - SNMP V3 SecurityModel

getPrincipal

public java.lang.String getPrincipal()
v3 only Gets the SNMPv3 Principal

Returns:
principal

setPrincipal

public void setPrincipal(java.lang.String s)
v3 only Sets the SNMPv3 Principal

Parameters:
s - principal

getAuthProtocol

public int getAuthProtocol()
v3 only Gets the Snmpv3 AuthProtocol

Returns:
AuthProtocol

setAuthProtocol

public void setAuthProtocol(int protocol)
v3 only Sets the Snmpv3 AuthProtocol

Parameters:
protocol - AuthProtocol

getAuthPassword

public java.lang.String getAuthPassword()
v3 only Gets the Snmpv3 AuthPassword

Returns:
AuthPassword

setAuthPassword

public void setAuthPassword(java.lang.String key)
v3 only Sets the Snmpv3 AuthPassword

Parameters:
key - AuthPassword

getPrivPassword

public java.lang.String getPrivPassword()
v3 only Gets the Snmpv3 PrivPassword

Returns:
privPassword

setPrivPassword

public void setPrivPassword(java.lang.String key)
v3 only Sets the Snmpv3 PrivPassword

Parameters:
key - PrivPassword

create_v3_tables

public void create_v3_tables()
v3 only Creates the SNMPv3 tables for authentication and privacy


setFromUI

public void setFromUI(boolean flag)
Deprecated. . Not needed for API users.


setMibModules

public void setMibModules(java.lang.String mibs)
Sets the MIB files to be loaded.Multiple MIB files can be loaded by giving the MIB files as a white space seperated list of files.

Parameters:
mibs - name of the MibFiles with their entire path

getMibModules

public java.lang.String getMibModules()
Gets the MIB files that are loaded in the TableBean instance.

Returns:
MibModules

vetoableChange

public void vetoableChange(java.beans.PropertyChangeEvent e)
This method is called when a vetoableChangeEvent is fired from the PropertySetting bean. Creates new users if required.

Specified by:
vetoableChange in interface java.beans.VetoableChangeListener
Parameters:
e - an instance of PropertyChangeEvent

setSerializeMibs

public void setSerializeMibs(boolean flag)
Defines whether to serialize the MibModules or not. This flag should be set before loading the MIBs.If this is set to true it will serialize the loaded MIBs. For ex: if RMON2-MIB is loaded, it will serialize this module along with the Imported Modules viz ., RFC1271-MIB,RFC1213-MIB,TOKEN-RING-RMON and save it in a single file.The name of the serialized file can be set using the setSerializedMibFileName() method. In case,if serialized file name is not set,it will save the serialized file with the MIB file name along with ".ser" extension.Here, it will save it as RMON2-MIB.ser Serialization is not supported in applets.

Parameters:
flag - true to Serialize MIBFile and false otherwise

isSerializeMibs

public boolean isSerializeMibs()
Defines if the mibs will be serialized or not

Returns:
true if mibs will be serialized and false otherwise

setLoadFromSerializedMibs

public void setLoadFromSerializedMibs(boolean flag)
Defines whether to load MIBs from serialized file or not. This flag should be set before loading the MIBs.

Parameters:
flag - true to load from serialized mibs and false otherwise

setLoadFromCompiledMibs

public void setLoadFromCompiledMibs(boolean flag)
Defines whether to load mib from compiled MIBs. This flag should be set before loading the MIBs (By default it is set to false). If this flag is set to true, it will load from compiled file( i.e; .cmi and .cds files). For ex: RMON2-MIB is loaded, it will automatically load RMON2-MIB.cmi if it exists. otherwise it creates compiled files by parsing and then loads from it. If this flag is set to false, the mib is loaded without creating .cmi and .cds files. This is recommended in case of applets where you have security restrictions for file creation. This is slightly slower than loading from precompiled mibs. In Applets, precompiled mibs can be loaded but it cannot create/write compiled files.

If both loadFromSerializedMibs and loadFromCompiledMibs is set to true, it will just try to load the MIB as a serialized file.

Parameters:
flag - true to load from compiled mibs and false otherwise

setDebug

public void setDebug(boolean flag)
This method is used to enable or disable the debug option.The debug option will be enabled if this is set to true and will be disabled if this is set to false.


getDebug

public boolean getDebug()
Returns whether Debug option is enabled or not.

Returns:
true if debug mode is enabled and false if not enabled

setOverwriteCMI

public void setOverwriteCMI(boolean overWrite)
Defines whether to overwrite the existing compiled MIB files. NOTE: This applies only when the setLoadFromCompiledMibs is set to true.

Parameters:
overWrite - true to overwrite existing compiled mib file and false otherwise

setReadDesc

public void setReadDesc(boolean readFlag)
Sets the flag to read descriptions from compiled mib modules. Default is true. Set it to false if you don't need the descriptions. NOTE: This applies only when the setLoadFromCompiledMibs is set to true.

Parameters:
readFlag - true or false

isReadDesc

public boolean isReadDesc()
Defines if mib descriptions will be read from compiled mibs or not

Returns:
true if descriptions will be read and false otherwise

isLoadFromSerializedMibs

public boolean isLoadFromSerializedMibs()
Defines if mibs will be loaded from SerializedMibs or not

Returns:
true if mibs will be loaded from serialized mibs and false otherwise

isLoadFromCompiledMibs

public boolean isLoadFromCompiledMibs()
Defines if mibs will be loaded from CompiledMibs or not

Returns:
true if mib file will be loaded from Compiled mibs and false otherwise

getOverwriteCMI

public boolean getOverwriteCMI()
Defines whether the compiled mibs will be overwritten or not NOTE: This applies only when the setLoadFromCompiledMibs is set to true.

Returns:
true if the Compiled mib file will be overwritten and false otherwise

setSerializedMibFileName

public void setSerializedMibFileName(java.lang.String serFileName)
Defines the name of the MIB File to be serialized. The Serialized file will be saved with this filename in the directory from which the mib is loaded.

Parameters:
serFileName - name of the file

getSerializedMibFileName

public java.lang.String getSerializedMibFileName()
Gets the name of the Serialized Mib file

Returns:
the name of the serialized mib file

setModel1

protected void setModel1(javax.swing.table.TableModel newModel)

refreshTable

public void refreshTable()
Refreshes the Table data


editHeader

public void editHeader(int index,
                       java.lang.String newValue)
Edit/change the name of the column header represented by the index,with a new Value.

Parameters:
index - the column index whose name has to be changed
newValue - changed new column name

setMibPath

public void setMibPath(java.lang.String path)
Sets the search Path in which the Mib Parser will search for the MIB modules. Multiple paths can be specified using the pipe (|) as a separator.


getMibPath

public java.lang.String getMibPath()
Gets the search Path in which the Mib Parser will search for the MIB modules.

Returns:
String containing the path which will be searched for the MIBs. null if the searchPath has not been set previously.


Copyright (c)ZOHO Corp. 1996-2012