org.friendlysnmp
Class FTable

java.lang.Object
  extended by org.friendlysnmp.FNode
      extended by org.friendlysnmp.FValueNode
          extended by org.friendlysnmp.FTable

public class FTable
extends FValueNode

This class hides access to org.snmp4j.agent.mo.MOTable
The objects of this class are generated by FriendlyPro tool.

Version:
$Revision: 1.33 $

Field Summary
 
Fields inherited from class org.friendlysnmp.FValueNode
persistLoaded
 
Fields inherited from class org.friendlysnmp.FNode
agent
 
Constructor Summary
FTable(java.lang.String name, org.snmp4j.agent.mo.MOTable moTable, AgentWorker agent, FColumn... column)
          Constructor.
 
Method Summary
 void addGetListener(FTableGetListener l)
           
 FID addRow(FID id)
          Adds row with specified row ID
 FID addRow(int... id)
          Adds row with specified row ID.
 FID addRowNext()
          Row ID is generated by increasing the max first integer and setting others (if exist) to 1.
 void addSetListener(FTableSetListener l)
          Registers the given observer to begin receiving "changed value" events when changes are made to the managed object.
 void addValidationListener(FTableValidationListener l)
          Registers the given observer to begin receiving "validation" events when changes are made to the managed object.
 void deleteAll()
          Deletes all rows.
 FID deleteRow(FID idRow)
          Deletes row from managed objects table.
 void fireGetEvent()
          Fires GET event
 FColumn getColumn(int index)
           
 int getColumnCount()
          Returns number of columns.
 FColumn[] getColumns()
           
 ValueSyntax getColumnSyntax(FColumn c)
           
 ValueSyntax getColumnSyntax(int index)
           
 org.snmp4j.agent.mo.MOTable getMOTable()
          Returns SNMP4J underlying managed object.
 int getRowCount()
          Returns rows count.
 FID getRowID(int indexRow)
          Finds row ID by row index.
 int getRowIndex(FID idRow)
          Finds row index specified by row ID.
 java.lang.Object getValueAt(FID idRow, FColumn col)
          Gets the value of specified cell.
 boolean isAccessibleForWrite()
           
 boolean isCellEditable(FID idRow, FColumn col)
          Checks the editable flag for the specified cell.
 boolean isVolatile()
          Returns volatile flag.
protected  void loadPersistValue()
          Loads persistent value into the scalar/table.
 void removeGetListener(FTableGetListener l)
           
 void removeSetListener(FTableSetListener l)
          Unregisters the given observer from the notification list so it will no longer receive change updates.
 void removeValidationListener(FTableValidationListener l)
          Unregisters the given observer to stop receiving "validation" events when changes are made to the managed object.
 void setAgent(AgentWorker agent)
          Sets the agent.
 void setDefaultValues(java.lang.Object... obj)
          Sets default cell values for a new row.
 void setValueAt(java.lang.Object obj, FID idRow, FColumn col)
          Sets the value for the specified cell.
protected  void setVolatilePrivate(boolean volatileTable)
          
 
Methods inherited from class org.friendlysnmp.FValueNode
addRestoreDefaultListener, fireRestoreDefaultEvent, isPersistLoaded, removeRestoreDefaultListener, setVolatile
 
Methods inherited from class org.friendlysnmp.FNode
getFID, getFIDtoString, getName, getOID, getOIDSize, getPersistStorage, throwFException, throwFException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FTable

public FTable(java.lang.String name,
              org.snmp4j.agent.mo.MOTable moTable,
              AgentWorker agent,
              FColumn... column)
Constructor.

Parameters:
name - node name as it is declared in a MIB file
moTable - table managed object
Method Detail

setAgent

public void setAgent(AgentWorker agent)
Description copied from class: FNode
Sets the agent.

Overrides:
setAgent in class FNode
Parameters:
agent - SNMP agent

setVolatilePrivate

protected void setVolatilePrivate(boolean volatileTable)

Specified by:
setVolatilePrivate in class FValueNode
See Also:
FValueNode.setVolatilePrivate(boolean)

isVolatile

public boolean isVolatile()
Returns volatile flag. Volatile objects are not stored in persistency storage after their modification via management protocol.

Specified by:
isVolatile in class FValueNode
Returns:
volatile flag
See Also:
FValueNode.isVolatile()

isAccessibleForWrite

