|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.adventnet.snmp.snmp2.SecurityProvider
This class is used to register the appropriate security model to be used with AdventNet SNMP API. The API users need not instantiate this class. The SnmpAPI does it and provides method getSecurityProvider() to get the SecurityProvider reference. With this reference, the user has to register the appropriate securityModel using the registerSecurityModel method by specifying the security model number, securityModelTable and securityModelEntry class names. By default the USM security model is registered. So there is no need to register the USM security model.
Two abstract classes, SecurityModelEntry and SecurityModelTable are provided to implement a new Security Model. The SecurityModelEntry has abstract methods to encode/decode the messageSecurityParameters and authenticate the message to be sent/received. The SecurityModelEntry should be extended to provide security model specific attributes. The SecurityModelTable is used to mainatin a list of SecurityModel entries. For e.g In case of USM security model, the SecurityModelEntry will have userName, engineID, engineBoots, engineTime, authentication parameters and privacy parameters as attributes. Each user is identified by a SecurityModelEntry. The SecurityModelTable will have a list of these model entries for each user. The SecurityModelTable abstract class has abstract methods to add, delete and modify SecurityModel entries.
SecurityModelEntry
,
SecurityModelTable
Field Summary | |
static int |
ENTRY_CLASS
The offset values of the Table and Entry class names stored. |
static int |
TABLE_CLASS
The offset values of the Table and Entry class names stored. |
Method Summary | |
java.lang.Object |
createTable(int m)
Creates a new SecurityModelTable Object for the specific securityModel. |
java.lang.String[] |
getClassNames(int model)
Returns the SecurityModelTable and SecurityModelEntry class names as an array of strings. |
java.lang.Object |
getTable(int m)
Returns the SecurityModelTable as an object for a given security model. |
boolean |
isSupportedSecurityModel(int m)
Specifies if a particular security model is supported or not. |
boolean |
registerSecurityModel(int m,
java.lang.String tableClassName,
java.lang.String entryClassName)
Registers a particular security model to be used. |
boolean |
unRegisterSecurityModel(int m)
Unregisters a supported security model. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TABLE_CLASS
public static final int ENTRY_CLASS
Method Detail |
public java.lang.Object createTable(int m) throws SnmpException
SnmpException
- appropriate SecurityModelTable object
instance could not be created.getTable(int)
public java.lang.Object getTable(int m)
public boolean registerSecurityModel(int m, java.lang.String tableClassName, java.lang.String entryClassName)
m
- The securityModel number of the security model to be
registered.tableClassName
- The class name of the table class that
extends the SecurityModelTable.entryClassName
- The class name of the entry class that
extends the SecurityModelEntry.public boolean unRegisterSecurityModel(int m)
m
- The securityModel number to be unregistered.public boolean isSupportedSecurityModel(int m)
m
- The secuirty model number which needs to be checked if it
is supported.public java.lang.String[] getClassNames(int model)
model
- The security model for which the security model
table and entry class have to be retrived.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |