|
The API changes in SnmpAPI are listed below.
| S.No. | Deprecated Method/Variable | Comment |
|---|---|---|
1 |
BITSTRING |
This variable has been deprecated in SNMPv2. |
2 |
NSAP |
This variable has been deprecated in SNMPv2. |
3 |
Standard_Prefix |
This should not be a public string variable. Variables should not be public. Instead, use the setOIDPrefix(SnmpOID oid) and getOIDPrefix() methods. |
4 |
UINTEGER32 |
This variable has been deprecated in SNMP. |
5 |
getCommunityTable() |
This method is no longer supported. The getSecurityProvider().getTable(1), where 1 stands for v1 security model, provides an equivalent method. All the user-defined security implementation should be got from the provider. |
6 |
getUSMTable() |
This method is no longer supported. The getSecurityProvider().getTable(3), where 3 stands for User-based Security Model, provides an equivalent method. The USMUserTable is instantiated by the constructor of this class. The USMUserTable has a list of USMUserEntries. |
The API changes in SnmpPDU are listed below.
| S.No. | Deprecated Method/Variable | Comment |
|---|---|---|
1 |
getAddress() |
SnmpPDU should know only the SNMP variables and protocol-independent variables. Here, the InetAddress is specific to UDP and therefore this method is deprecated. Use the following instead. UDPProtocolOptions opt = (UDPProtocolOptions) SnmpPDU.getProtocolOptions(); |
2 |
getRemoteHost() |
SnmpPDU should know only the SNMP variables and protocol-independent variables. Here, the host is specific to UDP and therefore this method is deprecated. Use the following instead. UDPProtocolOptions opt = (UDPProtocolOptions) SnmpPDU.getProtocolOptions(); |
3 |
getRemotePort() |
SnmpPDU should know only the SNMP variables and protocol-independent variables. Here, the port is specific to UDP and therefore this method is deprecated. Use the following instead. UDPProtocolOptions opt = (UDPProtocolOptions) SnmpPDU.getProtocolOptions(); |
4 |
setAddress(InetAddress address) |
SnmpPDU should know only the SNMP variables and protocol-independent variables. Here, the InetAddress is specific to UDP and therefore this method is deprecated. Use the following instead. UDPProtocolOptions opt = (UDPProtocolOptions) SnmpPDU.getProtocolOptions(); |
5 |
setDNSLookup(boolean lookup) |
No lookup is done. |
6 |
setRemoteHost(java.lang.String host) |
SnmpPDU should know only the SNMP variables and protocol-independent variables. Here, the host is specific to UDP and therefore this method is deprecated. Use the following instead. UDPProtocolOptions opt = (UDPProtocolOptions)SnmpPDU.getProtocolOptions(); |
7 |
setRemotePort(int port) |
SnmpPDU should know only the SNMP variables and protocol-independent variables. Here, the port is specific to UDP and therefore this method is deprecated. Use the following instead. UDPProtocolOptions opt = (UDPProtocolOptions)SnmpPDU.getProtocolOptions(); |
The API changes in SnmpSession are listed below.
| S.No. | Deprecated Method/Variable | Comment |
|---|---|---|
1 |
IP |
This is a static constant for identifying IP. This is not required because all SNMP communications are through a single transport provider. |
2 |
TRANSPORT_PROVIDER |
This is a static constant for transport provider framework. This is not required because all SNMP communications are through a single transport provider. |
3 |
get(SnmpOID oid) |
SnmpSession is used for any type of SNMP communication and therefore methods specific to get or set operations are not required. Use the following instead. SnmpPDU pdu = new SnmpPDU(); SnmpVar var = null; |
4 |
get(String oidString) |
SnmpSession is used for any type of SNMP communication and therefore methods specific to get or set operations are not required. Use the following instead. SnmpPDU pdu = new SnmpPDU(); SnmpVar var = null; |
5 |
getLocalAddresses() |
SnmpSession should know only the SNMP variables and protocol-independent variables. Here, the address is specific to UDP and therefore this method is deprecated. Use the following instead. UDPProtocolOptions opt = (UDPProtocolOptions) snmpSession.getProtocolOptions(); |
6 |
int getLocalPort() |
SnmpSession should know only the SNMP variables and protocol-independent variables. Here, the port is specific to UDP and therefore this method is deprecated. Use the following instead. UDPProtocolOptions opt = (UDPProtocolOptions) snmpSession.getProtocolOptions(); |
7 |
getnext(SnmpOID oid) |
SnmpSession is used for any type of SNMP communication and therefore methods specific to get or set operations are not required. Use the following instead. SnmpPDU pdu = new SnmpPDU(); |
8 |
getnext(String oidString) |
SnmpSession is used for any type of SNMP communication and therefore methods specific to get or set operations are not required. Use the following instead. SnmpPDU pdu = new SnmpPDU(); |
9 |
getPeername() |
SnmpSession should know only the SNMP variables and protocol-independent variables. Here, the address is specific to UDP and therefore this method is deprecated. Use the following instead. UDPProtocolOptions opt = (UDPProtocolOptions) SnmpSession.getProtocolOptions(); |
10 |
getProtocol() |
This returns the protocol associated with the session object. This is not required because all SNMP communications are through a single transport provider. |
11 |
getRemotePort() |
This returns the remote port on the peer to which the session communicates. This is not required because all SNMP communications are through a single transport provider. |
12 |
getSASClient() |
This method is not required because all SNMP communications are through a single transport provider. Use the following instead. SASProtocolOptions opt = (SASProtocolOptions)SnmpSession.getProtocolOptions(); |
13 |
getSASProtocol() |
This method is not required because all SNMP communications are through a single transport provider. Use the following instead. SASProtocolOptions opt = (SASProtocolOptions)snmpSession.getProtocolOptions(); |
14 |
getSnmpClientsSize() |
This method is no longer supported. Use the following instead. int snmpClientsSize = (snmpSession.getSnmpClients()).size(); |
15 |
getStartLocalPort() |
At present, the open(Applet) method throws an SnmpException if connection to the SAServer fails. When such an exception is received, the user can decide to call the open(void) method. |
16 |
open(Applet applet) |
This method is not required because all SNMP communications are through a single transport provider. Use the following instead. SnmpAPI api = new SnmpAPI(); |
17 |
set(SnmpOID oid, SnmpVar var) |
SnmpSession is used for any type of SNMP communication and therefore methods specific to get or set operations are not required. Use the following instead. SnmpPDU pdu = new SnmpPDU();
pdu.setCommand(SnmpAPI.SET_REQ_MSG); SnmpVar response_var = null; |
18 |
set(String oidString, String setString, byte type) |
SnmpSession is used for any type of SNMP communication and therefore methods specific to get or set operations are not required. Use the following instead. SnmpPDU pdu = new SnmpPDU(); SnmpVar var = null; |
19 |
setLocalAddresses(String[] local_addrs) |
LocalAddresses should be specified only through a ProtocolOptions because all SNMP communications are through a single transport provider. Use the following instead UDPProtocolOptions opt = (UDPProtocolOptions)snmpSession.getProtocolOptions(); |
20 |
setLocalPort(int local_port) |
LocalPort should be specified only through a ProtocolOptions because all SNMP communications are through a single transport provider. UDPProtocolOptions opt = (UDPProtocolOptions)snmpSession.getProtocolOptions(); |
21 |
setPeername(String peername) |
SnmpSession should know only the SNMP variables and protocol-independent variables. Here, the peer name is specific to UDP and therefore this method is deprecated. Use the following instead. UDPProtocolOptions opt = (UDPProtocolOptions)snmpSession.getProtocolOptions(); |
22 |
setProtocol(int protocol) |
This method is not required because all SNMP communications are through a single transport provider. |
23 |
setRemotePort(int port) |
SnmpSession should know only the SNMP variables and protocol-independent variables. Here, the port is specific to UDP and therefore this method is deprecated. Use the following instead. UDPProtocolOptions opt = (UDPProtocolOptions)snmpSession.getProtocolOptions(); |
24 |
setSASProtocol(int prot) |
SASProtocol should be specified only through a ProtocolOptions because all SNMP communications are through a single transport provider. Use the following instead. SASProtocolOptions opt = new SASProtocolOptions(); |
25 |
setSocketParms(int socketTimeout, int socketDelay) |
This method is not required because all SNMP communications are through a single transport provider. |
26 |
setStartLocalPort(int startLocalPort) |
At present, the open(Applet) method throws an SnmpException if connection to the SAServer fails. When such an exception is received, the user can decide to call the open(void) method. |
The Release 3.x provides security frame work where API users can plug-in
their implementation of SecurityModel to be used in SNMPV3 Security SubSystem.
WebNMS SNMP API provides User Based Security Model (USM) as a default
implementation for the SecurityFramework. The USM is also registered as
the default Security Model. This is available as a separate package called
com.adventnet.snmp.snmp2.usm.![]()
The 2.x release had USM related classes as part of snmp2 package. In the current release because of the new security framework, the USM classes are moved to a new package called com.adventnet.snmp.snmp2.usm.
The existing API users using release 2.2 will require some changes in their application. This is limited to importing the com.adventnet.snmp.snmp2.usm package.
i.e., the existing 2.x applications will have to add the following line in their imports.
import com.adventnet.snmp.snmp2.usm.*; |
In the 2.2 release to get the reference of USMUserTable the method SnmpAPI.getUSMTable() is used. This method is deprecated and the preferred way is to use the following method.
USMUserTable uut = (USMUserTable)api.getSecurityProvider() getTable(USMUserEntry.USM_SECURITY_MODEL); |
where USM_SECURITY_MODEL = 3.
WebNMS SNMP Release 3.x also provides an Access Control Framework where
API users can plug-in their implementation of Access Control Model, to
be used in SNMPV3 Access Control SubSystem. WebNMS SNMP API provides View
Based Access Control Model (VACM) as a default implementation for the
Access Control Framework. The VACM is also registered as the default Access
Control Model. This is available as a separate package called com.adventnet.snmp.snmp2.vacm.![]()
The existing API users using release 2.2 will require some changes in their application. This is limited to importing the com.adventnet.snmp.snmp2.vacm. package.
i.e the existing 2.x applications will have to add the following line in their imports.
import com.adventnet.snmp.snmp2.vacm.*; |
|