|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | 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);
| Inner classes inherited from class javax.swing.JTable |
javax.swing.JTable.AccessibleJTable |
| Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent,
javax.swing.JComponent.IntVector,
javax.swing.JComponent.KeyboardBinding,
javax.swing.JComponent.KeyboardState |
| Inner classes inherited from class java.awt.Component |
java.awt.Component.AWTTreeLock |
| Field Summary | |
(package private) java.lang.String |
authPassword
|
(package private) int |
authProtocol
|
(package private) java.lang.String[] |
columns
|
(package private) java.lang.String |
community
|
(package private) byte[] |
contextID
|
(package private) java.lang.String |
contextName
|
(package private) SnmpTableModel |
dataTable
|
(package private) java.lang.String |
host
|
(package private) boolean |
isFromUI
|
(package private) java.lang.String |
mibs
|
(package private) boolean |
model_flag
|
(package private) int |
port
|
(package private) java.lang.String |
principal
|
(package private) java.lang.String |
privPassword
|
(package private) int |
retries
|
(package private) int |
secModel
|
(package private) java.lang.String |
tableOID
|
(package private) int |
timeout
|
(package private) int |
version
|
| 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 |
_bounds,
accessibleContext,
listenerList,
paintingChild,
TOOL_TIP_TEXT_KEY,
ui,
UNDEFINED_CONDITION,
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
WHEN_FOCUSED,
WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Container |
component,
containerListener,
layoutMgr,
ncomponents |
| Fields inherited from class java.awt.Component |
actionListenerK,
adjustmentListenerK,
appContext,
background,
BOTTOM_ALIGNMENT,
CENTER_ALIGNMENT,
componentListener,
componentListenerK,
componentOrientation,
containerListenerK,
cursor,
dropTarget,
enabled,
eventMask,
focusListener,
focusListenerK,
font,
foreground,
hasFocus,
height,
incRate,
inputMethodListener,
inputMethodListenerK,
isInc,
isPacked,
itemListenerK,
keyListener,
keyListenerK,
LEFT_ALIGNMENT,
locale,
LOCK,
minSize,
mouseListener,
mouseListenerK,
mouseMotionListener,
mouseMotionListenerK,
newEventsOnly,
ownedWindowK,
parent,
peer,
peerFont,
popups,
prefSize,
RIGHT_ALIGNMENT,
textListenerK,
TOP_ALIGNMENT,
valid,
visible,
width,
windowListenerK,
x,
y |
| Constructor Summary | |
TableBean()
Use this constructor for Applications |
|
TableBean(java.applet.Applet applet)
Use this constructor for Applets |
|
| Method Summary | |
void |
create_v3_tables()
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()
Gets the Snmpv3 AuthPassword |
int |
getAuthProtocol()
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()
Gets the SNMP V3 contextID |
java.lang.String |
getContextName()
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()
Gets the SNMPv3 Principal |
java.lang.String |
getPrivPassword()
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()
Gets the SNMP V3 securityModel |
java.lang.String |
getSerializedMibFileName()
Gets the name of the Serialized Mib file |
SnmpEngineTable |
getSnmpEngineTable()
Gets a reference for SnmpEngineTable |
SnmpTableModel |
getSnmpTableModel()
Gets an instance of SnmpTableModel which handles processing of SNMP tables. |
int |
getSnmpVersion()
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()
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()
Defines whether V3 database flag is set or not. |
(package private) void |
logErrorMessage(java.lang.String error)
All the methods of this class or any sub class, which needs to redirect an error message to the LogManger or to the standard console, can use this method. |
(package private) void |
logInfoMessage(java.lang.String info)
All the methods of this class or any sub class, which needs to redirect an info message to the LogManger or to the standard console, can use this method. |
void |
refreshTable()
Refreshes the Table data |
void |
setAuthPassword(java.lang.String key)
Sets the Snmpv3 AuthPassword |
void |
setAuthProtocol(int protocol)
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)
Sets the SNMP V3 contextID |
void |
setContextName(java.lang.String cName)
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)
Sets the SNMPv3 Principal |
void |
setPrivPassword(java.lang.String key)
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)
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)
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)
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,
clearSelection,
columnAdded,
columnAtPoint,
columnMarginChanged,
columnMoved,
columnRemoved,
columnSelectionChanged,
configureEnclosingScrollPane,
convertColumnIndexToModel,
convertColumnIndexToView,
createDefaultColumnModel,
createDefaultColumnsFromModel,
createDefaultDataModel,
createDefaultEditors,
createDefaultRenderers,
createDefaultSelectionModel,
createDefaultTableHeader,
createScrollPaneForTable,
editCellAt,
editCellAt,
editingCanceled,
editingStopped,
getAccessibleContext,
getAutoCreateColumnsFromModel,
getAutoResizeMode,
getCellEditor,
getCellEditor,
getCellRect,
getCellRenderer,
getCellSelectionEnabled,
getColumn,
getColumnClass,
getColumnCount,
getColumnModel,
getColumnName,
getColumnSelectionAllowed,
getDefaultEditor,
getDefaultRenderer,
getEditingColumn,
getEditingRow,
getEditorComponent,
getGridColor,
getIntercellSpacing,
getModel,
getPreferredScrollableViewportSize,
getRowCount,
getRowHeight,
getRowMargin,
getRowSelectionAllowed,
getScrollableBlockIncrement,
getScrollableTracksViewportHeight,
getScrollableTracksViewportWidth,
getScrollableUnitIncrement,
getSelectedColumn,
getSelectedColumnCount,
getSelectedColumns,
getSelectedRow,
getSelectedRowCount,
getSelectedRows,
getSelectionBackground,
getSelectionForeground,
getSelectionModel,
getShowHorizontalLines,
getShowVerticalLines,
getTableHeader,
getToolTipText,
getUI,
getUIClassID,
getValueAt,
initializeLocalVars,
isCellEditable,
isCellSelected,
isColumnSelected,
isEditing,
isManagingFocus,
isRowSelected,
moveColumn,
paramString,
prepareEditor,
prepareRenderer,
removeColumn,
removeColumnSelectionInterval,
removeEditor,
removeRowSelectionInterval,
reshape,
resizeAndRepaint,
rowAtPoint,
selectAll,
setAutoCreateColumnsFromModel,
setAutoResizeMode,
setCellEditor,
setCellSelectionEnabled,
setColumnModel,
setColumnSelectionAllowed,
setColumnSelectionInterval,
setDefaultEditor,
setDefaultRenderer,
setEditingColumn,
setEditingRow,
setGridColor,
setIntercellSpacing,
setModel,
setPreferredScrollableViewportSize,
setRowHeight,
setRowMargin,
setRowSelectionAllowed,
setRowSelectionInterval,
setSelectionBackground,
setSelectionForeground,
setSelectionMode,
setSelectionModel,
setShowGrid,
setShowHorizontalLines,
setShowVerticalLines,
setTableHeader,
setUI,
setValueAt,
sizeColumnsToFit,
sizeColumnsToFit,
tableChanged,
updateUI,
valueChanged |
| Methods inherited from class javax.swing.JComponent |
_paintImmediately,
|
| Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
applyOrientation,
countComponents,
deliverEvent,
dispatchEventImpl,
dispatchEventToSelf,
doLayout,
eventEnabled,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents_NoClientCode,
getComponents,
getCursorTarget,
getLayout,
getMouseEventTarget,
getWindow,
insets,
invalidate,
invalidateTree,
isAncestorOf,
layout,
lightweightPrint,
list,
list,
locate,
minimumSize,
nextFocus,
paintComponents,
postProcessKeyEvent,
postsOldMouseEvents,
preferredSize,
preProcessKeyEvent,
printComponents,
printHeavyweightComponents,
processContainerEvent,
processEvent,
proxyEnableEvents,
proxyRequestFocus,
remove,
remove,
removeAll,
removeContainerListener,
setCursor,
setFocusOwner,
setLayout,
transferFocus,
updateCursor,
validate,
validateTree |
| Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
areInputMethodsEnabled,
bounds,
checkImage,
checkImage,
coalesceEvents,
constructComponentName,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont_NoClientCode,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getIntrinsicCursor,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getNativeContainer,
getParent_NoClientCode,
getParent,
getPeer,
getSize,
getToolkit,
getToolkitImpl,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isEnabledImpl,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
processComponentEvent,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
java.lang.String[] columns
SnmpTableModel dataTable
boolean model_flag
boolean isFromUI
java.lang.String host
java.lang.String community
java.lang.String mibs
java.lang.String tableOID
java.lang.String contextName
byte[] contextID
int secModel
java.lang.String principal
java.lang.String authPassword
java.lang.String privPassword
int authProtocol
int version
int port
int retries
int timeout
| 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)
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)
true - to enable the debug option and false to disable.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)
searchPath - String specifying the search path, for multiple
paths separate the paths by the pipe (|) symbol.public java.lang.String getMibPath()
void logErrorMessage(java.lang.String error)
void logInfoMessage(java.lang.String info)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||