com.adventnet.snmp.ui
Class SnmpTablePanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.adventnet.snmp.ui.SnmpTablePanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class SnmpTablePanel
extends javax.swing.JPanel

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.

See Also:
Serialized Form

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()
          v3 only Creates the SNMPv3 tables for authentication and privacy.
 java.lang.String getAuthPassword()
          v3 only Gets the SNMP V3 AuthPassword
 int getAuthProtocol()
          v3 only 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()
          v3 only Gets the SNMP V3 contextID.
 java.lang.String getContextName()
          v3 only Gets the SNMP V3 Context name
 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()
          v3 only Gets the SNMP Principal
 java.lang.String getPrivPassword()
          v3 only 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()
          v3 only Gets the reference to SnmpEngineTable
 SnmpTable getSnmpTable()
          Gets the reference to SnmpTable
 int getSnmpVersion()
          v3 only 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()
          v3 only 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()
          v2c and v3 only 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.
 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()
          v2c and v3 only 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()
          v3 only 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.
 void removeAll()
          Stops polling and removes all the components.
 void setAugmentedDisplay(boolean isAugmented)
          v2c and v3 only 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)
          v3 only Sets the SNMP V3 AuthPassword.
 void setAuthProtocol(int authProtocol)
          v3 only 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)
          v3 only Sets the SNMP V3 contextID.
 void setContextName(java.lang.String contextName)
          v3 only 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.
 void setEngineID(byte[] EngineID)
          v3 only 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 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)
          v3 only Sets the SNMP Principal
 void setPrivPassword(java.lang.String privpasswd)
          v3 only 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)
          v2c and v3 only 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)
          v3 only Sets the SNMP target SNMP 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)
          v3 only 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
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

SnmpTablePanel

public SnmpTablePanel()
Use this contructor for Applications


SnmpTablePanel

public SnmpTablePanel(java.applet.Applet applet)
Use this contructor for Applets

Method Detail

stopPoll

public void stopPoll()
Stops Polling the table data


startPoll

public void startPoll()
Starts Polling the table data


setCustomPanel

public 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. By default this is true.

Parameters:
isCustomPanel - true or false.

isCustomPanel

public 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.

Returns:
true if the custom panel is visible and false otherwise.

getUSMTable

public USMUserTable getUSMTable()
v3 only Gets the reference to USMUserTable

Returns:
the reference to USMUserTable

getSnmpEngineTable

public SnmpEngineTable getSnmpEngineTable()
v3 only Gets the reference to SnmpEngineTable

Returns:
the reference to SnmpEngineTable

getSnmpTable

public SnmpTable getSnmpTable()
Gets the reference to SnmpTable

Returns:
the reference to SnmpTable

getModel

public com.adventnet.snmp.ui.SnmpTablePanelModel getModel()
Gets the SnmpTablePanelModel instance.

Returns:
an instance of SnmpTablePanelModel.

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 that is 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.

getColumnNames

public java.lang.String[] getColumnNames()
Gets the names of the columns in the table.

Returns:
a string array of column names.

setColumnNames

public void setColumnNames(java.lang.String[] names)
Sets the names of the columns in the table.

Parameters:
names - a single dimensional array of column names.

setTargetHost

public void setTargetHost(java.lang.String host)
Sets the SNMP target hostname or the target IPAddress.

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

getTargetHost

public java.lang.String getTargetHost()
Gets the SNMP target hostname or IpAddress.

Returns:
the host name or the IpAddress in String format.

loadMibs

public void loadMibs(java.lang.String mibs)
              throws MibException,
                     java.io.IOException,
                     java.io.FileNotFoundException
Loads the mibs specified by white-space separated list of mibs. If first SnmpTarget has been opened with applet parameter, then URLs will be used.The mib files loaded in a single bean instance will be available across all beans in this package, across the VM.

Parameters:
mibs - white space seperated list of mib files.
Throws:
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.

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 when database support is needed 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)
Determines 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 or false.
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 MIBs in the database and false otherwise.

isOverwriteMibsInDatabase

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

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

isLoadMibsFromDatabase

public boolean isLoadMibsFromDatabase()
Determines whether the mib will be loaded from database files or not.

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

isV3DatabaseFlag

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

