com.adventnet.snmp.ui
Class MibBrowser

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

public class MibBrowser
extends javax.swing.JPanel
implements CustomizerTemplate

This class is the MIB Browser bean. It can be embedded in applications and applets. Only minimal configuration has been enabled in this version - soon much more configurability will be provided in this bean.

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
MibBrowser()
          Create a MIB browser bean instance.
MibBrowser(java.applet.Applet applet)
          Create a MIB browser bean instance.
MibBrowser(java.applet.Applet applet, boolean hidejdbc)
          Create a MibBrowser bean instance for Applet and for the avoiding the Jdbc params being initialized for V3
MibBrowser(java.applet.Applet applet, MibTree tree)
          Create a MIB browser bean instance with MibTree .
MibBrowser(int protocol, ProtocolOptions opts)
          Create a Mib Browser instance with ProtocolOptions as the parameter.
MibBrowser(MibTree tree)
          Create a MIB browser bean instance with mibTree .
 
Method Summary
 void addLogClient(LogInterface client)
          Add the Log client for which the target has to redirect the log messages
 void addSnmpPropertyListener(SnmpPropertyListener l)
          add SnmpPropertyListener object into listener vector
 void cleanUp()
          Destroys this components resources.
 int create_v3_tables()
          v3 only This needs to be implemented to set add v3 user entry.Thil will set v3 user information by creating SnmpEngineTable and USMUserTable
 boolean findNext(java.lang.String nodeName, boolean findAll, boolean matchCase, boolean matchWord)
          This method is used for searching next Node in the Mib using previous node
 java.lang.String getAgentPort()
          Deprecated. Replaced by getTargetPort().
 java.lang.String getAuthPassword()
          v3 only Get AuthPassword
 int getAuthProtocol()
          v3 only Get AuthProtocol
 java.lang.String getCharacterEncoding()
          Get the Character Encoding being used.
 java.lang.String getCommunity()
          Get community in MIB Browser.
static java.lang.String getConfDir()
          Returns the conf directory set on this MibBrowser instance.
 java.lang.String getContextID()
          v3 only Get the SNMP V3 contextID
 java.lang.String getContextName()
          v3 only Get the SNMP V3 Context name
 java.lang.String getHostname()
          Deprecated. Replaced by getTargetHost().
 LineGraphBean getLineGraphBean()
          returns the LineGraphBean instance of MibBrowser
 com.adventnet.snmp.ui.MbDisplayPanel getMbDisplayPanel()
          returns the MbDisplayPanel instance
 javax.swing.JMenuBar getMenuBar()
          returns the MibBrowser MenuBar instance.
 java.awt.Font getMenuFont()
          returns the menu font
 int getMibBrowserDisplayView()
          returns Display view
 java.lang.String getMibModules()
          Return a list of loaded MIB Modules
 MibOperations getMibOperations()
          Returns MibOperations instance
 MibTree getMibTree()
          Get the MibTree instance used in the MIB browser
 java.awt.Dimension getMinimumSize()
          Returns the minimum size of this component.
 java.lang.String getMultipleObjectID()
          Get Object ID in MIB Browser.
 java.lang.String getNumericObjectID()
          Get the numeric OID of selected Mib Node.
 java.lang.String getObjectID()
          Get Object ID in MIB Browser.
 boolean getOverwriteCMI()
          Gets the overwrite compiled mibs boolean.
 java.awt.Dimension getPreferredSize()
          Returns the preferred size of this component.
 java.lang.String getPrincipal()
          v3 only Get Principal
 java.lang.String getPrivPassword()
          v3 only Get PrivPassword
 java.lang.String getRetries()
          Get Retries
 java.lang.String getSecurityLevel()
          v3 only Get SecurityLevel
 MibModule getSelectedModule()
          Returns the Selected MIB Module
 java.lang.String getSerializedMibFileName()
          Gets the name of the Serialized Mib file
 java.lang.String getSetValue()
          Get Set Value in MIB Browser.
 SnmpEngineTable getSnmpEngineTable()
          v3 only Get the SnmpEngineTable reference.
 com.adventnet.snmp.ui.SnmpTasks getSnmpTasks()
          returns SnmpTasks of MibBrowser
 int getSnmpVersion()
          v2c and v3 only Get the SNMP target SNMP Version.
 java.lang.String getTargetHost()
          Get hostname in MIB Browser.
 java.util.Vector getTargetHostNames()
          Get the Vector of HostNames in MibBrowser.
 int getTargetPort()
          Get Port
 java.lang.String getTimeout()
          Get Timeout
 ToolBar getToolBar()
          returns the MibBrowser ToolBar instance.
 int getTrapPort()
          Get Trap Port
 TrapViewer getTrapViewer()
          Returns the last TrapViewer instance.
 USMUserTable getUSMTable()
          v3 only Get the reference to the USMUserTable.
 int getVersion()
          Deprecated. replaced by getSnmpVersion()
 java.lang.String getWriteCommunity()
          Get write community in MIB Browser.
 void hideJdbc(boolean hide)
          Hides the Jdbc connection establishing panels.
 void initJdbcParams(java.lang.String driverName, java.lang.String URL, java.lang.String userName, java.lang.String passWord)
          If you need to use database support, this method should be invoked to initialize the Jdbc Parameters.
 void initSecurityProvider()
          v3 only This method initializes the SecurityProvider by reading from the file securityProvider.confg .
