com.adventnet.snmp.snmp2.agent
Class VaclTable

java.lang.Object
  extended by com.adventnet.snmp.snmp2.agent.VaclTable

public class VaclTable
extends java.lang.Object

This class is to provide common View 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 Vacl Entries in the UserPreferred format - XML, Text File and Runtime Memory.


    Field Summary
    (package private)  SnmpAgent agentName
               
    (package private)  java.lang.String fileName
               
    (package private)  boolean modified
               
    (package private)  boolean storage
               
    (package private)  java.lang.String storageType
               
    (package private)  VaclEntry vaclEntry
               
    (package private)  java.util.Vector vaclVec
               
    (package private)  VaclTableXMLToVector vaclWriter
               
     
    Constructor Summary
    VaclTable(SnmpAgent agentRef)
               
    VaclTable(SnmpAgent agentRef, java.lang.String name, java.lang.String format)
              The Constructor with persistence storage option.
     
    Method Summary
     boolean addVaclEntry(VaclEntry entry)
              This method Adds the given entry to the Agent ViewAccessControlTable.
     boolean checkExternalAclCommunity(java.lang.String community)
              Method to check the External Index availabilty.
     java.util.Vector getTableVector()
              Method to retrieve the number of Entries in the VaclTable.
     VaclEntry getVaclEntry(java.lang.String community)
              The method to get the VaclEntry instance corresponding to the given community String.
     VaclEntry getVaclEntryInstance()
              This method will be called for all VaclEntry instance creation.
     VaclTableXMLToVector getVaclTableXMLToVector()
              Method to get the VaclTableXMLToVector instance associated with this class.
     boolean isModified()
              This method is for the FailOver support.
     boolean isStorage()
              Method to know whether this class has storage option or not.
     void removeAccess(VaclEntry entry)
              Method to remove ViewAccess for the Entry that is removed from this Table.
     void setAccess(VaclEntry entry)
              Method to set the ViewAccess for the Entry that is added to this Table.
     void setModified(boolean isModified)
              This method is to set the FailOver Flag.
     void setStorage(boolean isStorage)
              Method to set the Storage option on or off.
     void setTableVector(java.util.Vector tableVector)
              Method to set the Vector of VaclEntries.
     void storeData()
              This method will be called after the addition of an Entry in the VaclTable 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 java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    agentName

    SnmpAgent agentName

    vaclEntry

    VaclEntry vaclEntry

    vaclWriter

    VaclTableXMLToVector vaclWriter

    storage

    boolean storage

    storageType

    java.lang.String storageType

    fileName

    java.lang.String fileName

    modified

    boolean modified

    vaclVec

    java.util.Vector vaclVec
    Constructor Detail

    VaclTable

    public VaclTable(SnmpAgent agentRef)

    VaclTable

    public VaclTable(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-ViewAccessControlTable.xml
    format - The file format default will be "xml"(eg., "Text" for Flat Text File format)
    Method Detail

    addVaclEntry

    public boolean addVaclEntry(VaclEntry entry)
    This method Adds the given entry to the Agent ViewAccessControlTable.

    Parameters:
    entry - The VaclEntry instance.
    Returns:
    boolean specifying whether the entry is successfully added or not.

    getVaclEntry

    public VaclEntry getVaclEntry(java.lang.String community)
    The method to get the VaclEntry instance corresponding to the given community String.

    Parameters:
    community - The community String for the entry to be retrieved.
    Returns:
    The VaclEntry if present else a null.

    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 VaclTable 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.


    getTableVector

    public java.util.Vector getTableVector()
    Method to retrieve the number of Entries in the VaclTable.

    Returns:
    The Vector of VaclEntry Objects.

    setTableVector

    public void setTableVector(java.util.Vector tableVector)
    Method to set the Vector of VaclEntries.

    Parameters:
    tableVector - - the Vector containing VaclEntry Objects sorted according to their Instance.

    getVaclEntryInstance

    public VaclEntry getVaclEntryInstance()
    This method will be called for all VaclEntry instance creation.

    Returns:
    The new AclEntry Object.

    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.

    getVaclTableXMLToVector

    public VaclTableXMLToVector getVaclTableXMLToVector()
    Method to get the VaclTableXMLToVector instance associated with this class.

    Returns:
    the VaclTableXMLToVector instance if exists else a null.

    setAccess

    public void setAccess(VaclEntry entry)
    Method to set the ViewAccess for the Entry that is added to this Table. API users need not use this method.

    Parameters:
    entry - the VaclEntry for which the View Based Access is to be set.

    removeAccess

    public void removeAccess(VaclEntry entry)
    Method to remove ViewAccess for the Entry that is removed from this Table. API users need not use this method.

    Parameters:
    entry - the VaclEntry for which the View Based Access is to be set.

    checkExternalAclCommunity

    public boolean checkExternalAclCommunity(java.lang.String community)
    Method to check the External Index availabilty. API Users might not use this method.

    Parameters:
    community - the Community to be checked for external Index availablility
    Returns:
    boolean true if external Index exists else a false.

    setModified

    public void setModified(boolean isModified)
    This method is to set the FailOver Flag. API Users neednot use this method.

    Parameters:
    isModified - The boolean specifying wheteher the Table Entries were changed.

    isModified

    public boolean isModified()
    This method is for the FailOver support.

    Returns:
    Returns the boolean stating whether the Table has been modified remotely.