|
|||||||||
| 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.JPanel
|
+--com.adventnet.snmp.ui.SnmpTablePanel
The SnmpTable class handles polling for SNMP tables. It has been designed to support the Model/View/Controller design of JFC/swing applications To use the table class, instantiate, and identify the SNMP table to be used. Then perform operations on the table, or register for table change events. For example,
SnmpTablePanel table = new SnmpTablePanel();
table.setTargetHost( "localhost" ); // set the agent hostname
table.loadMibs("rfc1213-mib"); // load MIBs
table.setTableOID("ifTable"); // this starts polling of table data
The resources used by this class are automatically garbage collected. No need to close sessions, or other cleanup by the user.
See the largetable.java application example in the uiapplications directory for an example.
| Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| 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.applet.Applet |
applet
|
(package private) boolean |
isDefaultTableModel
|
(package private) SnmpTablePanelModel |
tablebeanmodel
|
(package private) SnmpTablePanelUI |
tablebeanui
VARIABLE DECLARATION |
| 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 | |
SnmpTablePanel()
Use this contructor for Applications |
|
SnmpTablePanel(java.applet.Applet applet)
Use this contructor for Applets |
|
| Method Summary | |
void |
create_v3_tables()
Creates the SNMPv3 tables for authentication and privacy. |
java.lang.String |
getAuthPassword()
Gets the SNMP V3 AuthPassword |
int |
getAuthProtocol()
Gets the SNMP V3 AuthProtocol |
java.lang.String |
getCharacterEncoding()
Gets the Character Encoding that is being used. |
java.lang.String[] |
getColumnNames()
Gets the names of the columns in the table. |
java.lang.String |
getCommunity()
Gets the SNMP target Community |
java.lang.String |
getContextID()
Gets the SNMP V3 contextID. |
java.lang.String |
getContextName()
Gets the SNMP V3 Context name |
java.lang.String |
getMibModules()
Gets the mibmodules that are loaded in the SnmpTablePanel instance. |
SnmpTablePanelModel |
getModel()
Gets the SnmpTablePanelModel instance. |
java.lang.String[] |
getObjectIDList()
Gets the list of object IDs that is previously set. |
boolean |
getOverwriteCMI()
Gets whether the existing compiled mib files will be overwritten or not. |
java.lang.String |
getPrincipal()
Gets the SNMP Principal |
java.lang.String |
getPrivPassword()
Gets the SNMP V3 PrivPassword |
int |
getRetries()
Gets the SNMP target retries value. |
java.lang.String |
getSerializedMibFileName()
Gets the name of the Serialized MIB file. |
SnmpEngineTable |
getSnmpEngineTable()
Gets the reference to SnmpEngineTable |
SnmpTable |
getSnmpTable()
Gets the reference to SnmpTable |
int |
getSnmpVersion()
Gets the SNMP target SNMP Version. |
java.lang.String |
getTableOID()
Gets the table OID. |
int |
getTableViewColumnCount()
Gets the number of columns that are visible in the Table. |
int |
getTableViewRowCount()
Gets the number of rows that are visible in Table. |
java.lang.String |
getTargetHost()
Gets the SNMP target hostname or IpAddress. |
int |
getTargetPort()
Gets the SNMP target port number |
int |
getTimeout()
Gets the SNMP target timeout value |
USMUserTable |
getUSMTable()
Gets the reference to USMUserTable |
java.lang.String |
getWriteCommunity()
Gets the SNMP target write Community to be used for set requests |
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 when database support is needed for mibs. |
boolean |
isAugmentedDisplay()
Determines the status whether the table displayed is the actual table or its augmented table. |
boolean |
isCustomPanel()
Determines whether the custom panel is visible or not.By default the custom panel will be visible and so this will return true. |
(package private) boolean |
isDefaultTableModel()
Determines whether the default table model is set for the table or not |
boolean |
isLoadFromCompiledMibs()
Determines whether the mibs will be loaded from CompiledMib files or not. |
boolean |
isLoadFromSerializedMibs()
Determines whether the mibs will be loaded from serialized file or not. |
boolean |
isLoadMibsFromDatabase()
Determines whether the mib will be loaded from database files or not. |
boolean |
isOverwriteMibsInDatabase()
Determines whether the MIBs in database will be overwritten or not. |
boolean |
isReadDesc()
Determines whether reading descriptions from compiled modules is enabled or not. |
boolean |
isRetrievalMode()
Checks whether the mode of retrieval of rows is get_next or get_bulk. |
boolean |
isSerializeMibs()
Gets whether the MIBs are serialized or not. |
boolean |
isV3DatabaseFlag()
Determines whether the V3 database flag is set or not. |
void |
loadMibs(java.lang.String mibs)
Loads the mibs specified by white-space separated list of mibs. |
(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 |
removeAll()
Stops polling and removes all the components. |
void |
setAugmentedDisplay(boolean isAugmented)
Sets the status of the table.Set this to true if the table to be displayed is the Augmented table and false if the table to be displayed is the actual table whose oid is specified by the setTableOID() method. |
void |
setAuthPassword(java.lang.String authPasswd)
Sets the SNMP V3 AuthPassword. |
void |
setAuthProtocol(int authProtocol)
Sets the SNMP V3 AuthProtocol. |
void |
setCharacterEncoding(java.lang.String enc)
Sets the Character Encoding to be used. |
void |
setColumnNames(java.lang.String[] names)
Sets the names of the columns in the table. |
void |
setCommunity(java.lang.String c)
Sets the SNMP target Community. |
void |
setContextID(java.lang.String contextID)
Sets the SNMP V3 contextID. |
void |
setContextName(java.lang.String contextName)
Sets the SNMP V3 Context name |
void |
setCustomPanel(boolean isCustomPanel)
Decides whether the custom panel should be visible or not.The custom panel will be visible if this is set to true and invisible if this is set to false. |
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. |
(package private) void |
setDefaultTableModel(boolean isDefault)
Sets the default table model to be set for the table. |
void |
setEngineID(byte[] EngineID)
Sets the SNMP V3 engineID. |
void |
setLoadFromCompiledMibs(boolean isFromCompiledMibs)
Defines whether to load mib from compiled MIBs. |
void |
setLoadFromSerializedMibs(boolean isFromSerializedMibs)
Determines whether to load MIBs from serialized file or not. |
void |
setLoadMibsFromDatabase(boolean flag)
Determines whether to load mib from DataBase or not. |
void |
setMibModules(java.lang.String mibs)
Sets the SNMP mibmodules to be loaded in the SnmpTablePanel instance. |
void |
setObjectIDList(java.lang.String[] s)
Sets a list of object IDs 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 |
setPrincipal(java.lang.String principal)
Sets the SNMP Principal |
void |
setPrivPassword(java.lang.String privpasswd)
Sets the SNMP V3 PrivPassword |
void |
setReadDesc(boolean readFlag)
Sets the flag to read descriptions from compiled mib modules. |
void |
setRetries(int retries)
Sets the SNMP target retries value. |
void |
setRetrievalMode(boolean retrievalMode)
Sets the mode of retrieval of rows.Set this to true to retrieve the table rows using GetNext and set this to false to retrieve the table rows using GetBulk.By default GetNext is used for retrieval. |
void |
setSerializedMibFileName(java.lang.String serialMibName)
Sets the name of the Serialized MIB File for saving. |
void |
setSerializeMibs(boolean isSerialize)
Defines whether to serialize the MibModule or not. |
void |
setSnmpVersion(int version)
Sets the SNMP target SNMP Version. |
(package private) void |
setTableModel(SnmpTablePanelModel model)
Sets the tabel model for the table. |
void |
setTableOID(java.lang.String tableoid)
Sets the table OID that is to be used with this SnmpTablePanel instance. |
void |
setTableViewColumnCount(int viewColumns)
Sets the number of columns that should be visible in the Table. |
void |
setTableViewRowCount(int viewRows)
Sets the number of rows that should be visible in Table. |
void |
setTargetHost(java.lang.String host)
Sets the SNMP target hostname or the target IPAddress. |
void |
setTargetPort(int port)
Sets the SNMP target port number |
void |
setTimeout(int timeout)
Sets the SNMP target timeout value.By Default the timeout value is 5 secs. |
void |
setV3DatabaseFlag(boolean v3Flag)
Sets the V3 database flag.This method can be used if you need to use database support for V3.Setting this to true will set the database flag and setting this to false will reset the flag. |
void |
setWriteCommunity(java.lang.String wcommunity)
Sets the SNMP target write Community to be used for set requests |
void |
startPoll()
Starts Polling the table data |
void |
stopPoll()
Stops Polling the table data |
| Methods inherited from class javax.swing.JPanel |
|
| Methods inherited from class javax.swing.JComponent |
_paintImmediately,
addAncestorListener,
addNotify,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
alwaysOnTop,
bindingForKeyStroke,
checkIfChildObscuredBySibling,
computeVisibleRect,
computeVisibleRect,
contains,
createToolTip,
enableSerialization,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paint,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
print,
printAll,
processComponentKeyEvent,
processFocusEvent,
processKeyBinding,
processKeyBindings,
processKeyBindingsForAllComponents,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
rectangleIsObscured,
rectangleIsObscuredBySibling,
registerKeyboardAction,
registerKeyboardAction,
registerWithKeyboardManager,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPaintingChild,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
shouldDebugGraphics,
superProcessMouseMotionEvent,
unregisterKeyboardAction,
unregisterWithKeyboardManager,
update |
| 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,
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 |
SnmpTablePanelUI tablebeanui
SnmpTablePanelModel tablebeanmodel
java.applet.Applet applet
boolean isDefaultTableModel
| Constructor Detail |
public SnmpTablePanel()
public SnmpTablePanel(java.applet.Applet applet)
| Method Detail |
public void stopPoll()
public void startPoll()
public void setCustomPanel(boolean isCustomPanel)
isCustomPanel - true or false.public boolean isCustomPanel()
public USMUserTable getUSMTable()
public SnmpEngineTable getSnmpEngineTable()
public SnmpTable getSnmpTable()
public SnmpTablePanelModel getModel()
boolean isDefaultTableModel()
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()
void setDefaultTableModel(boolean isDefault)
void setTableModel(SnmpTablePanelModel model)
public java.lang.String[] getColumnNames()
public void setColumnNames(java.lang.String[] names)
names - a single dimensional array of column names.public void setTargetHost(java.lang.String host)
host - the host name or the IpAddress in String format.public java.lang.String getTargetHost()
public void loadMibs(java.lang.String mibs)
throws MibException,
java.io.IOException,
java.io.FileNotFoundException
mibs - white space seperated list of mib files.
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 or false.initJdbcParams(String driverName,String URL, String userName, String passWord)public void setOverwriteMibsInDatabase(boolean overWrite)
overWrite - true to overwrite the MIBs 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 database flag and false otherwise.public void setCommunity(java.lang.String c)
c - community to be set.public java.lang.String getCommunity()
public java.lang.String getTableOID()
public void setTableOID(java.lang.String tableoid)
throws DataException
tableOID - ObjectID of the table.public java.lang.String[] getObjectIDList()
public void setObjectIDList(java.lang.String[] s)
s - String array of Object IDs to be set.public int getTableViewColumnCount()
public void setTableViewColumnCount(int viewColumns)
viewColumns - number of columns that should be visible.public int getTableViewRowCount()
public void setTableViewRowCount(int viewRows)
viewRows - number of rows that should be visible.public void setAugmentedDisplay(boolean isAugmented)
true - if the table to be displayed is the Augmented table and
false if the table to be displayed is the original table.public boolean isAugmentedDisplay()
public boolean isRetrievalMode()
public void setRetrievalMode(boolean retrievalMode)
retrievalMode - true to set the mode to get_next and
false to set it to get_bulk.public int getTargetPort()
public void setTargetPort(int port)
port - the port number to be set.public java.lang.String getMibModules()
public void setMibModules(java.lang.String mibs)
mibs - a white space seperated list of mib modules.public java.lang.String getWriteCommunity()
public void setWriteCommunity(java.lang.String wcommunity)
wcommunity - the write community.public int getTimeout()
public void setTimeout(int timeout)
timeout - the timeout value.public int getRetries()
public void setRetries(int retries)
retries - the retries value.public int getSnmpVersion()
public void setSnmpVersion(int version)
version - the SNMP version number to be set.public java.lang.String getContextName()
public void setContextName(java.lang.String contextName)
contextName - the contextName to be set.public java.lang.String getContextID()
public void setContextID(java.lang.String contextID)
contextID - the contextID to be set.public void setEngineID(byte[] EngineID)
engineID - the engineID to be set.public java.lang.String getPrincipal()
public void setPrincipal(java.lang.String principal)
principal - the SNMP principal.public int getAuthProtocol()
public void setAuthProtocol(int authProtocol)
authProtocol - the SNMP V3 AuthProtocol.public java.lang.String getAuthPassword()
public void setAuthPassword(java.lang.String authPasswd)
authPasswd - the SNMP V3 AuthPassword.public java.lang.String getPrivPassword()
public void setPrivPassword(java.lang.String privpasswd)
privpasswd - the SNMP V3 PrivPassword.public void create_v3_tables()
public void setSerializeMibs(boolean isSerialize)
true - to serialize the mib files and false otherwise.public boolean isSerializeMibs()
public void setLoadFromSerializedMibs(boolean isFromSerializedMibs)
true - to load MIBs from serialized file and false if it should
not be loaded from serialized files.public void setLoadFromCompiledMibs(boolean isFromCompiledMibs)
If both loadFromSerializedMibs and loadFromCompiledMibs is set to true, it will just try to load the MIB as a serialized file.
flag - true or falsepublic void setOverwriteCMI(boolean overWrite)
overWrite - true to overwrite the existing compiled mibs
and false if not.public boolean getOverwriteCMI()
public void setReadDesc(boolean readFlag)
readFlag - true to read descriptions from compiled mib files and
false otherwise.public boolean isReadDesc()
public boolean isLoadFromSerializedMibs()
public boolean isLoadFromCompiledMibs()
public void setDebug(boolean flag)
true - to enable the debug option and false to disable.public void setSerializedMibFileName(java.lang.String serialMibName)
serialMibName - the name of the serialized MIB file.public java.lang.String getSerializedMibFileName()
public void removeAll()
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 | ||||||||