static void internationalize(java.util.Locale locale, java.awt.Font font)
          The method to implement the internationlization in MibBrowser.
 boolean isLoadFromCompiledMibs()
          Gets the loadFromCompiledMibs boolean
 boolean isLoadFromSerializedMibs()
          Gets the loadFromSerializedMibs boolean
 boolean isLoadMibsFromDatabase()
          Gets the loadFromDatabase boolean
 boolean isLoadRecentMibs()
          Returns the value corresponding to load recently loaded mibs at startup option on this instance.
 boolean isMenuBarVisible()
          returns whether the menu bar is visible or not
 boolean isOperationInProgress()
          Returns whether any of the SNMP Operations like GET, GETNEXT, GETBULK,SET are currently in progress.
 boolean isOverwriteMibsInDatabase()
          Gets the overwrite mibs in Database boolean.
 boolean isReadDesc()
          Returns true if reading descriptions from compiled modules is enabled
 boolean isSerialize()
          v3 only Returns the status of serialization of USMUserTable and SnmpEngineTable.
 boolean isSerializeMibs()
          Gets the serializeMibs boolean
 boolean isSupportedSecurityModel(int m)
          v3 only Specifies if a particular security model is supported or not.
 boolean isToolBarVisible()
          returns whether the tool bar is visible or not
 boolean isV3DatabaseFlag()
          v3 only To check whether v3 database flag is set or not.
 void loadMib(java.lang.String mib)
          Add another MIB file after startup
 void manage_v3_tables()
          v3 only This needs to be imlemented to update the current information about v3 user
 void releaseResources()
          Though the resources will be cleaned up by the garbage collector, if the application is no more using the MibBrowser bean instance, this method can be used to immediately release the resources.
 void removeLogClient()
          Removes the Log client for which the target has been registered to redirect the log Messages.
 void removeSnmpPropertyListener(SnmpPropertyListener l)
          remove SnmpPropertyListener object from listener vector
 void setAgentPort(java.lang.String port)
          Deprecated. Replaced by setTargetPort(int).
 void setAuthPassword(java.lang.String password)
          v3 only Set AuthPassword
 void setAuthProtocol(int protocol)
          v3 only Set AuthProtocol
 void setCharacterEncoding(java.lang.String enc)
          Set the Character Encoding to be used.
 void setCommunity(java.lang.String s)
          Set community in MIB Browser.