Returns:
true if the V3 database flag is set and false otherwise.

setV3DatabaseFlag

public void setV3DatabaseFlag(boolean v3Flag)
v3 only 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.

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

setCommunity

public void setCommunity(java.lang.String c)
Sets the SNMP target Community.

Parameters:
c - community to be set.

getCommunity

public java.lang.String getCommunity()
Gets the SNMP target Community

Returns:
the community to which the agent belongs.

getTableOID

public java.lang.String getTableOID()
Gets the table OID.

Returns:
the ObjectID of the table.

setTableOID

public void setTableOID(java.lang.String tableoid)
                 throws DataException
Sets the table OID that is to be used with this SnmpTablePanel instance.

Throws:
DataException - is thrown if data is invalid

getObjectIDList

public java.lang.String[] getObjectIDList()
Gets the list of object IDs that is previously set.

Returns:
a single dimensional array of Object IDs.

setObjectIDList

public void setObjectIDList(java.lang.String[] s)
Sets a list of object IDs that needs to be polled.

Parameters:
s - String array of Object IDs to be set.

getTableViewColumnCount

public int getTableViewColumnCount()
Gets the number of columns that are visible in the Table.

Returns:
the number of columns that are visible in the table.

setTableViewColumnCount

public void setTableViewColumnCount(int viewColumns)
Sets the number of columns that should be visible in the Table.

Parameters:
viewColumns - number of columns that should be visible.

getTableViewRowCount

public int getTableViewRowCount()
Gets the number of rows that are visible in Table.

Returns:
the number of rows that are visible.

setTableViewRowCount

public void setTableViewRowCount(int viewRows)
Sets the number of rows that should be visible in Table.

Parameters:
viewRows - number of rows that should be visible.

setAugmentedDisplay

public void setAugmentedDisplay(boolean isAugmented)
v2c and v3 only 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.


isAugmentedDisplay

public boolean isAugmentedDisplay()
v2c and v3 only Determines the status whether the table displayed is the actual table or its augmented table.

Returns:
true if the displayed table is augmented table and false if the displayed table is the actual table whose oid is set using setTableOID

isRetrievalMode

public boolean isRetrievalMode()
v2c and v3 only Checks whether the mode of retrieval of rows is get_next or get_bulk. By default GetNext is used for retrieving the table.

Returns:
true if the mode is get_next and false if the mode is get_bulk.

setRetrievalMode

public void setRetrievalMode(boolean retrievalMode)
v2c and v3 only 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.

Parameters:
retrievalMode - true to set the mode to get_next and false to set it to get_bulk.

getTargetPort

public int getTargetPort()
Gets the SNMP target port number

Returns:
the port number.

setTargetPort

public void setTargetPort(int port)
Sets the SNMP target port number

Parameters:
port - the port number to be set.

getMibModules

public java.lang.String getMibModules()
Gets the mibmodules that are loaded in the SnmpTablePanel instance.

Returns:
the mibmodules that are loaded.

setMibModules

public void setMibModules(java.lang.String mibs)
Sets the SNMP mibmodules to be loaded in the SnmpTablePanel instance.

Parameters:
mibs - a white space seperated list of mib modules.

getWriteCommunity

public java.lang.String getWriteCommunity()
Gets the SNMP target write Community to be used for set requests

Returns:
the write community.

setWriteCommunity

public void setWriteCommunity(java.lang.String wcommunity)
Sets the SNMP target write Community to be used for set requests

Parameters:
wcommunity - the write community.

getTimeout

public int getTimeout()
Gets the SNMP target timeout value

Returns:
the timeout value.Default value is 5 secs.

setTimeout

public void setTimeout(int timeout)
Sets the SNMP target timeout value.By Default the timeout value is 5 secs.

Parameters:
timeout - the timeout value.

getRetries

public int getRetries()
Gets the SNMP target retries value. Default retries value is 0.

Returns:
the retries value.

setRetries

public void setRetries(int retries)
Sets the SNMP target retries value. Default retries value is 0.

Parameters:
retries - the retries value.

getSnmpVersion

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

Returns:
the SNMP version number.

setSnmpVersion

