|
"WEBNMS_5 API Docs" | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.adventnet.db.PopulateUserTable
public class PopulateUserTable
This is a Utility class used for populating/deleting the entries in the USERTABLE of the database. The USERTABLE stores the information like host name, port,securitylevel,AuthProtocol,PrivProtocol, PrivPassword,AuthPassword of the SnmpV3 Device which has to be discovered.Internally Web NMS framework will use the USERTABLE Table in the database to get the security level details of the SnmpV3 device during the Discovery process.This utility class should be use to populate/delete the entries for SnmpV3 device in the USERTABLE in the same JVM in which the NMS server is running.
The HOST column of the USERTABLE stores the
IPAddress of the SNMPV3 Agent to be discovered.The DBKEY column is the primary key of the
USERTABLE.The DBKEY column stores the combined information of the HOST,PORT and USERNAME
of the SNMPV3 device to be discovered.
The AUTHPROTOCOL and PRIVPROTOCOL column of the USERTABLE table in the database
will be populated with the constants depending upon the value assigned for the keys SECURITYLEVEL and
AUTHPROTOCOL set as the Properties Object argument passed to the
insertIntoUserTable(Properties prop,String[] ipArray) to populate the USERTABLE for SNMPV3 hosts
Here are some examples to state how the AUTHPROTOCOL and PRIVPROTOCOL columns of the USERTABLE table will be populated
1) If the value set for the Key SECURITYLEVEL is "NoAuthNoPriv" in the Properties object, then the AUTHPROTOCOL column and PRIVPROTOCOL column of the USERTABLE table of the database will be populated with the value as 20 and 51 respectively.
2) if the value set for the key SECURITYLEVEL is "AuthNoPriv" and value set for the key AUTHPROTOCOL is "MD5" then the AUTHPROTOCOL column and PRIVPROTOCOL column of the USERTABLE table of the database will be populated with the value as 21 and 51 respectively.
3) if the value set for the key SECURITYLEVEL is "AuthNoPriv" and value set for the key AUTHPROTOCOL is "SHA" then the AUTHPROTOCOL column and PRIVPROTOCOL column of the USERTABLE table of the database will be populated with the value as 22 and 51 respectively.
4) if the value set for the key SECURITYLEVEL is "AuthPriv" and value set for the key AUTHPROTOCOL is "MD5" then the AUTHPROTOCOL column and PRIVPROTOCOL column of the USERTABLE table of the database will be populated with the value as 21 and 50 respectively.
5) if the value set for the key SECURITYLEVEL is "AuthNoPriv" and value set for the key AUTHPROTOCOL is "SHA" then the AUTHPROTOCOL column and PRIVPROTOCOL column of the USERTABLE table of the database will be populated with the value as 22 and 50 respectively.
| Constructor Summary | |
|---|---|
PopulateUserTable()
Constructor to instantiate the PopulateUserTable. |
|
| Method Summary | |
|---|---|
void |
deleteFromUserTable(java.lang.String[] ipString)
This method is used to delete the entry from the USERTABLE for the given IpAddress of the SNMPV3 hosts in the database |
static PopulateUserTable |
getInstance()
This method can be used to get the instance of PopulateUserTable |
void |
insertIntoUserTable(java.util.Properties prop,
java.lang.String[] ipArray)
This method is used to populate the USERTABLE table in the database with the snmpv3 properties given for the ipAddress of the SNMPV3 hosts. |
boolean |
isInitialized()
Returns whether the PopulateUserTable has been initialized or not. |
java.util.Vector |
selectFromUserTable(java.lang.String host)
This method is used for internal Framework . |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PopulateUserTable()
| Method Detail |
|---|
public static PopulateUserTable getInstance()
public boolean isInitialized()
public java.util.Vector selectFromUserTable(java.lang.String host)
public void deleteFromUserTable(java.lang.String[] ipString)
ipString - Array which contains the IpAddress of the SNMPV3 hosts
to be deleted from the USERTABLE table in the database.
java.sql.SQLException - if a database access error occurs
during the delete operation in the database.
public void insertIntoUserTable(java.util.Properties prop,
java.lang.String[] ipArray)
The following code snippet explains the usage of this method:
String hostIpaddress[]= {"192.168.111.180"};
Properties pro=new Properties();
pro.put("SNMPAGENTPORT","161");
pro.put("SECURITYLEVEL","AuthPriv");
pro.put("AUTHPROTOCOL","MD5");
pro.put("PRIVPROTOCOL","CBC-DES");
pro.put("USERNAME","authUser");
pro.put("AUTHPASSWORD","authUser");
pro.put("PRIVPASSWORD","privUser");
populateUserTable.insertIntoUserTable(pro,hostIpaddress);
The above code snippet will populate the USERTABLE for the host 192.168.111.180 with the properties given.
The DBKEY column of the USERTABLE is the PRIMARY key of the USERTABLE database.It stores
the combined information of the HOST,PORT and USERNAME separated by ## .For the above code snippet
you will find the DBKEY column of the USERTABLE table of the database populated with the
value as 192.168.111.180##161##authUser.
If the PopulateUserTable has not be initialized ,then this method will not populate the USERTABLE
table of the database.
To check if the PopulateUserTable object has been initialized use of the isInitialized() method
to check if the PopulateUserTable object has been initialized.This method returns true if the PopulateUserTable
has been initialized properly
prop - (key,value)pairs to be set as snmpv3 properties for the given hostsipArray - Array which contains the IpAddress of the SNMPV3 hosts for which the USERTABLE
should be populated with snmpv3 properties.If this array object is null or if its length=0 then
java.sql.SQLException - if database base access occurs during the
Insert opertion in the database.
|
"WEBNMS_5 API Docs" | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||