static void setConfDir(java.lang.String dir)
          The method to customize the conf directory
 void setContextID(java.lang.String ctxtID)
          v3 only Set the SNMP V3 contextID
 void setContextName(java.lang.String cName)
          v3 only Set the SNMP V3 Context name
 void setDebug(boolean debug)
          Set whether to print debug information
 void setEngineID(byte[] eID)
          v3 only Set the SNMP V3 EngineID
 void setHelpURL(java.net.URL helpurl)
          The method to customize the help URL.
 void setHostname(java.lang.String s)
          Deprecated. Replaced by setTargetHost(String).
 void setLineGraphBean(LineGraphBean graph)
          sets the LineGraphBean instance of MibBrowser
 void setLoadFromCompiledMibs(boolean flag)
          Defines whether to load mib from compiled MIBs.
 void setLoadFromSerializedMibs(boolean flag)
          Method defines whether to load MIB from serialized file.
 void setLoadMibsFromDatabase(boolean flag)
          Defines whether to load mib from DataBase.
 void setLoadRecentMibs(boolean mibLoad)
          Used to enable/disable load recently loaded mibs at startup option.
 void setMenuBarVisible(boolean flag)
          set whether the menu bar is visible or not
 void setMenuFont(java.awt.Font menuFont)
          sets the menu font.
 void setMibBrowserDisplayView(int view)
          Sets MibBrowser display view to show the MibDescription panel or ResultDisplay panel alone or MultiVarbind panel.
 void setMibModules(java.lang.String mibs)
          Add MIB files at startup time
 void setMibOperations(MibOperations mibOps)
          Set the MibOperations.This can be used when the API user wants the MibBrowser to use the localinstance of MibOperations instead of the Static MibOperations shared by all the other beans.
 void setMibPath(java.lang.String searchPath)
          Sets the search path from where the Mib should be loaded.
 void setMibTreeExpandable(boolean flag)
          Set whether to expand the MibTree based on the result oid node.
 void setMultipleObjectID(java.lang.String s)
          Set Object ID in MIB Browser.
 void setObjectID(java.lang.String s)
          Set Object ID in MIB Browser.
 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 userName)
          v3 only Set Principal
 void setPrivPassword(java.lang.String password)
          v3 only Set PrivPassword
 void setReadDesc(boolean readFlag)
          Sets the flag to read descriptions from compiled mib modules.
 void setRetries(java.lang.String retries)
          Set Retries
 void setSecurityLevel(byte sLevel)
          v3 only Set SecurityLevel
 void setSerializedMibFileName(java.lang.String serFileName)
          Method defines the name of the Serialized MIB File.
 void setSerializeMibs(boolean flag)
          Method defines whether to serialize the MibModule.
 void setSettingsTitle(java.lang.String title)
          sets the title of Settings Frame.
 void setSetValue(java.lang.String s)
          Set Set Value in MIB Browser.
 void setSnmpVersion(int i)
          v2c and v3 only Set the SNMP target SNMP Version.
 void setTargetHost(java.lang.String s)
          Set hostname in MIB Browser.
 void setTargetHostNames(java.util.Vector targetHostNames)
          Set a Vector of HostNames in MIB Browser.
 void setTargetPort(int port)
          Set the remote Port
 void setTimeout(java.lang.String timeout)
          Set Timeout
 void setToolBarVisible(boolean flag)
          Shows or hides the MibBrowser ToolBar depending on the value of parameter
 void setTrapPort(int port)
          Set Trap Port
 void setV3DatabaseFlag(boolean v3Flag)
          If v3 only you need to use database support for V3 , set this flag to true.
 void setVersion(int i)
          Deprecated. replaced by setSnmpVersion(int)
 void setWriteCommunity(java.lang.String s)
          Set write community in MIB Browser.
 void unloadMib(java.lang.String mib)
          Unload the mib
 void v3Settings()
          v3 only This method is used for deSerializing the USMUserTable in MibBrowser.
 
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, getNextFocusableComponent, 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, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MibBrowser

public MibBrowser()
Create a MIB browser bean instance. Use this for applications.


MibBrowser

public MibBrowser(MibTree tree)
Create a MIB browser bean instance with mibTree . Use this for applications.


MibBrowser

public MibBrowser(int protocol,
                  ProtocolOptions opts)
Create a Mib Browser instance with ProtocolOptions as the parameter.


MibBrowser

public MibBrowser(java.applet.Applet applet,
                  boolean hidejdbc)
Create a MibBrowser bean instance for Applet and for the avoiding the Jdbc params being initialized for V3


MibBrowser

public MibBrowser(java.applet.Applet applet)
Create a MIB browser bean instance. Use this for applets.


MibBrowser

public MibBrowser(java.applet.Applet applet,
                  MibTree tree)
Create a MIB browser bean instance with MibTree . Use this for applets.

Method Detail

addLogClient

public void addLogClient(LogInterface client)
Add the Log client for which the target has to redirect the log messages


removeLogClient

public void removeLogClient()
Removes the Log client for which the target has been registered to redirect the log Messages.


getSnmpTasks

public com.adventnet.snmp.ui.SnmpTasks getSnmpTasks()
returns SnmpTasks of MibBrowser


