|
||||||||||
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.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.
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
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.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 | |
SnmpTablePanel()
Use this contructor for Applications |
|
SnmpTablePanel(java.applet.Applet applet)
Use this contructor for Applets |
Method Summary | |
void |
create_v3_tables()
![]() |
java.lang.String |
getAuthPassword()
![]() |
int |
getAuthProtocol()
![]() |
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()
![]() |
java.lang.String |
getContextName()
![]() |
boolean |
getMenuStatus()
Gets the status of 'Right Click' menu of SnmpTable |
java.lang.String |
getMibModules()
Gets the mibmodules that are loaded in the SnmpTablePanel instance. |
com.adventnet.snmp.ui.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()
![]() |
java.lang.String |
getPrivPassword()
![]() |
int |
getRetries()
Gets the SNMP target retries value. |
java.lang.String |
getSerializedMibFileName()
Gets the name of the Serialized MIB file. |
SnmpEngineTable |
getSnmpEngineTable()
![]() |
SnmpTable |
getSnmpTable()
Gets the reference to SnmpTable |
int |
getSnmpVersion()
![]() |
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()
![]() |
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()
![]() |
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. |
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()
![]() |
boolean |
isSerializeMibs()
Gets whether the MIBs are serialized or not. |
boolean |
isV3DatabaseFlag()
![]() |
void |
loadMibs(java.lang.String mibs)
Loads the mibs specified by white-space separated list of mibs. |
void |
removeAll()
Stops polling and removes all the components. |
void |
setAugmentedDisplay(boolean isAugmented)
![]() |
void |
setAuthPassword(java.lang.String authPasswd)
![]() |
void |
setAuthProtocol(int 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)
![]() |
void |
setContextName(java.lang.String contextName)
![]() |
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. |
void |
setEngineID(byte[] 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 |
setMenuStatus(boolean status)
Sets the status of 'Right Click' of SnmpTable. |
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)
![]() |
void |
setPrivPassword(java.lang.String privpasswd)
![]() |
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)
![]() |
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)
![]() |
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)
![]() |
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 |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, 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, 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, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, 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, doLayout, 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, 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 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 com.adventnet.snmp.ui.SnmpTablePanelModel getModel()
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[] 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.
MibException
- is thrown upon mib parse errors.
java.io.IOException
- is thrown upon IO errors.
java.io.FileNotFoundException
- is thrown if the file is not found.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
DataException
- is thrown if data is invalidpublic 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)
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)
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)
public boolean isSerializeMibs()
public void setLoadFromSerializedMibs(boolean isFromSerializedMibs)
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.
public 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)
public void setSerializedMibFileName(java.lang.String serialMibName)
serialMibName
- the name of the serialized MIB file.public java.lang.String getSerializedMibFileName()
public void setMenuStatus(boolean status)
public boolean getMenuStatus()
public void removeAll()
removeAll
in class java.awt.Container
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |