Class BufferedMOMutableTableModel<R extends org.snmp4j.agent.mo.MOTableRow>
- All Implemented Interfaces:
EventListener
,org.snmp4j.agent.mo.MOMutableTableModel<R>
,org.snmp4j.agent.mo.MOTableModel<R>
,org.snmp4j.agent.mo.MOTableRowFactory<R>
,org.snmp4j.agent.mo.MOTableRowListener<R>
BufferedMOTableModel.getMaxBufferSize()
rows fetched from the backend.
Rows are removed from the buffer either when they are older than BufferedMOTableModel.getBufferTimeoutNanoSeconds()
or
if the maximum number of buffered rows is reached.
Updates, row creations and removals are directly processed by the backend. Thus, updates are not buffered by this table model although the internal buffer reflects the changes.
IMPORTANT: The table model needs to be informed about row changes by calling the rowChanged(MOTableRowEvent)
method of the implemented MOTableRowListener
interface. This is typically done by
adding this model as row listener with
DefaultMOTable.addMOTableRowListener(MOTableRowListener)
but it can also be called
manually.
If you need to be sure that every row change is automatically processed by the backend through this
BufferedMOMutableTableModel then you will have to implement and use your own MOTableRow
implementation created by your own MOTableRowFactory
. That row implementation has then
to call the rowChanged(MOTableRowEvent)
of this table model after each change.
- Since:
- 2.2
- Author:
- Frank Fock
-
Nested Class Summary
Nested classes/interfaces inherited from class org.snmp4j.agent.mox.BufferedMOTableModel
BufferedMOTableModel.BufferedMOTableRow<R extends org.snmp4j.agent.mo.MOTableRow>, BufferedMOTableModel.RowBufferIterator
-
Field Summary
Fields inherited from class org.snmp4j.agent.mox.BufferedMOTableModel
bufferedChunksList, bufferedRows, bufferHits, bufferMisses, bufferTimeoutNanoSeconds, chunkSize, columnCount, firstRow, lastRow, maxBufferSize, rowFactory
-
Constructor Summary
ModifierConstructorDescriptionprotected
BufferedMOMutableTableModel
(org.snmp4j.agent.mo.MOTableRowFactory<R> rowFactory) Creates a BufferedMOMutableTableModel with the specifiedMOTableRowFactory
. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
bulkDeleteRows
(List<org.snmp4j.smi.OID> indexList) Removes the rows with a row index that matches an entry in the supplied index list.void
clear()
protected abstract void
Removes all rows in the table.protected abstract void
deleteRow
(org.snmp4j.smi.OID index) Deletes a single row.protected abstract void
insertRow
(org.snmp4j.smi.OID index, org.snmp4j.smi.Variable[] values) Inserts a non-existing row.removeRow
(org.snmp4j.smi.OID index) Removes a row from the table.void
rowChanged
(org.snmp4j.agent.mo.MOTableRowEvent<R> event) protected abstract void
writeRow
(org.snmp4j.smi.OID index, org.snmp4j.smi.Variable[] values) Updates/writes the content of a row.Methods inherited from class org.snmp4j.agent.mox.BufferedMOTableModel
cleanupBuffer, containsRow, fetchNextRows, fetchRow, firstIndex, firstRow, getBufferHits, getBufferMisses, getBufferTimeoutNanoSeconds, getChunkSize, getColumnCount, getFirstBufferRow, getLastBufferRow, getMaxBufferSize, getRow, getRow, getRowCount, getRowFactory, getRowFromBuffer, isRowValid, iterator, lastIndex, lastRow, resetBuffer, setBufferTimeoutNanoSeconds, setChunkSize, setMaxBufferSize, setRowFactory, tailIterator, toString, updateBuffer
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.snmp4j.agent.mo.MOMutableTableModel
getRowFactory, setRowFactory
Methods inherited from interface org.snmp4j.agent.mo.MOTableModel
containsRow, firstIndex, firstRow, getColumnCount, getRow, getRowCount, isEmpty, iterator, lastIndex, lastRow, tailIterator
Methods inherited from interface org.snmp4j.agent.mo.MOTableRowFactory
createRow, freeRow
-
Constructor Details
-
BufferedMOMutableTableModel
Creates a BufferedMOMutableTableModel with the specifiedMOTableRowFactory
.- Parameters:
rowFactory
- the row factory to be used to create rows from backend data.
-
-
Method Details
-
addRow
- Specified by:
addRow
in interfaceorg.snmp4j.agent.mo.MOMutableTableModel<R extends org.snmp4j.agent.mo.MOTableRow>
-
clear
public void clear()- Specified by:
clear
in interfaceorg.snmp4j.agent.mo.MOMutableTableModel<R extends org.snmp4j.agent.mo.MOTableRow>
-
clear
- Specified by:
clear
in interfaceorg.snmp4j.agent.mo.MOMutableTableModel<R extends org.snmp4j.agent.mo.MOTableRow>
-
deleteAllRows
protected abstract void deleteAllRows()Removes all rows in the table. -
bulkDeleteRows
Removes the rows with a row index that matches an entry in the supplied index list.- Parameters:
indexList
- the row indexes of the rows to remove.
-
insertRow
protected abstract void insertRow(org.snmp4j.smi.OID index, org.snmp4j.smi.Variable[] values) Inserts a non-existing row.- Parameters:
index
- the row index of the new row.values
- the values for the columns of the row.
-
writeRow
protected abstract void writeRow(org.snmp4j.smi.OID index, org.snmp4j.smi.Variable[] values) Updates/writes the content of a row.- Parameters:
index
- the row index of the existing row.values
- the new values for the columns in that row.
-
deleteRow
protected abstract void deleteRow(org.snmp4j.smi.OID index) Deletes a single row.- Parameters:
index
- the row index of the deleting row.
-
rowChanged
- Specified by:
rowChanged
in interfaceorg.snmp4j.agent.mo.MOTableRowListener<R extends org.snmp4j.agent.mo.MOTableRow>
-
removeRow
Description copied from class:BufferedMOTableModel
Removes a row from the table. By default this method throws aUnsupportedOperationException
.- Specified by:
removeRow
in interfaceorg.snmp4j.agent.mo.MOMutableTableModel<R extends org.snmp4j.agent.mo.MOTableRow>
- Overrides:
removeRow
in classBufferedMOTableModel<R extends org.snmp4j.agent.mo.MOTableRow>
- Parameters:
index
- the index of the target row.- Returns:
- the removed row and
null
if such a row does not exist.
-