internationalize

public static void internationalize(java.util.Locale locale,
                                    java.awt.Font font)
The method to implement the internationlization in MibBrowser. This should be called before the MibBrowser is instantiated. The .properties file should be in proper properties form with proper escape sequence. The file will be searched in the current directory by default incase of application and incase of applet it will be searched relative to the document base of the applet. The search path of the properties file can be set using the static method setSearchPath(String) in the SnmpUtils class. The search path can be absolute or relative in case of application and should be relative to the applet document base in case of applet.

See Also:
The Locale for which internationlization has to be done., The specific font that was supported by the Locale.

releaseResources

public void releaseResources()
Though the resources will be cleaned up by the garbage collector, if the application is no more using the MibBrowser bean instance, this method can be used to immediately release the resources.


addSnmpPropertyListener

public void addSnmpPropertyListener(SnmpPropertyListener l)
add SnmpPropertyListener object into listener vector


removeSnmpPropertyListener

public void removeSnmpPropertyListener(SnmpPropertyListener l)
remove SnmpPropertyListener object from listener vector


getMibBrowserDisplayView

public int getMibBrowserDisplayView()
returns Display view


setHelpURL

public void setHelpURL(java.net.URL helpurl)
The method to customize the help URL.

Parameters:
helpurl - the url to be shown as help.

setConfDir

public static void setConfDir(java.lang.String dir)
The method to customize the conf directory

Parameters:
dir - the conf directory path where the conf files are present.

getConfDir

public static java.lang.String getConfDir()
Returns the conf directory set on this MibBrowser instance.

Returns:
the conf directory on this MibBrowser instance.

setMibBrowserDisplayView

public void setMibBrowserDisplayView(int view)
Sets MibBrowser display view to show the MibDescription panel or ResultDisplay panel alone or MultiVarbind panel. SHOW_MIB_DESCRIPTION - Display MibDescription panel SHOW_RESULT_DISPLAY - Display ResultDisplay panel SHOW_MULTI_VARBIND - MultiVarbind panel The value is set to SHOW_MIB_DESCRIPTION by default.


isMenuBarVisible

public boolean isMenuBarVisible()
returns whether the menu bar is visible or not


setMenuBarVisible

public void setMenuBarVisible(boolean flag)
set whether the menu bar is visible or not


isToolBarVisible

public boolean isToolBarVisible()
returns whether the tool bar is visible or not


setToolBarVisible

public void setToolBarVisible(boolean flag)
Shows or hides the MibBrowser ToolBar depending on the value of parameter


getToolBar

public ToolBar getToolBar()
returns the MibBrowser ToolBar instance. Can be customized


getMenuBar

public javax.swing.JMenuBar getMenuBar()
returns the MibBrowser MenuBar instance. Can be customized


setSettingsTitle

public void setSettingsTitle(java.lang.String title)
sets the title of Settings Frame.


setMenuFont

public void setMenuFont(java.awt.Font menuFont)
sets the menu font. Note:The font will be set for the menus provided in the MibBrowser. If any additional menus are added,the font should be set explicitly


getMenuFont

public java.awt.Font getMenuFont()
returns the menu font


getTrapViewer

public TrapViewer getTrapViewer()
Returns the last TrapViewer instance.


getMbDisplayPanel

public com.adventnet.snmp.ui.MbDisplayPanel getMbDisplayPanel()
returns the MbDisplayPanel instance


getLineGraphBean

public LineGraphBean getLineGraphBean()
returns the LineGraphBean instance of MibBrowser


setLineGraphBean

public void setLineGraphBean(LineGraphBean graph)
sets the LineGraphBean instance of MibBrowser


getMinimumSize

public java.awt.Dimension getMinimumSize()
Returns the minimum size of this component.

Overrides:
getMinimumSize in class javax.swing.JComponent

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the preferred size of this component.

Overrides:
getPreferredSize in class javax.swing.JComponent

setCharacterEncoding

public void setCharacterEncoding(java.lang.String enc)
Set 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()
Get the Character Encoding 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.

getMibOperations

public MibOperations getMibOperations()
Returns MibOperations instance


setMibOperations

public void setMibOperations(MibOperations mibOps)
Set the MibOperations.This can be used when the API user wants the MibBrowser to use the localinstance of MibOperations instead of the Static MibOperations shared by all the other beans. Note:This will over-write the existing MibOperations used by the other beans.


setMibModules

public void setMibModules(java.lang.String mibs)
Add MIB files at startup time


getMibModules

public java.lang.String getMibModules()
Return a list of loaded MIB Modules


getSelectedModule

public MibModule getSelectedModule()
Returns the Selected MIB Module


loadMib

public void loadMib(java.lang.String mib)
Add another MIB file after startup


unloadMib

public void unloadMib(java.lang.String mib)
Unload the mib


getMibTree

public MibTree getMibTree()
Get the MibTree instance used in the MIB browser


setMibTreeExpandable

public void setMibTreeExpandable(boolean flag)
Set whether to expand the MibTree based on the result oid node. Default it is expandable. Set false to not to expand the MibTree for the result oid node.


setDebug

public void setDebug(boolean debug)
Set whether to print debug information


setRetries

public void setRetries(java.lang.String retries)
                throws java.lang.NumberFormatException
Set Retries

Throws:
java.lang.NumberFormatException - is thrown on error

getRetries

public java.lang.String getRetries()
                            throws java.lang.NumberFormatException
Get Retries

Throws:
java.lang.NumberFormatException - is thrown on error

setTimeout

public void setTimeout(java.lang.String timeout)
                throws java.lang.NumberFormatException
Set Timeout

Throws:
java.lang.NumberFormatException - is thrown on error

getTimeout

public java.lang.String getTimeout()
Get Timeout


hideJdbc

public void hideJdbc(boolean hide)
Hides the Jdbc connection establishing panels. No JDBC connection will be established from the MibBrowser if this boolean is set to true. Default will be false.

Parameters:
hide - boolean.

getContextName

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


setContextName

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


getContextID

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


setContextID

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


setEngineID

public void setEngineID(byte[] eID)
v3 only Set the SNMP V3 EngineID


getPrincipal

public java.lang.String getPrincipal()
v3 only Get Principal


getAuthPassword

public java.lang.String getAuthPassword()
v3 only Get AuthPassword


getPrivPassword

public java.lang.String getPrivPassword()
v3 only Get PrivPassword


getAuthProtocol

public int getAuthProtocol()
v3 only Get AuthProtocol


getSecurityLevel

public java.lang.String getSecurityLevel()
v3 only Get SecurityLevel


setAgentPort

public void setAgentPort(java.lang.String port)
                  throws java.lang.NumberFormatException
Deprecated. Replaced by setTargetPort(int).

Set Port

Throws:
java.lang.NumberFormatException - is thrown on error

getAgentPort

public java.lang.String getAgentPort()
Deprecated. Replaced by getTargetPort().

Get Port


getTrapPort

public int getTrapPort()
Get Trap Port


setTrapPort

public void setTrapPort(int port)
Set Trap Port


getSnmpVersion

public int getSnmpVersion()
v2c and v3 only Get the SNMP target SNMP Version. 0 is Version 1 (default), 1 is Version V2C v3 only and 3 is Version V3. v2c and v3 only

Returns:
SNMP version integer.

getVersion

public int getVersion()
Deprecated. replaced by getSnmpVersion()

v2c and v3 only

See Also:
getSnmpVersion()

setVersion

public void setVersion(int i)
Deprecated. replaced by setSnmpVersion(int)

v2c and v3 only

See Also:
setSnmpVersion(int)

setHostname

public void setHostname(java.lang.String s)
Deprecated. Replaced by setTargetHost(String).

Set hostname in MIB Browser.


getHostname

public java.lang.String getHostname()
Deprecated. Replaced by getTargetHost().

Get hostname in MIB Browser.


setCommunity

public void setCommunity(java.lang.String s)
Set community in MIB Browser.


getCommunity

public java.lang.String getCommunity()
Get community in MIB Browser.


setWriteCommunity

public void setWriteCommunity(java.lang.String s)
Set write community in MIB Browser.


getWriteCommunity

public java.lang.String getWriteCommunity()
Get write community in MIB Browser.


setObjectID

public void setObjectID(java.lang.String s)
Set Object ID in MIB Browser.


getObjectID

public java.lang.String getObjectID()
Get Object ID in MIB Browser.


setMultipleObjectID

public void setMultipleObjectID(java.lang.String s)
Set Object ID in MIB Browser.


getMultipleObjectID