public void setSnmpVersion(int version)
v3 only Sets the SNMP target SNMP Version. 0 for Version 1 (default) and 1 for Version V2C and 3 for Version V3.

Parameters:
version - the SNMP version number to be set.

getContextName

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

Returns:
the SNMP V3 context name.

setContextName

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

Parameters:
contextName - the contextName to be set.

getContextID

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

Returns:
the SNMP V3 context ID.

setContextID

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

Parameters:
contextID - the contextID to be set.

setEngineID

public void setEngineID(byte[] EngineID)
v3 only Sets the SNMP V3 engineID.


getPrincipal

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

Returns:
the SNMP Principal.

setPrincipal

public void setPrincipal(java.lang.String principal)
v3 only Sets the SNMP Principal

Parameters:
principal - the SNMP principal.

getAuthProtocol

public int getAuthProtocol()
v3 only Gets the SNMP V3 AuthProtocol

Returns:
the SNMP V3 AuthProtocol.

setAuthProtocol

public void setAuthProtocol(int authProtocol)
v3 only Sets the SNMP V3 AuthProtocol.

Parameters:
authProtocol - the SNMP V3 AuthProtocol.

getAuthPassword

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

Returns:
the SNMP V3 AuthPassword.

setAuthPassword

public void setAuthPassword(java.lang.String authPasswd)
v3 only Sets the SNMP V3 AuthPassword.

Parameters:
authPasswd - the SNMP V3 AuthPassword.

getPrivPassword

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

Returns:
the SNMP V3 PrivPassword.

setPrivPassword

public void setPrivPassword(java.lang.String privpasswd)
v3 only Sets the SNMP V3 PrivPassword

Parameters:
privpasswd - the SNMP V3 PrivPassword.

create_v3_tables

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


setSerializeMibs

public void setSerializeMibs(boolean isSerialize)
Defines whether to serialize the MibModule 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 saves 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" extention.Here, it will save it as RMON2-MIB.ser. Serialization is not supported in applets.


isSerializeMibs

public boolean isSerializeMibs()
Gets whether the MIBs are serialized or not.

Returns:
true if the MIB files are serialized and false otherwise.

setLoadFromSerializedMibs

public void setLoadFromSerializedMibs(boolean isFromSerializedMibs)
Determines whether to load MIBs from serialized file or not. This flag should be set before loading the MIBs. If both serializeMibs and loadFromSerializedMibs is set to true, it will just try to load the MIB as a serialized file.


setLoadFromCompiledMibs

public void setLoadFromCompiledMibs(boolean isFromCompiledMibs)
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.


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 the existing compiled mibs and false if not.

getOverwriteCMI

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

Returns:
true if the existing compiled mib files will be overwritten and false otherwise.

setReadDesc

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

Parameters:
readFlag - true to read descriptions from compiled mib files and false otherwise.

isReadDesc

public boolean isReadDesc()
Determines whether reading descriptions from compiled modules is enabled or not.

Returns:
true if reading descriptions is enabled and false if it is disabled.

isLoadFromSerializedMibs

public boolean isLoadFromSerializedMibs()
Determines whether the mibs will be loaded from serialized file or not.

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

isLoadFromCompiledMibs

public boolean isLoadFromCompiledMibs()
Determines whether the mibs will be loaded from CompiledMib files or not.

Returns:
true if the mibs will be loaded from compiled mib files 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.


setSerializedMibFileName

public void setSerializedMibFileName(java.lang.String serialMibName)
Sets the name of the Serialized MIB File for saving. The Serialized file will be saved with this filename in the directory from which the mib is loaded. By default it will be saved in a file with name same as the MIB file name followed by .ser extension.

Parameters:
serialMibName - the name of the serialized MIB file.

getSerializedMibFileName

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

Returns:
the name of the Serialized MIB file.

setMenuStatus

public void setMenuStatus(boolean status)
Sets the status of 'Right Click' of SnmpTable. Setting this to false will disable the 'Right Click' menu.


getMenuStatus

public boolean getMenuStatus()
Gets the status of 'Right Click' menu of SnmpTable


removeAll

public void removeAll()
Stops polling and removes all the components.

Overrides:
removeAll in class java.awt.Container


Copyright (c)ZOHO Corp. 1996-2012