MIBs API Changes

 

The API changes in MibOperations are listed below.

 

S.No. Deprecated Method/Variable Comment

1

getThrowFileNotFound

The setThrowFileNotFound(boolean) method is deprecated.

2

setThrowFileNotFound

It is mandatory that the imported modules should be present in the directory in which the MIB files are loaded.

 

The API changes in MibNode are listed below.

 

S.No. Deprecated Method/Variable Comment

1

getObjectNames()

Use the getObjects() method instead.

2

getFilename()

Use the getFileName() method instead.

 

The API changes in AgentCapabilitiesModule are listed below.

 

S.No. Deprecated Method/Variable Comment

1

getVariation()

Use the getACVariation() method instead.

2

getSyntax()

Use the getSyntax() method in the ACVariation class instead.

3

getWriteSyntax()

Use the getWriteSyntax() method in the ACVariation class instead.

4

getAccess()

Use the getAccess() method in the ACVariation class instead.

5

getCreationRequires()

Use the getCreationObjects() method in the ACVariation class instead.

6

getDefval()

Use the getDefVal() method in the ACVariation class instead.

7

getVariationDescription()

Use the getDescription() method in the ACVariation class instead.

 

In this release we have introduced a new MibParser to parse the MIB file. In the earlier releases, both parsing the MIB and constructing the tree are done in the com.adventnet.snmp.mibs package itself. Now parsing of MIBs is done by the mibparser package and the tree is constructed in the mibs package. The mibparser package is not transparent to the user and it is used internally by the mibs package. As far as the public API is concerned, there is no change in API methods. So the existing applications using the mibs package will still work with the new changes in the mibs package. One key enhancement is the option of loading MIB files as compiled MIB files. The loading of compiled MIB files gives good performance when compared with the loading of the normal MIB file. Refer MIB Support API for more details.

 

The following are the changes in MIB related operations due to new MibParser.

  1. All the modules defined in the import field should be present. Earlier even if imports, such as mib-2 from RFC1213-MIB failed, it loads the MIB after printing a warning message. Now it is mandatory that all the modules defined in the imports are present.

  2. OID definitions such as the following will not work.

newNode OBJECT IDENTIFIER ::= { ModuleName.nodeName 1}

newNode OBJECT IDENTIFIER ::= { 1 3 6 .......}

newNode OBJECT IDENTIFIER ::= { 1 }

  1. Module name should not start with a lower case letter or number.

  2. Enumeration label should not start with a number.

  3. Since multiple roots are shown in the MibTree now, GET and GETNEXT operation from the MIB browser after selecting the module name will fail. You have to select the MIB node.

  4. If the module contains multiple roots like iso and ccitt, then the getRootNode method in MibModule of release 2 will return an iso. Now the behaviour has been changed to return null. The method getRootNodes added in Release 3.1 can be used to get all the root nodes.

  5. Methods such as getDefval(), getUnits(), getReference(), etc. which used to return null if it is not defined in the mib. Now it will return an empty string.

  6. The start()method of the SnmpAPI class is invoked when the class is instantiated and therefore need not be explicitly called.

  7. If the syntax of a node is a TextualConvention, say myTC, then myTC instanceof LeafSyntax which used to return true in the earlier releases, will return false now. But myTC instanceof MibTC will return true. Since MibTC extends LeafSyntax you can access all the methods available in LeafSyntax.

In the LeafSyntax class in the mibs package, methods such as getName(), toString(), getDescription() were all returning the same information in the earlier releases. For example, a syntax of INTEGER with range (1 .. 200 | 400 .. 500) were returning INTEGER (1 .. 200 | 400 .. 500).

 

In the Release 3.x, the getName() and toString() method will return only the name of the syntax ( i.e., INTEGER) and the getDescription() will return the syntax along with the range ( i.e., INTEGER ( 1 .. 200 | 400 .. 500 ) )

 

In the earlier releases, getDescription() in the MibTC class used to return the TC description. Now getDescription() returns the name of the MibTC along with the range. A new method getTCDescription() is added, which returns the description of the Textual Convention.



Copyright © 1996-2006, AdventNet Inc. All Rights Reserved.