|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JTable | +--com.adventnet.snmp.ui.TableBean
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);
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()
![]() |
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()
![]() |
int |
getAuthProtocol()
![]() |
java.lang.String |
getCharacterEncoding()
Gets the Character Encoding being used. |
java.lang.String |
getCommunity()
Gets the community name. |
java.lang.String |
getContextID()
![]() |
java.lang.String |
getContextName()
![]() |
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()
![]() |
java.lang.String |
getPrivPassword()
![]() |
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()
![]() |
java.lang.String |
getSerializedMibFileName()
Gets the name of the Serialized Mib file |
SnmpEngineTable |
getSnmpEngineTable()
![]() |
SnmpTableModel |
getSnmpTableModel()
Gets an instance of SnmpTableModel which handles processing of SNMP tables. |
int |
getSnmpVersion()
![]() |
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()
![]() |
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()
![]() |
void |
refreshTable()
Refreshes the Table data |
void |
setAuthPassword(java.lang.String key)
![]() |
void |
setAuthProtocol(int protocol)
![]() |
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)
![]() |
void |
setContextName(java.lang.String cName)
![]() |
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)
![]() |
void |
setPrivPassword(java.lang.String key)
![]() |
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)
![]() |
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)
![]() |
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)
![]() |
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 |
public TableBean()
public TableBean(java.applet.Applet applet)
Method Detail |
public SnmpEngineTable getSnmpEngineTable()
public USMUserTable getUSMTable()
public SnmpTableModel getSnmpTableModel()
public void setParams(java.lang.String host, java.lang.String mib, java.lang.String tableOID)
host
- target host or IpAddressmib
- mib file to be loaded in the TableBean instance.tableOID
- OID of the tablepublic void setHost(java.lang.String host)
public void setTargetHost(java.lang.String host)
host
- agent name or IpAddress in String format.public void initJdbcParams(java.lang.String driverName, java.lang.String URL, java.lang.String userName, java.lang.String passWord)
driverName
- the name of the driver to be used.URL
- URL pointing to the DataBase file nameuserName
- userNamepassWord
- passwordpublic void setLoadMibsFromDatabase(boolean flag)
flag
- true to load MIBs from database and false otherwiseinitJdbcParams(String driverName,String URL, String userName, String passWord)
public void setOverwriteMibsInDatabase(boolean overWrite)
overWrite
- true to overwrite the MIB in the database and false
otherwise.public boolean isOverwriteMibsInDatabase()
public boolean isLoadMibsFromDatabase()
public boolean isV3DatabaseFlag()
public void setV3DatabaseFlag(boolean v3Flag)
v3Flag
- true to set the V3 database flag and false otherwise.public void setCharacterEncoding(java.lang.String enc)
enc
- The name of a character encoding. All the string encoding
will be done base on this encoding.public java.lang.String getCharacterEncoding()
public java.lang.String getHost()
public java.lang.String getTargetHost()
public void setCommunity(java.lang.String community)
community
- community namepublic boolean getRetrievalMode()
public void setRetrievalMode(boolean mode)
mode
- true to retrieve the table using GetNext and false to retrieve
the table using GetBulk.public void setColumnsPolled(java.util.Vector v)
v
- vector of column indices that need to be polled.public java.lang.String getCommunity()
public java.lang.String[] getObjectIDList()
public void setObjectIDList(java.lang.String[] columnNames)
columnNames
- a single dimensional array of names of those columns
that needs to be polled.public void setTableOID(java.lang.String tableOID)
tableOID
- ObjectID of the table.public void setTableOIDWoStart(java.lang.String tableOID)
tableOID
- OID for the tablepublic java.lang.String getTableOID()
public void setPollInterval(int i)
i
- poll interval in seconds.public int getPollInterval()
public void startPolling()
setPollInterval(int i)
public void stopPolling()
public void setPort(int port)
public int getPort()
public void setTargetPort(int port)
port
- agent port.public int getTargetPort()
public void setTimeout(int timeout)
timeout
- timeout in secondspublic int getTimeout()
public void setRetries(int retries)
retries
- retries valuepublic int getRetries()
public int getSnmpVersion()
public void setSnmpVersion(int i)
i
- SNMP Version numberpublic java.lang.String getContextName()
public void setContextName(java.lang.String cName)
cName
- context namepublic java.lang.String getContextID()
public void setContextID(java.lang.String ctxtID)
ctxtID
- Context IDpublic int getSecurityModel()
public void setSecurityModel(int securityModel)
securityModel
- SNMP V3 SecurityModelpublic java.lang.String getPrincipal()
public void setPrincipal(java.lang.String s)
s
- principalpublic int getAuthProtocol()
public void setAuthProtocol(int protocol)
protocol
- AuthProtocolpublic java.lang.String getAuthPassword()
public void setAuthPassword(java.lang.String key)
key
- AuthPasswordpublic java.lang.String getPrivPassword()
public void setPrivPassword(java.lang.String key)
key
- PrivPasswordpublic void create_v3_tables()
public void setFromUI(boolean flag)
public void setMibModules(java.lang.String mibs)
mibs
- name of the MibFiles with their entire pathpublic java.lang.String getMibModules()
public void vetoableChange(java.beans.PropertyChangeEvent e)
vetoableChange
in interface java.beans.VetoableChangeListener
e
- an instance of PropertyChangeEventpublic void setSerializeMibs(boolean flag)
flag
- true to Serialize MIBFile and false otherwisepublic boolean isSerializeMibs()
public void setLoadFromSerializedMibs(boolean flag)
flag
- true to load from serialized mibs and false otherwisepublic void setLoadFromCompiledMibs(boolean flag)
If both loadFromSerializedMibs and loadFromCompiledMibs is set to true, it will just try to load the MIB as a serialized file.
flag
- true to load from compiled mibs and false otherwisepublic void setDebug(boolean flag)
public boolean getDebug()
public void setOverwriteCMI(boolean overWrite)
overWrite
- true to overwrite existing compiled mib file and false otherwisepublic void setReadDesc(boolean readFlag)
readFlag
- true or falsepublic boolean isReadDesc()
public boolean isLoadFromSerializedMibs()
public boolean isLoadFromCompiledMibs()
public boolean getOverwriteCMI()
public void setSerializedMibFileName(java.lang.String serFileName)
serFileName
- name of the filepublic java.lang.String getSerializedMibFileName()
protected void setModel1(javax.swing.table.TableModel newModel)
public void refreshTable()
public void editHeader(int index, java.lang.String newValue)
index
- the column index whose name has to be changednewValue
- changed new column namepublic void setMibPath(java.lang.String path)
public java.lang.String getMibPath()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |