|
HOME | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.table.AbstractTableModel | +--com.ireasoning.protocol.snmp.SnmpTableModel
This class is the data representation of a MIB table. It also implements Swing's TableModel interface, so it can used directly by Swing's JTable class.
SnmpSession.snmpGetTable(java.lang.String, com.ireasoning.protocol.snmp.SnmpTableModel)
, Serialized FormField Summary | |
protected Vector |
_columnDataTypes
Column data types. |
protected Vector |
_columnNames
Column names. |
protected Vector |
_columnOIDs
Column oids. |
protected Vector |
_columns
Table columns. |
protected boolean |
_isToTranslateValue
true to translate VarBind's value |
protected String |
_tableName
Table name |
protected SnmpOID |
_tableOID
Table OID |
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
SnmpTableModel()
Constructor |
|
SnmpTableModel(String tableName)
Constructor |
Method Summary | |
void |
addRow(SnmpVarBind[] vbs)
Adds a new row |
SnmpVarBind |
get(int row,
int column)
Returns the the cell at columnIndex and
rowIndex . |
SnmpVarBind[] |
getColumn(int index)
Returns the column at specified index |
int |
getColumnCount()
Returns the number of columns in the model. |
String |
getColumnDataType(int index)
Returns column data type string |
String |
getColumnName(int column)
Returns column name |
String |
getColumnOID(int column)
Returns column oid at specified column |
long |
getPollingInterval()
Returns the polling interval, in seconds. |
SnmpVarBind[] |
getRow(int index)
Return row at specified index |
int |
getRowCount()
Returns the number of rows in the model. |
String |
getTableName()
Returns the table name |
SnmpOID |
getTableOID()
Returns the table OID |
Object |
getValueAt(int row,
int column)
Returns the value for the cell at columnIndex and
rowIndex . |
void |
refreshNow()
Refresh whole table now (if table's polling is enabled) |
void |
removeAll()
Removes all rows and columns |
void |
setColumnDataType(int index,
String dataType)
Sets column data type |
void |
setTableName(String tableName)
Sets table name |
void |
setTableOID(SnmpOID oid)
Sets a new table OID |
void |
setTranslateValue(boolean b)
If passed b is true, subsequent calls to getValueAt(int row, int column) will use corresponding value defined in MIB. |
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex)
Sets the value in the cell at columnIndex and rowIndex to aValue. |
void |
setValueMap(int column,
String key,
String value)
Passed a key/value map to further translate value into more readable text message. |
void |
startPolling(long interval)
Starts a new thread for polling table periodically. |
void |
stopPolling()
Stops polling |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, isCellEditable, removeTableModelListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Vector _columns
protected Vector _columnNames
protected Vector _columnOIDs
protected Vector _columnDataTypes
protected String _tableName
protected SnmpOID _tableOID
protected boolean _isToTranslateValue
setTranslateValue(boolean)
Constructor Detail |
public SnmpTableModel()
public SnmpTableModel(String tableName)
tableName
- table nameMethod Detail |
public void setTableName(String tableName)
tableName
- table namepublic String getTableName()
public SnmpOID getTableOID()
public void setTableOID(SnmpOID oid)
public SnmpVarBind[] getRow(int index)
IndexOutOfBoundsException
- if index is out of rangepublic SnmpVarBind[] getColumn(int index)
IndexOutOfBoundsException
- if index is out of rangepublic void addRow(SnmpVarBind[] vbs)
vbs
- a SnmpVarBind array of each column in this new rowpublic Object getValueAt(int row, int column)
columnIndex
and
rowIndex
.getValueAt
in class AbstractTableModel
rowIndex
- the row whose value is to be queriedcolumnIndex
- the column whose value is to be queriedIndexOutOfBoundsException
- if row or column is out of rangepublic void setValueAt(Object aValue, int rowIndex, int columnIndex)
setValueAt
in class AbstractTableModel
aValue
- the new value, must be an instance of a class implementing SnmpDataType
interfacerowIndex
- the row whose value is to be changedcolumnIndex
- the column whose value is to be changedpublic void setTranslateValue(boolean b)
MibUtil.translateValue(java.lang.String, java.lang.String)
,
snmpgettable.java examplepublic void setValueMap(int column, String key, String value)
key
- Map's keyvalue
- Map's valuecolumn
- table column index, starting from 0public SnmpVarBind get(int row, int column)
columnIndex
and
rowIndex
.rowIndex
- the row whose value is to be queriedcolumnIndex
- the column whose value is to be queriedIndexOutOfBoundsException
- if row or column is out of rangepublic int getRowCount()
getRowCount
in class AbstractTableModel
getColumnCount()
public int getColumnCount()
getColumnCount
in class AbstractTableModel
getRowCount()
public String getColumnName(int column)
getColumnName
in class AbstractTableModel
column
- the column being queriedIndexOutOfBoundsException
- if column is out of rangepublic String getColumnOID(int column)
column
- the column being queriedIndexOutOfBoundsException
- if column is out of rangepublic String getColumnDataType(int index)
index
- column indexpublic void setColumnDataType(int index, String dataType)
index
- column indexdataType
- data type stringpublic long getPollingInterval()
public void startPolling(long interval)
interval
- polling interval, the number of seconds between two pollspublic void stopPolling()
public void refreshNow()
startPolling(long)
public void removeAll()
|
HOME | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |