|
|||||||||
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 FormConstructor Summary | |
USMUserTable()
|
Method Summary | |
boolean |
addEntry(SecurityModelEntry entry)
Adds the USMUserEntry object to the list of USMUserEntry objects maintained in this class. |
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. |
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. |
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. |
void |
writeToDatabase()
Stores the list of USMUSerEntry objects in the database. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public USMUserTable()
Method Detail |
protected void setDBOperations(com.adventnet.utils.DatabaseOperations db)
setDBOperations
in class SecurityModelTable
com.adventnet.snmp.snmp2.SecurityModelTable
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()
getEnumeration
in class SecurityModelTable
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 void setV3DatabaseFlag(boolean dbFlag)
setV3DatabaseFlag
in class SecurityModelTable
dbFlag
- the database flag to be set on this SnmpAPI instance.public boolean isV3DatabaseFlag()
public void setV3ConfigFlag(boolean configFlag)
setV3ConfigFlag
in class SecurityModelTable
configFlag
- the boolean value to be set. By default
this flag is false.public boolean addEntry(SecurityModelEntry entry)
addEntry
in class SecurityModelTable
entry
- The USMUserEntry which needs to be added to the list
of USMUserEntry objects.public boolean modifyEntry(SecurityModelEntry entry)
modifyEntry
in class SecurityModelTable
entry
- The USMUserEnrty that is to be modified.public SecurityModelEntry getEntry(java.lang.Object key)
getEntry
in class SecurityModelTable
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)
removeEntry
in class SecurityModelTable
entry
- The USMUserEntry object that is to be deleted.public void serialize()
public void deSerialize()
public void serialize(java.io.ObjectOutputStream out)
serialize
in class SecurityModelTable
out
- The ObjectOutputStream for serializationpublic void deSerialize(java.io.ObjectInputStream in)
deSerialize
in class SecurityModelTable
in
- The ObjectInputStream for deSerializationpublic void writeToDatabase()
public void readFromDatabase() throws java.sql.SQLException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |