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
ConstructorsModifierConstructorDescriptionprotectedBufferedMOMutableTableModel(org.snmp4j.agent.mo.MOTableRowFactory<R> rowFactory) Creates a BufferedMOMutableTableModel with the specifiedMOTableRowFactory. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidbulkDeleteRows(List<org.snmp4j.smi.OID> indexList) Removes the rows with a row index that matches an entry in the supplied index list.voidclear()protected abstract voidRemoves all rows in the table.protected abstract voiddeleteRow(org.snmp4j.smi.OID index) Deletes a single row.protected abstract voidinsertRow(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.voidrowChanged(org.snmp4j.agent.mo.MOTableRowEvent<R> event) protected abstract voidwriteRow(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, updateBufferMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.snmp4j.agent.mo.MOMutableTableModel
getRowFactory, setRowFactoryMethods inherited from interface org.snmp4j.agent.mo.MOTableModel
containsRow, firstIndex, firstRow, getColumnCount, getRow, getRowCount, isEmpty, iterator, lastIndex, lastRow, tailIteratorMethods 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:
addRowin interfaceorg.snmp4j.agent.mo.MOMutableTableModel<R extends org.snmp4j.agent.mo.MOTableRow>
-
clear
public void clear()- Specified by:
clearin interfaceorg.snmp4j.agent.mo.MOMutableTableModel<R extends org.snmp4j.agent.mo.MOTableRow>
-
clear
- Specified by:
clearin 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:
rowChangedin interfaceorg.snmp4j.agent.mo.MOTableRowListener<R extends org.snmp4j.agent.mo.MOTableRow>
-
removeRow
Description copied from class:BufferedMOTableModelRemoves a row from the table. By default this method throws aUnsupportedOperationException.- Specified by:
removeRowin interfaceorg.snmp4j.agent.mo.MOMutableTableModel<R extends org.snmp4j.agent.mo.MOTableRow>- Overrides:
removeRowin classBufferedMOTableModel<R extends org.snmp4j.agent.mo.MOTableRow>- Parameters:
index- the index of the target row.- Returns:
- the removed row and
nullif such a row does not exist.
-