public boolean isAccessibleForWrite()

getMOTable

public org.snmp4j.agent.mo.MOTable getMOTable()
Returns SNMP4J underlying managed object.

Returns:
the org.snmp4j.agent.mo.MOTable object this class is representing.

getRowCount

public int getRowCount()
Returns rows count.

Returns:
rows count

getRowID

public FID getRowID(int indexRow)
             throws FException
Finds row ID by row index.

Parameters:
indexRow - row index
Returns:
row ID
Throws:
FException

getRowIndex

public int getRowIndex(FID idRow)
Finds row index specified by row ID. Returns -1 if row does not exist.

Parameters:
idRow - row ID
Returns:
index of specified by row ID.

addRowNext

public FID addRowNext()
               throws FException
Row ID is generated by increasing the max first integer and setting others (if exist) to 1.

Returns:
row ID for newly created row
Throws:
FException

addRow

public FID addRow(int... id)
           throws FException
Adds row with specified row ID.

Parameters:
id - list of row integer indices.
Returns:
row ID of newly created row (the same as parameter).
Throws:
FException

addRow

public FID addRow(FID id)
           throws FException
Adds row with specified row ID

Parameters:
id - list of row integer indices
Returns:
row ID of newly created row (the same as parameter)
Throws:
FException

deleteRow

public FID deleteRow(FID idRow)
              throws FException
Deletes row from managed objects table.

Parameters:
idRow - row ID (not row index!) to delete from managed objects table
Returns:
row ID of suggested new row selection
Throws:
FException - if the row cannot be found or cannot be removed

deleteAll

public void deleteAll()
               throws FException
Deletes all rows.

Throws:
FException

getColumnCount

public int getColumnCount()
Returns number of columns.

Returns:
number of columns.

getColumns

public FColumn[] getColumns()

getColumn

public FColumn getColumn(int index)

getColumnSyntax

public ValueSyntax getColumnSyntax(int index)

getColumnSyntax

public ValueSyntax getColumnSyntax(FColumn c)

loadPersistValue

protected void loadPersistValue()
Loads persistent value into the scalar/table. If for any reason the load fails the persistent entry is removed for clean start in the next application run.

Specified by:
loadPersistValue in class FValueNode
See Also:
FValueNode.loadPersistValue()

setDefaultValues

public void setDefaultValues(java.lang.Object... obj)
                      throws FException
Sets default cell values for a new row. These values are used for new rows. Default values make sense and is actually set only for read-write columns.

Parameters:
obj - comma separated list of values
Throws:
FException

isCellEditable

public boolean isCellEditable(FID idRow,
                              FColumn col)
                       throws FException
Checks the editable flag for the specified cell.

Parameters:
idRow - the row index
col - column
Returns:
boolean value true if cell is editable
Throws:
FException

getValueAt

public java.lang.Object getValueAt(FID idRow,
                                   FColumn col)
                            throws FException
Gets the value of specified cell.

Parameters:
idRow - ID of the row (this is not an row index!)
col - column
Returns:
requested value of the cell
Throws:
FException - for not valid idRow or column parameter.

setValueAt

public void setValueAt(java.lang.Object obj,
                       FID idRow,
                       FColumn col)
                throws FException
Sets the value for the specified cell.

Parameters:
obj - new value, which is set to the cell.
idRow - ID of the row (this is not a row index!).
col - column.
Throws:
FException - for not valid idRow or col parameter or while object conversion.

addGetListener

public void addGetListener(FTableGetListener l)

removeGetListener

public void removeGetListener(FTableGetListener l)

addSetListener

public void addSetListener(FTableSetListener l)
Registers the given observer to begin receiving "changed value" events when changes are made to the managed object.

Parameters:
l - the observer to register

removeSetListener

public void removeSetListener(FTableSetListener l)
Unregisters the given observer from the notification list so it will no longer receive change updates.

Parameters:
l - the observer to unregister

addValidationListener

public void addValidationListener(FTableValidationListener l)
Registers the given observer to begin receiving "validation" events when changes are made to the managed object.

Parameters:
l - the observer to register

removeValidationListener

public void removeValidationListener(FTableValidationListener l)
Unregisters the given observer to stop receiving "validation" events when changes are made to the managed object.

Parameters:
l - the observer to register

fireGetEvent

public void fireGetEvent()
Fires GET event