com.adventnet.snmp.snmp2.agent
Class ForwardingTable

java.lang.Object
  |
  +--com.adventnet.snmp.snmp2.agent.BaseForwardingTable
        |
        +--com.adventnet.snmp.snmp2.agent.ForwardingTable

public class ForwardingTable
extends BaseForwardingTable

This class has the Informations about the V1V2 Trap Forwarding Entries. The SnmpTrapService configured with this Table sends Traps to all the Entries available in this Table.

  • This class includes persistence details of the ForwardingTable entries.
  • This class implements the TrapForwardingTableInterface.

    See Also:
    ForwardingEntry

    Field Summary
    (package private)  java.lang.String fileName
               
    (package private)  boolean storage
               
    (package private)  java.lang.String storageType
               
    (package private)  SnmpTrapService trapListener
               
    (package private)  XMLToVector writer
               
     
    Fields inherited from class com.adventnet.snmp.snmp2.agent.BaseForwardingTable
    forEntry, forVec, modified, trapListener
     
    Constructor Summary
    ForwardingTable(SnmpTrapService service)
              The Default Constructor without persistence storage option.
    ForwardingTable(SnmpTrapService service, java.lang.String name, java.lang.String format)
              The Constructor with the Persistnece details.
     
    Method Summary
     java.lang.String getFileName()
              Getter for the FileName where the Entries are stored.
     java.lang.String getStorageString()
              Method to get the StorageType String.
     XMLToVector getXMLToVector()
              Getter for the XMLToVector associated with this class.
     boolean isStorage()
              Getter to know whether this Table is persisted.
     void setFileName(java.lang.String name)
              Setter for the FileName where the Entries will be stored.
     void setStorage(boolean isStorage)
              Method to specify the storage on.
     void setStorageString(java.lang.String type)
              Setter for the StorageType String.
     void storeData()
              This method will be called after the addition of an Entry in the V1V2TrapForwardingTable so that the Entry will be persisted as per the StorageType.
    protected  void storeData(java.lang.String storageType)
              Method to specify the Storage Type.
     
    Methods inherited from class com.adventnet.snmp.snmp2.agent.BaseForwardingTable
    addForwardingEntry, getForwardingEntry, getForwardingEntry, getForwardingEntryInstance, getNumRows, getTableVector, getV1v2ManagerHost, getV1v2ManagerPort, getV1v2ManagerStatus, isModified, setModified, setTableVector
     
    Methods inherited from class java.lang.Object
    , clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    storage

    boolean storage

    storageType

    java.lang.String storageType

    fileName

    java.lang.String fileName

    trapListener

    SnmpTrapService trapListener

    writer

    XMLToVector writer
    Constructor Detail

    ForwardingTable

    public ForwardingTable(SnmpTrapService service)
    The Default Constructor without persistence storage option.
    Parameters:
    service - the SnmpTrapService.

    ForwardingTable

    public ForwardingTable(SnmpTrapService service,
                           java.lang.String name,
                           java.lang.String format)
    The Constructor with the Persistnece details.
    Parameters:
    service - The SnmpTrapService class instance.
    name - The file name where the entires are to be read and stored.
    format - The storage format. e.g.,"xml".
    Method Detail

    storeData

    protected void storeData(java.lang.String storageType)
    Method to specify the Storage Type. API Users may not need this method - use the constructor with the StorageType format specification.
    Parameters:
    storageType - - the String specifying the storage format("xml").

    isStorage

    public boolean isStorage()
    Getter to know whether this Table is persisted.
    Returns:
    boolean - true if the entries are stored else a false.

    getXMLToVector

    public XMLToVector getXMLToVector()
    Getter for the XMLToVector associated with this class.
    Returns:
    The XMLToVector instance if exists else a null.

    setFileName

    public void setFileName(java.lang.String name)
    Setter for the FileName where the Entries will be stored. API users may not need this method - can use the Constructor with the name arg.
    Parameters:
    name - the String specifying the Name of the File.
    See Also:
    getFileName()

    getFileName

    public java.lang.String getFileName()
    Getter for the FileName where the Entries are stored.
    Returns:
    the String specifying the Name of the File.
    See Also:
    setFileName(String name)

    setStorage

    public void setStorage(boolean isStorage)
    Method to specify the storage on. API users need not use this method.
    Parameters:
    isStorage - true on Stroage.
    See Also:
    isStorage()

    getStorageString

    public java.lang.String getStorageString()
    Method to get the StorageType String.
    Returns:
    String specifying the storage format. default - "xml"
    See Also:
    setStorageString(String type)

    setStorageString

    public void setStorageString(java.lang.String type)
    Setter for the StorageType String. API users may not need this method.
    Parameters:
    type - the StorageType String.
    See Also:
    getStorageString()

    storeData

    public void storeData()
    This method will be called after the addition of an Entry in the V1V2TrapForwardingTable 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.