|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.adventnet.snmp.snmp2.SecurityModelTable
|
+--com.adventnet.snmp.snmp2.usm.USMUserTable
This class maintains a list of all USMUserEntry objects and provides methods to operate on the list. Methods are provided to add, retrieve, modify and remove USMUserEntry objects. The API user need not instantiate this class explicitly. He has to create this table from the security provider by using the method SecurityProvider.createTable(int model) where model is the security model number. The SecurityProvider has the method getTable to get this table reference. Once a new USMUserEntry object is created, it has to be added to the USMUserTable, using the add method provided.
This class also provides methods to serialize and deSerialize the list of USMUserEntry objects. The USMUserEntry objects are always serialized in the file UserEntry.ser. The serialization will not work in case of applets using the serialization methods. This will be fixed in the future release.
USMUserEntry,
SnmpAPI, Serialized Form| Field Summary | |
(package private) static int |
AUTHKEY
|
(package private) static int |
AUTHPASSWORD
|
(package private) static int |
AUTHPROTOCOL
|
(package private) boolean |
dBaseFlag
Database flag for this SnmpAPI instance |
(package private) static int |
DBKEY
|
(package private) com.adventnet.utils.DatabaseOperations |
dbOps
|
(package private) static int |
ENGINEBOOTS
|
(package private) static int |
ENGINEID
|
(package private) static int |
ENGINENAME
|
(package private) static int |
ENGINETIME
|
(package private) com.adventnet.utils.DatabaseTableParams |
engParams
|
(package private) static int |
HOST
|
(package private) static int |
LATESTRCVDENGTIME
|
(package private) static int |
LOCALTIME
|
(package private) static int |
PORT
|
(package private) static int |
PRIVKEY
|
(package private) static int |
PRIVPASSWORD
|
(package private) static int |
PRIVPROTOCOL
|
(package private) static int |
SECURITYLEVEL
|
(package private) static int |
SECURITYNAME
|
(package private) static java.lang.String |
serUserFileName
|
(package private) static int |
USERNAME
|
(package private) java.util.Hashtable |
userTable
|
(package private) com.adventnet.utils.DatabaseTableParams |
usmParams
|
(package private) boolean |
v3ConfigFlag
|
| Constructor Summary | |
USMUserTable()
|
|
| Method Summary | |
boolean |
addEntry(SecurityModelEntry entry)
Adds the USMUserEntry object to the list of USMUserEntry objects maintained in this class. |
(package private) java.lang.String |
convertString(java.lang.String str)
|
void |
deSerialize()
DeSerializes the file "UserEnrty.ser", to get a list of USMUserEntry objects. |
void |
deSerialize(java.io.ObjectInputStream in)
DeSerializes the USMUserEntry objects, from the particular input Stream to the list of USMUserEntry objects. |
(package private) static byte[] |
getBytes(java.lang.String s)
|
(package private) static java.lang.String |
getByteString(byte[] array,
int offset,
int length)
|
java.util.Vector |
getEntries(java.lang.String host,
int port)
Returns, the Vector containing list of USMUserEntry objects corresponding to a particular SnmpV3 entity. |
USMUserEntry |
getEntry(byte[] name,
byte[] id)
Returns the USMUserEntry corresponding to the username and engineID. |
SecurityModelEntry |
getEntry(java.lang.Object key)
Returns, the SecurityModelEntry for the particular 'key' that is given as an argument. |
java.util.Enumeration |
getEnumeration()
Returns an enumeration of all the USMUserEntry objects maintained in this class. |
java.util.Vector |
getHashTableEntry(java.lang.String host,
int port)
Returns, the Vector containing list of USMUserEntry objects corresponding to a particular SnmpV3 entity. |
boolean |
isV3DatabaseFlag()
Gets the Database flag for this SnmpAPI instance. |
boolean |
modifyEntry(SecurityModelEntry entry)
Modifies the corresponding USMUserEntry object in the list of USMUserEntry objects. |
(package private) byte[] |
modifySendBytes(byte[] bytes)
|
void |
readFromDatabase()
Gets a list of USMUserEntry objects and puts it in the hashtable. |
void |
removeAllEntries()
Deletes all the USMUserEntry objects maintained in this class. |
boolean |
removeEntry(byte[] name,
byte[] id)
Deletes the USMUserEntry corresponding to the userName and engineID, from the list of USMUserEntry objects. |
boolean |
removeEntry(SecurityModelEntry entry)
Deletes this particlar USMUserEntry object, from the list of USMUserEntry objects. |
void |
serialize()
Stores the list of USMUSerEntry objects in the serialized file "UseEntry.ser" |
void |
serialize(java.io.ObjectOutputStream out)
Serializes the list of USMUserEntry objects into particular output Stream specified. |
protected void |
setDBOperations(com.adventnet.utils.DatabaseOperations db)
All the Database operations will be performed only through this instance. |
void |
setV3ConfigFlag(boolean configFlag)
Sets the V3 configuration flag. |
void |
setV3DatabaseFlag(boolean dbFlag)
Sets the Database flag. |
(package private) void |
updateEngineEntries(SnmpEngineEntry snmpEntry)
Updates the USMUserEntry objects for the particular EngineID to relate to the new SnmpEngineEntry object. |
void |
writeToDatabase()
Stores the list of USMUSerEntry objects in the database. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
static final int DBKEY
static final int HOST
static final int PORT
static final int ENGINENAME
static final int ENGINEID
static final int USERNAME
static final int SECURITYLEVEL
static final int SECURITYNAME
static final int AUTHPROTOCOL
static final int AUTHPASSWORD
static final int AUTHKEY
static final int PRIVPROTOCOL
static final int PRIVPASSWORD
static final int PRIVKEY
static final int ENGINETIME
static final int ENGINEBOOTS
static final int LATESTRCVDENGTIME
static final int LOCALTIME
java.util.Hashtable userTable
static final java.lang.String serUserFileName
com.adventnet.utils.DatabaseOperations dbOps
com.adventnet.utils.DatabaseTableParams usmParams
com.adventnet.utils.DatabaseTableParams engParams
boolean dBaseFlag
boolean v3ConfigFlag
| Constructor Detail |
public USMUserTable()
| Method Detail |
protected void setDBOperations(com.adventnet.utils.DatabaseOperations db)
db - the instance of the implemented "DatabaseOperations" class.
This is a dummy implemented method. API users who do database
operations can overwrite this method.public java.util.Enumeration getEnumeration()
public void removeAllEntries()
public java.util.Vector getHashTableEntry(java.lang.String host,
int port)
host - The hostName corresponding to the UserEntry created.port - The port corresponding to the UserEntry created.
public java.util.Vector getEntries(java.lang.String host,
int port)
host - The hostName corresponding to the UserEntry created.port - The port corresponding to the UserEntry created.public void setV3DatabaseFlag(boolean dbFlag)
dbFlag - the database flag to be set on this SnmpAPI instance.public boolean isV3DatabaseFlag()
public void setV3ConfigFlag(boolean configFlag)
configFlag - the boolean value to be set. By default
this flag is false.public boolean addEntry(SecurityModelEntry entry)
entry - The USMUserEntry which needs to be added to the list
of USMUserEntry objects.public boolean modifyEntry(SecurityModelEntry entry)
entry - The USMUserEnrty that is to be modified.public SecurityModelEntry getEntry(java.lang.Object key)
public USMUserEntry getEntry(byte[] name,
byte[] id)
public boolean removeEntry(byte[] name,
byte[] id)
name - The userName for which the USMUserEntry object is to
be deleted.id - The engineID for which the USMUserEntry object is to
be deleted.public boolean removeEntry(SecurityModelEntry entry)
entry - The USMUserEntry object that is to be deleted.void updateEngineEntries(SnmpEngineEntry snmpEntry)
public void serialize()
public void deSerialize()
public void serialize(java.io.ObjectOutputStream out)
out - The ObjectOutputStream for serializationpublic void deSerialize(java.io.ObjectInputStream in)
in - The ObjectInputStream for deSerializationpublic void writeToDatabase()
public void readFromDatabase()
throws java.sql.SQLException
byte[] modifySendBytes(byte[] bytes)
static byte[] getBytes(java.lang.String s)
static java.lang.String getByteString(byte[] array,
int offset,
int length)
java.lang.String convertString(java.lang.String str)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||