com.adventnet.snmp.snmp2
Class ACMProvider

java.lang.Object
  |
  +--com.adventnet.snmp.snmp2.ACMProvider

public class ACMProvider
extends java.lang.Object

This class is used to register the appropriate access control model to be used with AdventNet SNMP API. The API user does not need to instantiate this class. Instead the SnmpAPI instantiates it and provides the method 'getACMProvider()' to get the access control Provider reference. With this reference the user has to register the appropriate access control Model, using the registerAccessControlModel method by specifying the pdu type(v1/v2c/v3), and the acm implementation class names. By default the VACM is registered. So there is no need to register it again.

AdventNet SNMP API also provides an abstract class SnmpACM, which contains an abstract method isAccessAllowed. The SnmpACM should be extended to provide acm model specific attributes.

See Also:
SnmpACM

Method Summary
 java.lang.Object getAccessControlModel(int pduType)
          Returns the AccessControlModel Object which is registered.
 java.lang.String getClassName(int pduType)
          Returns the SnmpACM class names registered.
 java.lang.Object initACM(int pduType)
          Creates a new ACM Object for the specific access control Model.
 boolean isSupportedAccessControlModel(int pduType)
          Specifies if a particular acm model is supported or not.
 boolean registerAccessControlModel(int pduType, java.lang.String ACMClassName)
          Registers a particular ACM model to be used.
 boolean unRegisterAccessControlModel(int pduType)
          Unregisters a supported acm model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initACM

public java.lang.Object initACM(int pduType)
                         throws SnmpException
Creates a new ACM Object for the specific access control Model. A new ACM Object will be instantiated once for the SnmpACM class specified while registering the ACM Model. The API user should not instantiate an SnmpACM model. He should use the SnmpACM Object instance from this provider class. The SnmpACM Object instance can be got by the getAccessControlModel() method in this class.
Returns:
the appropriate ACM Object instantiated.
Throws:
SnmpException - appropriate ACM object instance could not be created.
See Also:
getAccessControlModel(int)

getAccessControlModel

public java.lang.Object getAccessControlModel(int pduType)
Returns the AccessControlModel Object which is registered.
Parameters:
pduType - The pduType for which the particular AccessControlModel is registered.
Returns:
the AccessControlModel Object which is registered. Null if the AccessControlModel object is not created.

registerAccessControlModel

public boolean registerAccessControlModel(int pduType,
                                          java.lang.String ACMClassName)
Registers a particular ACM model to be used. The class name of the ACM implementation class that extends the SnmpACM is required in addition to the pdu type for which the ACM is to be applied
Parameters:
pduType - The pdu type for which the access control is to to be applied.
ACMClassName - The class name of the acm class that extends the SnmpACM.
Returns:
true if the acm model is successfully registered. False otherwise.

unRegisterAccessControlModel

public boolean unRegisterAccessControlModel(int pduType)
Unregisters a supported acm model. This method unregisters a previously registered acm.
Parameters:
pduType - The pdu type for which the acm is to be unregistered.
Returns:
true if the specified acm model is successfully unregistered. false otherwise.

isSupportedAccessControlModel

public boolean isSupportedAccessControlModel(int pduType)
Specifies if a particular acm model is supported or not. Returns true if the acm model is supported. False otherwise.
Parameters:
pduType - The pdu type for which the acm model needs to be checked if it is supported.
Returns:
true if acm is registered. False otherwise.

getClassName

public java.lang.String getClassName(int pduType)
Returns the SnmpACM class names registered.
Parameters:
pduType - The pdu type for which the acm model class has to be retrived.
Returns:
the SnmpACM class names.


Copyright (c)AdventNet Inc., 1996-2004