public java.lang.String getMultipleObjectID()
Get Object ID in MIB Browser.


setSetValue

public void setSetValue(java.lang.String s)
Set Set Value in MIB Browser.


getSetValue

public java.lang.String getSetValue()
Get Set Value in MIB Browser.


getNumericObjectID

public java.lang.String getNumericObjectID()
Get the numeric OID of selected Mib Node. Add a .0 if scalar


cleanUp

public void cleanUp()
Destroys this components resources. Should be called only from applet destroy() routines


setSerializeMibs

public void setSerializeMibs(boolean flag)
Method defines whether to serialize the MibModule. 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 the serializeMibs boolean


setLoadFromSerializedMibs

public void setLoadFromSerializedMibs(boolean flag)
Method defines whether to load MIB from serialized file. 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.


initJdbcParams

public void initJdbcParams(java.lang.String driverName,
                           java.lang.String URL,
                           java.lang.String userName,
                           java.lang.String passWord)
                    throws java.lang.ClassNotFoundException,
                           java.sql.SQLException
If you need to use database support, this method should be invoked to initialize the Jdbc Parameters.

Parameters:
driverName - Name of the DataBase driver.
URL - URL pointing to the DataBase file name
userName - userName
passWord - password
java.lang.ClassNotFoundException
java.sql.SQLException

setLoadMibsFromDatabase

public void setLoadMibsFromDatabase(boolean flag)
Defines whether to load mib from DataBase. 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 - boolean
See Also:
initJdbcParams(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

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.


setMibPath

public void setMibPath(java.lang.String searchPath)
Sets the search path from where the Mib should be loaded. Multiple paths can be specified using the pipe (|) as a separator.

for example, If the primary MIB file IF-MIB is in the directory "../mibs" and if the imported MIB file is in the directory "../examples" then the SearchPath can be set as follows
MibBrowser.setMibPath("../mibs | ../examples");

If the SearchPath is not set, then the MIB files are searched in the current working directory, or in the directory from where the MIB file is loaded.

If the search path is set, the MIB file will be searched in the directories specified using this method in addition to the current directory and the directory from where the MIB file is loaded. The MIB files will be searched in the order specified using this method.

Parameters:
searchPath - String specifying the search path.
For multiple paths separate the paths by the pipe (|) symbol.
Since:
AdventNet SNMP API 4 SP1

isOverwriteMibsInDatabase

public boolean isOverwriteMibsInDatabase()
Gets the overwrite mibs in Database boolean.


isLoadMibsFromDatabase

public boolean isLoadMibsFromDatabase()
Gets the loadFromDatabase boolean


isV3DatabaseFlag

public boolean isV3DatabaseFlag()
v3 only To check whether v3 database flag is set or not.

Returns:
boolean v3 database flag.

setV3DatabaseFlag

public void setV3DatabaseFlag(boolean v3Flag)
If v3 only you need to use database support for V3 , set this flag to true.

Parameters:
v3Flag - flag to be set.

setLoadFromCompiledMibs

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


getOverwriteCMI

public boolean getOverwriteCMI()
Gets the overwrite compiled mibs boolean. NOTE: This applies only when the setLoadFromCompiledMibs is set to true.


setReadDesc

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


isReadDesc

public boolean isReadDesc()
Returns true if reading descriptions from compiled modules is enabled


isLoadFromSerializedMibs

public boolean isLoadFromSerializedMibs()
Gets the loadFromSerializedMibs boolean


isLoadFromCompiledMibs

public boolean isLoadFromCompiledMibs()
Gets the loadFromCompiledMibs boolean


setSerializedMibFileName

public void setSerializedMibFileName(java.lang.String serFileName)
Method defines the name of the Serialized MIB File. The Serialized file will be saved with this filename in the directory from which the mib is loaded.


getSerializedMibFileName

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


findNext

public boolean findNext(java.lang.String nodeName,
                        boolean findAll,
                        boolean matchCase,
                        boolean matchWord)
This method is used for searching next Node in the Mib using previous node


setSnmpVersion

public void setSnmpVersion(int i)
v2c and v3 only Set the SNMP target SNMP Version. 0 is Version 1 (default), 1 is Version V2C v3 only and 3 is Version V3. v2c and v3 only

Specified by:
setSnmpVersion in interface CustomizerTemplate

setTargetPort

public void setTargetPort(int port)
Set the remote Port

Specified by:
setTargetPort in interface CustomizerTemplate

setTargetHost

public void setTargetHost(java.lang.String s)
Set hostname in MIB Browser.

Specified by:
setTargetHost in interface CustomizerTemplate

getTargetPort

public int getTargetPort()
Get Port

Specified by:
getTargetPort in interface CustomizerTemplate

getTargetHost

public java.lang.String getTargetHost()
Get hostname in MIB Browser.

Specified by:
getTargetHost in interface CustomizerTemplate

setTargetHostNames

public void setTargetHostNames(java.util.Vector targetHostNames)
Set a Vector of HostNames in MIB Browser.


getTargetHostNames

public java.util.Vector getTargetHostNames()
Get the Vector of HostNames in MibBrowser.


v3Settings

public void v3Settings()
v3 only This method is used for deSerializing the USMUserTable in MibBrowser.


setPrincipal

public void setPrincipal(java.lang.String userName)
v3 only Set Principal

Specified by:
setPrincipal in interface CustomizerTemplate

setSecurityLevel

public void setSecurityLevel(byte sLevel)
v3 only Set SecurityLevel

Specified by:
setSecurityLevel in interface CustomizerTemplate

setAuthPassword

public void setAuthPassword(java.lang.String password)
v3 only Set AuthPassword

Specified by:
setAuthPassword in interface CustomizerTemplate

setPrivPassword

public void setPrivPassword(java.lang.String password)
v3 only Set PrivPassword

Specified by:
setPrivPassword in interface CustomizerTemplate

setAuthProtocol

public void setAuthProtocol(int protocol)
v3 only Set AuthProtocol

Specified by:
setAuthProtocol in interface CustomizerTemplate

create_v3_tables

public int create_v3_tables()
v3 only This needs to be implemented to set add v3 user entry.Thil will set v3 user information by creating SnmpEngineTable and USMUserTable

Specified by:
create_v3_tables in interface CustomizerTemplate

manage_v3_tables

public void manage_v3_tables()
v3 only This needs to be imlemented to update the current information about v3 user

Specified by:
manage_v3_tables in interface CustomizerTemplate

getUSMTable

public USMUserTable getUSMTable()
v3 only Get the reference to the USMUserTable.

Specified by:
getUSMTable in interface CustomizerTemplate
Returns:
the reference to the USMUserTable.

initSecurityProvider

public void initSecurityProvider()
                          throws SnmpException
v3 only This method initializes the SecurityProvider by reading from the file securityProvider.confg . It will register all the security models specified in the securityProvider.config file. Before you make any requests using any of the beans, this method has to be called so that the security provider is initialized.

Specified by:
initSecurityProvider in interface CustomizerTemplate
Throws:
SnmpException - if the file could not be found or if the security model could not be registered.

isSupportedSecurityModel

public boolean isSupportedSecurityModel(int m)
v3 only Specifies if a particular security model is supported or not. Returns true if the security model is supported. False otherwise.

Specified by:
isSupportedSecurityModel in interface CustomizerTemplate
Parameters:
m - The secuirty model number which needs to be checked if it is supported.
Returns:
true if the specified securitymodel is supported. False otherwise.

getSnmpEngineTable

public SnmpEngineTable getSnmpEngineTable()
v3 only Get the SnmpEngineTable reference.

Specified by:
getSnmpEngineTable in interface CustomizerTemplate
Returns:
the SnmpEngineTable reference.

isSerialize

public boolean isSerialize()
v3 only Returns the status of serialization of USMUserTable and SnmpEngineTable.

Specified by:
isSerialize in interface CustomizerTemplate
Returns:
the status of the

setLoadRecentMibs

public void setLoadRecentMibs(boolean mibLoad)
Used to enable/disable load recently loaded mibs at startup option. If this is enabled, the mib contents available in MibFiles.store will be loaded on MibBrowser startup.


isLoadRecentMibs

public boolean isLoadRecentMibs()
Returns the value corresponding to load recently loaded mibs at startup option on this instance.

Returns:
Value corresponding to loade recently loaded mibs at startup option.

isOperationInProgress

public boolean isOperationInProgress()
Returns whether any of the SNMP Operations like GET, GETNEXT, GETBULK,SET are currently in progress.



Copyright (c)ZOHO Corp. 1996-2012