|
HOME | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | 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 . |
SnmpOID |
getAuthFailureOID()
|
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 |
getColumnDataType(int rowIndex,
int columnIndex)
Returns column data type string |
String |
getColumnName(int column)
Returns column name |
String |
getColumnName(int row,
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)
Returns row at specified index |
int |
getRowCount()
Returns the number of rows in the model. |
String |
getRowIndexSuffix(int row)
Returns index suffix of a row. |
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 . |
SnmpVarBind |
getVarBindAt(int row,
int column)
|
void |
refreshNow()
Refresh whole table now (if table's polling is enabled) |
void |
removeAll()
Removes all rows and columns |
void |
removeRow(int index)
Removes a row |
void |
setColumnDataType(int index,
String dataType)
Sets column data type |
void |
setColumnName(int index,
String name)
Sets column name |
void |
setColumnOID(int index,
String oid)
Sets column's OID |
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, getTableModelListeners, 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 String getRowIndexSuffix(int row)
row
- row indexpublic SnmpVarBind[] getColumn(int index)
IndexOutOfBoundsException
- if index is out of rangepublic void addRow(SnmpVarBind[] vbs)
vbs
- an SnmpVarBind array of each column in this new rowpublic SnmpVarBind getVarBindAt(int row, int column)
public Object getValueAt(int row, int column)
columnIndex
and
rowIndex
.
IndexOutOfBoundsException
- if row or column is out of rangepublic void setValueAt(Object aValue, int rowIndex, int columnIndex)
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
.
IndexOutOfBoundsException
- if row or column is out of rangepublic int getRowCount()
getColumnCount()
public int getColumnCount()
getRowCount()
public String getColumnName(int column)
column
- the column being queried
IndexOutOfBoundsException
- if column is out of rangepublic String getColumnName(int row, int column)
column
- column indexrow
- the row index
IndexOutOfBoundsException
- if column is out of rangepublic void setColumnName(int index, String name)
index
- column indexname
- column namepublic String getColumnOID(int column)
column
- the column being queried
IndexOutOfBoundsException
- if column is out of rangepublic void setColumnOID(int index, String oid)
index
- column indexoid
- column's OIDpublic String getColumnDataType(int index)
index
- column indexpublic String getColumnDataType(int rowIndex, int columnIndex)
columnIndex
- column indexrowIndex
- row 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 removeRow(int index)
index
- row indexpublic void removeAll()
public SnmpOID getAuthFailureOID()
|
HOME | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |