com.adventnet.snmp.snmp2.agent
Class AclTable

java.lang.Object
  |
  +--com.adventnet.snmp.snmp2.agent.BaseAclTable
        |
        +--com.adventnet.snmp.snmp2.agent.AclTable

public class AclTable
extends BaseAclTable

This class is to provide common Acl Authentication to both the standalone SnmpAgent and multiprocol SnmpAgent - SnmpAdaptor

  • This class will be instantiated within the Generated AgentMain File.
  • This class provides methods to store the AclTable Entries in the UserPreferred format - XML, Text File and Runtime Memory.


    Field Summary
    (package private)  AclTableFileToVector aclWriter
               
    (package private)  SnmpAgent agentName
               
    (package private)  java.lang.String fileName
               
    (package private)  boolean storage
               
    (package private)  java.lang.String storageType
               
     
    Fields inherited from class com.adventnet.snmp.snmp2.agent.BaseAclTable
    aclEntry, aclVec, modified
     
    Constructor Summary
    AclTable(SnmpAgent agentRef)
              The Default Constructor without persistence storage option.
    AclTable(SnmpAgent agentRef, java.lang.String name, java.lang.String format)
              The Constructor with persistence storage option.
     
    Method Summary
     boolean addAclEntry(AclEntryInterface entry)
              This method Adds the given entry to the Agent Community Authentication Vector.
    protected  AclTableFileToVector getAclTableFileToVector()
              Method to get the AclTableFileToVector instance associated with this class.
     boolean isStorage()
              Method to know whether this class has storage option or not.
     void setStorage(boolean isStorage)
              Method to set the Storage option on or off.
     void storeData()
              This method will be called after the addition of an Entry in the AclTable so that the Entry will be persisted as per the StorageType.
    protected  void storeData(java.lang.String storageType)
              The method to store the Table entries in the specified format.
     
    Methods inherited from class com.adventnet.snmp.snmp2.agent.BaseAclTable
    getAclEntry, getAclEntryInstance, getTableVector, isModified, setModified, setTableVector
     
    Methods inherited from class java.lang.Object
    , clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    agentName

    SnmpAgent agentName

    storage

    boolean storage

    storageType

    java.lang.String storageType

    fileName

    java.lang.String fileName

    aclWriter

    AclTableFileToVector aclWriter
    Constructor Detail

    AclTable

    public AclTable(SnmpAgent agentRef)
    The Default Constructor without persistence storage option.
    Parameters:
    agentRef - the SnmpAgent Reference.

    AclTable

    public AclTable(SnmpAgent agentRef,
                    java.lang.String name,
                    java.lang.String format)
    The Constructor with persistence storage option.
    Parameters:
    agentRef - the SnmpAgent Reference.
    name - the fileName from where the entries are to be populated and stored, default will be-AccessControlTable.xml
    format - The file format default will be "xml"(eg., "Text" for Flat Text File format)
    Method Detail

    addAclEntry

    public boolean addAclEntry(AclEntryInterface entry)
    This method Adds the given entry to the Agent Community Authentication Vector.
    Overrides:
    addAclEntry in class BaseAclTable
    Parameters:
    entry - The AclEntry instance.
    Returns:
    boolean specifying whether the entry is successfully added or not.

    storeData

    protected void storeData(java.lang.String storageType)
    The method to store the Table entries in the specified format. API users need not use this method.
    Parameters:
    storageType - the StorageType string (eg., "xml" for XML storage).

    storeData

    public void storeData()
    This method will be called after the addition of an Entry in the AclTable so that the Entry will be persisted as per the StorageType. If the storage flag is not set prior to this, the Entries will not be persisted.

    isStorage

    public boolean isStorage()
    Method to know whether this class has storage option or not.
    Returns:
    boolean - true if storage has been set earlier else a false.

    setStorage

    public void setStorage(boolean isStorage)
    Method to set the Storage option on or off.
    Parameters:
    isStorage - - true to turn on the Storage option and false to turn off the same.

    getAclTableFileToVector

    protected AclTableFileToVector getAclTableFileToVector()
    Method to get the AclTableFileToVector instance associated with this class.
    Returns:
    the AclTableFileToVector instance if exists else a null.