com.adventnet.snmp.snmp2.agent
Class V3ForwardingTable

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

public class V3ForwardingTable
extends java.lang.Object
implements V3TrapForwardingTableInterface

This class has the Informations about the V3 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 V3ForwardingTable entries.
  • This class implements the V3TrapForwardingTableInterface.

    See Also:
    V3ForwardingEntry

    Field Summary
    (package private)  java.lang.String fileName
               
    (package private)  boolean modified
               
    (package private)  boolean storage
               
    (package private)  java.lang.String storageType
               
    (package private)  SnmpTrapService trapListener
               
    (package private)  V3ForwardingEntry v3ForEntry
               
    (package private)  java.util.Vector v3ForVec
               
    (package private)  V3XMLToVector writer
               
     
    Constructor Summary
    V3ForwardingTable(SnmpTrapService service)
              The Default Constructor without persistence storage option.
    V3ForwardingTable(SnmpTrapService service, java.lang.String name, java.lang.String format)
              The Constructor with the Persistnece details.
     
    Method Summary
     boolean addV3ForwardingEntry(V3ForwardingEntry entry)
              Method to add an Entry to this Table.
     java.lang.String getFileName()
              Getter for the FileName where the Entries are stored.
     ForwardingEntry getForwardingEntry(int index)
              Dummy Method - not relevant to V3ForwardingTable
     java.lang.String getManagerHost(int ind)
              Getter for the Targetted Manager Host.
     int getManagerPort(int ind)
              Getter for the Targetted Manager Port.
     int getNumRows()
              Getters for the number of rows in this Table.
     int getRowStatus(int ind)
              Getter for the Entry Status.
     java.lang.String getStorageString()
              Method to get the StorageType String.
     java.util.Vector getTableVector()
              Getter for the Vector of V3ForwardingEntries associated with this Table.
     java.lang.String getV1v2ManagerHost(int index)
              Dummy Method - not relevant to V3ForwardingTable
     int getV1v2ManagerPort(int index)
              Dummy Method - not relevant to V3ForwardingTable
     int getV1v2ManagerStatus(int index)
              Dummy Method - not relevant to V3ForwardingTable
     V3ForwardingEntry getV3ForwardingEntry(int ind)
              Getter for the Entry at the speified index.
     V3ForwardingEntry getV3ForwardingEntry(java.lang.String host, int port)
              Method to get the available entry by specyfing the Host and Port values.
     V3ForwardingEntry getV3ForwardingEntryInstance()
              Method to retieve a new V3ForwardingEntry Object.
     java.lang.String getV3ManagerUserContextName(int ind)
              Getter for V3 Manager User ContextName.
     java.lang.String getV3ManagerUserName(int ind)
              Getter for V3 Manager UserName.
     int getV3ManagerUserSecModel(int ind)
              Getter for V3 Manager User security model.
     int getV3SecurityLevel(int ind)
              Getter for V3 Manager security level.
     V3XMLToVector getV3XMLToVector()
              Getter for the V3XMLToVector associated with this class.
     boolean isModified()
              This method is for the FailOver support.
     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 setModified(boolean isModified)
              This method is to set the FailOver Flag.
     void setStorage(boolean isStorage)
              Method to specify the storage on.
     void setStorageString(java.lang.String type)
              Setter for the StorageType String.
     void setTableVector(java.util.Vector tableVector)
              Setter of the Vector of V3ForwardingEntries to this Table.
     void storeData()
              This method will be called after the addition of an Entry in the V3TrapForwardingTable 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 java.lang.Object
    , clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    trapListener

    SnmpTrapService trapListener

    v3ForEntry

    V3ForwardingEntry v3ForEntry

    storage

    boolean storage

    storageType

    java.lang.String storageType

    fileName

    java.lang.String fileName

    modified

    boolean modified

    writer

    V3XMLToVector writer

    v3ForVec

    java.util.Vector v3ForVec
    Constructor Detail

    V3ForwardingTable

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

    V3ForwardingTable

    public V3ForwardingTable(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

    addV3ForwardingEntry

    public boolean addV3ForwardingEntry(V3ForwardingEntry entry)
    Method to add an Entry to this Table.
    Parameters:
    entry - The V3ForwardingEntry to be added.
    Returns:
    boolean true if the entry is added else a false.

    getV3ForwardingEntry

    public V3ForwardingEntry getV3ForwardingEntry(java.lang.String host,
                                                  int port)
    Method to get the available entry by specyfing the Host and Port values.
    Parameters:
    host - The Target host of the entry to be got.
    port - The Target port of the entry to be got.
    Returns:
    The ForwardingEntry for the specified Host and port if present else a null

    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").

    storeData

    public void storeData()
    This method will be called after the addition of an Entry in the V3TrapForwardingTable 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()
    Getter for the Vector of V3ForwardingEntries associated with this Table.
    Returns:
    The Vector of V3ForwardingEntries.
    See Also:
    setTableVector(Vector tableVector)

    setTableVector

    public void setTableVector(java.util.Vector tableVector)
    Setter of the Vector of V3ForwardingEntries to this Table.
    Parameters:
    tableVector - The Vector of V3ForwardingEntry objects sorted according to their instance.
    See Also:
    getTableVector()

    getV3ForwardingEntryInstance

    public V3ForwardingEntry getV3ForwardingEntryInstance()
    Method to retieve a new V3ForwardingEntry Object.
    Returns:
    The new V3ForwardingEntry Object.

    isStorage

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

    getV3XMLToVector

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

    getNumRows

    public int getNumRows()
    Getters for the number of rows in this Table. Implementation of the TrapForwardingTableInterface.
    Specified by:
    getNumRows in interface V3TrapForwardingTableInterface
    Returns:
    The number of rows.

    getManagerHost

    public java.lang.String getManagerHost(int ind)
    Getter for the Targetted Manager Host. Implementation of the TrapForwardingTableInterface.
    Specified by:
    getManagerHost in interface V3TrapForwardingTableInterface
    Parameters:
    ind - The int index of the Entry for which the Host is to be retrieved.
    Returns:
    The manager Host requested, null if the ind does not exist.

    getManagerPort

    public int getManagerPort(int ind)
    Getter for the Targetted Manager Port. Implementation of the TrapForwardingTableInterface.
    Specified by:
    getManagerPort in interface V3TrapForwardingTableInterface
    Parameters:
    ind - The int index of the Entry for which the port is to be retrieved.
    Returns:
    The manager port requested, -1 if the ind does not exist.

    getRowStatus

    public int getRowStatus(int ind)
    Getter for the Entry Status. Implementation of the TrapForwardingTableInterface.
    Specified by:
    getRowStatus in interface V3TrapForwardingTableInterface
    Parameters:
    ind - The int index of the Entry for which the Status is to be retrieved.
    Returns:
    The Entry Status requested, -1 if the ind does not exist.

    getV3ManagerUserName

    public java.lang.String getV3ManagerUserName(int ind)
    Description copied from interface: V3TrapForwardingTableInterface
    Getter for V3 Manager UserName.
    Specified by:
    getV3ManagerUserName in interface V3TrapForwardingTableInterface
    Tags copied from interface: V3TrapForwardingTableInterface
    Parameters:
    index - The value to specify the entry for which the V3 Manager Username is required.
    Returns:
    The V3 Manager UserName.

    getV3ManagerUserContextName

    public java.lang.String getV3ManagerUserContextName(int ind)
    Description copied from interface: V3TrapForwardingTableInterface
    Getter for V3 Manager User ContextName.
    Specified by:
    getV3ManagerUserContextName in interface V3TrapForwardingTableInterface
    Tags copied from interface: V3TrapForwardingTableInterface
    Parameters:
    index - The Value to specify the entry for which the V3 Manager User ContextName is required.
    Returns:
    The V3 Manager User ContextName.

    getV3ManagerUserSecModel

    public int getV3ManagerUserSecModel(int ind)
    Description copied from interface: V3TrapForwardingTableInterface
    Getter for V3 Manager User security model.
    Specified by:
    getV3ManagerUserSecModel in interface V3TrapForwardingTableInterface
    Tags copied from interface: V3TrapForwardingTableInterface
    Parameters:
    index - The Value of the Entry for which the V3 Manager User security Model is needed.
    Returns:
    The V3 Manager User Security Model Value.

    getV3SecurityLevel

    public int getV3SecurityLevel(int ind)
    Description copied from interface: V3TrapForwardingTableInterface
    Getter for V3 Manager security level.
    Specified by:
    getV3SecurityLevel in interface V3TrapForwardingTableInterface
    Tags copied from interface: V3TrapForwardingTableInterface
    Parameters:
    index - The Value to specify the Entry for which the V3 manager Security Level is needed.
    Returns:
    The V3 Manager Security Level Value.

    getV3ForwardingEntry

    public V3ForwardingEntry getV3ForwardingEntry(int ind)
    Getter for the Entry at the speified index. Implementation of the V3TrapForwardingTableInterface.
    Specified by:
    getV3ForwardingEntry in interface V3TrapForwardingTableInterface
    Parameters:
    ind - The int index of the Entry which is to be retrieved.
    Returns:
    The Entry requested.

    getV1v2ManagerHost

    public java.lang.String getV1v2ManagerHost(int index)
    Dummy Method - not relevant to V3ForwardingTable
    Returns:
    null

    getV1v2ManagerPort

    public int getV1v2ManagerPort(int index)
    Dummy Method - not relevant to V3ForwardingTable
    Returns:
    -1

    getV1v2ManagerStatus

    public int getV1v2ManagerStatus(int index)
    Dummy Method - not relevant to V3ForwardingTable
    Returns:
    -1

    getForwardingEntry

    public ForwardingEntry getForwardingEntry(int index)
    Dummy Method - not relevant to V3ForwardingTable
    Returns:
    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()

    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.