com.adventnet.snmp.snmp2.agent
Class BaseForwardingTable

java.lang.Object
  |
  +--com.adventnet.snmp.snmp2.agent.BaseForwardingTable
Direct Known Subclasses:
ForwardingTable

public abstract class BaseForwardingTable
extends java.lang.Object
implements TrapForwardingTableInterface

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

This class implements the TrapForwardingTableInterface. Both ForwardingTable and MicroForwardingTable extends this class and make use of the methods available in this class.

See Also:
ForwardingTable, MicroForwardingTable, ForwardingEntry

Field Summary
(package private)  ForwardingEntry forEntry
           
(package private)  java.util.Vector forVec
           
(package private)  boolean modified
           
(package private)  BaseSnmpTrapService trapListener
           
 
Constructor Summary
BaseForwardingTable()
          Empty Constructor
BaseForwardingTable(BaseSnmpTrapService service)
          The Default Constructor without persistence storage option.
 
Method Summary
 boolean addForwardingEntry(ForwardingEntry entry)
          Method to add an Entry to this Table.
 ForwardingEntry getForwardingEntry(int ind)
          Getter for the Entry at the speified index.
 ForwardingEntry getForwardingEntry(java.lang.String host, int port)
          Method to get the available entry by specyfing the Host and Port values.
 ForwardingEntry getForwardingEntryInstance()
          Method to retieve a new ForwardingEntry Object.
 int getNumRows()
          Getters for the number of rows in this Table.
 java.util.Vector getTableVector()
          Getter for the Vector of ForwardingEntries associated with this Table.
 java.lang.String getV1v2ManagerHost(int ind)
          Getter for the Targetted Manager Host.
 int getV1v2ManagerPort(int ind)
          Getter for the Targetted Manager Port.
 int getV1v2ManagerStatus(int ind)
          Getter for the Entry Status.
 boolean isModified()
          This method is for the FailOver support.
 void setModified(boolean isModified)
          This method is to set the FailOver Flag.
 void setTableVector(java.util.Vector tableVector)
          Setter of the Vector of ForwardingEntries to this Table.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trapListener

BaseSnmpTrapService trapListener

forEntry

ForwardingEntry forEntry

modified

boolean modified

forVec

java.util.Vector forVec
Constructor Detail

BaseForwardingTable

public BaseForwardingTable()
Empty Constructor

BaseForwardingTable

public BaseForwardingTable(BaseSnmpTrapService service)
The Default Constructor without persistence storage option.
Parameters:
service - the BaseSnmpTrapService.
Method Detail

addForwardingEntry

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

getForwardingEntry

public ForwardingEntry getForwardingEntry(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

getTableVector

public java.util.Vector getTableVector()
Getter for the Vector of ForwardingEntries associated with this Table.
Returns:
The Vector of ForwardingEntries.
See Also:
setTableVector(Vector tableVector)

setTableVector

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

getForwardingEntryInstance

public ForwardingEntry getForwardingEntryInstance()
Method to retieve a new ForwardingEntry Object.
Returns:
The new ForwardingEntry Object.

getNumRows

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

getV1v2ManagerHost

public java.lang.String getV1v2ManagerHost(int ind)
Getter for the Targetted Manager Host. Implementation of the TrapForwardingTableInterface.
Specified by:
getV1v2ManagerHost in interface TrapForwardingTableInterface
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.

getV1v2ManagerPort

public int getV1v2ManagerPort(int ind)
Getter for the Targetted Manager Port. Implementation of the TrapForwardingTableInterface.
Specified by:
getV1v2ManagerPort in interface TrapForwardingTableInterface
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.

getV1v2ManagerStatus

public int getV1v2ManagerStatus(int ind)
Getter for the Entry Status. Implementation of the TrapForwardingTableInterface.
Specified by:
getV1v2ManagerStatus in interface TrapForwardingTableInterface
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.

getForwardingEntry

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

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.
See Also:
isModified()

isModified

public boolean isModified()
This method is for the FailOver support.
Returns:
Returns the boolean stating whether the Table has been modified remotely.
See Also:
setModified(boolean isModified)