C
- the proxy column type fo the table proxy.IC
- the index proxy column type for the table proxy.IT
- the model value type for index columns.T
- the model value type for the columnar model values.R
- the proxy row type for the rows of the table.Serializable
, Iterable<IC>
, Collection<IC>
, TableModel
, MutableSnmpProxy
, SnmpCommitListener
, SnmpProxyObject
, SnmpTable<C,IC,IT,T,R>
, SnmpTableRO<IC,C,IT,T,R>
, SnmpTableUpdateListener<IC>
public class SnmpTableImpl<IC extends SnmpProxyIndexColumn,C extends SnmpProxyColumn,IT,T,R extends SnmpProxyRow<IT,T>> extends SnmpTableImplRO<C,IC,IT,T,R> implements SnmpTable<C,IC,IT,T,R>
TableModel
.SnmpTableImplRO.RowUpdateError, SnmpTableImplRO.SnmpColumnOidComparator, SnmpTableImplRO.SnmpProxyRowOidComparator
listenerList
columns, context, currentIndex, indexColumns, minIndex, pageSize, rowErrors, rowFactory, rowFilter, rows, tableEntryOID, updatingRows
Constructor | Description |
---|---|
SnmpTableImpl(org.snmp4j.smi.OID tableEntryOID,
org.snmp4j.smi.OctetString context,
SnmpProxyCommitter snmpProxyCommitter,
SnmpProxyRowFactory<R,IT,T> rowFactory,
List<IC> indexColumns,
List<C> columns,
int pageSize) |
Creates a proxy table implementation based on the SNMP table entry object identifier and lists with the
index and regular column proxy objects as well as a page size to support paged table models.
|
Modifier and Type | Method | Description |
---|---|---|
protected void |
cellUpdated(int row,
int column,
SnmpValueChange change) |
|
protected void |
cellUpdateValidationFailure(int row,
int column,
SnmpValueChange change) |
|
void |
clear() |
Remove all rows of the proxy table without changing the target SNMP table at all.
|
void |
commitFailure(List<SnmpValuesChangeSet> failedChanges,
SnmpErrorStatus errorStatus,
int errorIndex) |
Indicates a failed commit operation.
|
void |
commitSuccess(List<SnmpValuesChangeSet> committedChanges) |
Indication of a successful commit.
|
boolean |
doChange(SnmpValuesChangeSet changeSet) |
Perform a change by adding it to the committer queue.
|
boolean |
doChange(SnmpValuesChangeSet changeSet,
boolean addToCommitter) |
Performs a change by validating it using the
SnmpProxyCommitter . |
org.snmp4j.smi.OID |
getCellOID(int column,
org.snmp4j.smi.OID index) |
|
SnmpCellUpdateListener |
getCellUpdateListener() |
Gets the cell update listener associated with this table.
|
SnmpProxyCommitter |
getCommitter() |
|
int |
getRowNumber(org.snmp4j.smi.OID rowIndex) |
Gets the row number for the specified SNMP row index value.
|
void |
insertRow(R newRow) |
Insert a new row into the table.
|
boolean |
isCellEditable(int rowIndex,
int columnIndex) |
|
TaskId |
reload(SnmpService snmpService,
org.snmp4j.Target target,
VariableBindingMapper variableBindingMapper,
SnmpProxyReloadListener reloadListener) |
Reload the model content of the proxy object from the target SNMP entity asynchronously in the background.
|
R |
removeRow(int rowIndex) |
Removes a row from the model without changing the associated SNMP table.
|
R |
removeRow(org.snmp4j.smi.OID rowIndex) |
Removes a row from the model without changing the associated SNMP table.
|
void |
setCellUpdateListener(SnmpCellUpdateListener cellUpdateListener) |
Sets the cell update listener associated with this table.
|
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex) |
|
boolean |
undoChange(SnmpValuesChangeSet changeSet) |
Undo a change by adding the compensation change to the committer queue.
|
addTableModelListener, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
equals, hashCode, parallelStream, removeIf, spliterator, stream
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getContext
getContext, waitForTask
fireTableCellUpdated
add, addAll, addError, beginUpdate, clearAllErrors, clearError, contains, containsAll, findColumn, finishUpdate, getCell, getColumnClass, getColumnCount, getColumnName, getColumnNumber, getColumns, getContext, getCurrentIndex, getError, getIndexColumns, getIndexOIDs, getIndexVariable, getIndexVariableBindings, getIndexVariables, getIndexVariableTemplates, getMinIndex, getNonPagedRowIndex, getOID, getPageSize, getRowCount, getRowFactory, getRowFilter, getRowIndex, getRowIndexes, getTableColumnModel, getValueAt, isEmpty, iterator, remove, removeAll, retainAll, setCurrentIndex, setMinIndex, setPageSize, setRowFactory, setRowFilter, size, toArray, toArray, toString, updateRow, waitForTask
addError, clearAllErrors, clearError, getCell, getColumnNumber, getColumns, getCurrentIndex, getError, getIndexColumns, getIndexVariableBindings, getMinIndex, getOID, getPageSize, getRowFactory, getRowFilter, getRowIndex, getRowIndexes, getTableColumnModel, setCurrentIndex, setMinIndex, setPageSize, setRowFilter
beginUpdate, finishUpdate, updateRow
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, removeTableModelListener
public SnmpTableImpl(org.snmp4j.smi.OID tableEntryOID, org.snmp4j.smi.OctetString context, SnmpProxyCommitter snmpProxyCommitter, SnmpProxyRowFactory<R,IT,T> rowFactory, List<IC> indexColumns, List<C> columns, int pageSize)
tableEntryOID
- the OID of the SNMP table Entry object (thus the table OID inclusive the entry suffix .1
).context
- the SNMP context associated with this proxy object.snmpProxyCommitter
- the proxy committer used to commit changes to model values to the associated target SNMP entity.rowFactory
- the factory for new model rows.indexColumns
- the index proxy column objects.columns
- the proxy column objects.pageSize
- the page size for paged table models. A zero (or less) size disables paging.public SnmpProxyCommitter getCommitter()
getCommitter
in interface MutableSnmpProxy
public void setValueAt(Object aValue, int rowIndex, int columnIndex)
setValueAt
in interface TableModel
setValueAt
in class AbstractTableModel
public SnmpCellUpdateListener getCellUpdateListener()
SnmpTable
getCellUpdateListener
in interface SnmpTable<IC extends SnmpProxyIndexColumn,C extends SnmpProxyColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public void setCellUpdateListener(SnmpCellUpdateListener cellUpdateListener)
SnmpTable
setCellUpdateListener
in interface SnmpTable<IC extends SnmpProxyIndexColumn,C extends SnmpProxyColumn,IT,T,R extends SnmpProxyRow<IT,T>>
cellUpdateListener
- the new cell update listener for this table.protected void cellUpdateValidationFailure(int row, int column, SnmpValueChange change)
protected void cellUpdated(int row, int column, SnmpValueChange change)
public boolean isCellEditable(int rowIndex, int columnIndex)
isCellEditable
in interface TableModel
isCellEditable
in class AbstractTableModel
public org.snmp4j.smi.OID getCellOID(int column, org.snmp4j.smi.OID index)
public void insertRow(R newRow)
SnmpTable
SnmpCommitListener
.insertRow
in interface SnmpTable<IC extends SnmpProxyIndexColumn,C extends SnmpProxyColumn,IT,T,R extends SnmpProxyRow<IT,T>>
newRow
- the new proxy row.public R removeRow(int rowIndex)
rowIndex
- the zero based row index.public R removeRow(org.snmp4j.smi.OID rowIndex)
rowIndex
- the SNMP row index (i.e., the OID suffix that identifies the row in the table).null
if such a row could not be found.public void clear()
SnmpTable
clear
in interface Collection<IC extends SnmpProxyIndexColumn>
clear
in interface SnmpTable<IC extends SnmpProxyIndexColumn,C extends SnmpProxyColumn,IT,T,R extends SnmpProxyRow<IT,T>>
clear
in class SnmpTableImplRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public void commitSuccess(List<SnmpValuesChangeSet> committedChanges)
SnmpCommitListener
commitSuccess
in interface SnmpCommitListener
committedChanges
- the list of successfully committed change sets (each change set was committed atomically for itself).public void commitFailure(List<SnmpValuesChangeSet> failedChanges, SnmpErrorStatus errorStatus, int errorIndex)
SnmpCommitListener
commitFailure
in interface SnmpCommitListener
failedChanges
- the changes that failed to commit (none of the changes within a single change set must have been committed, if
the change set was small enough to be committed atomically).errorStatus
- the SNMP error status of the first failed change set.errorIndex
- the index in the original list of changes committed that failed (zero based).public TaskId reload(SnmpService snmpService, org.snmp4j.Target target, VariableBindingMapper variableBindingMapper, SnmpProxyReloadListener reloadListener)
SnmpProxyObject
reload
in interface SnmpProxyObject
reload
in class SnmpTableImplRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
snmpService
- the SNMP service to use.target
- the SNMP target (i.e., address, timeouts, etc.) to use.variableBindingMapper
- the variable binding mapper that maps the retrieved SNMP values to model values (based on SNMP types or
specific OID based mappings).reloadListener
- a callback listener that is informed about the reloading status.public int getRowNumber(org.snmp4j.smi.OID rowIndex)
getRowNumber
in interface SnmpTableRO<IC extends SnmpProxyIndexColumn,C extends SnmpProxyColumn,IT,T,R extends SnmpProxyRow<IT,T>>
getRowNumber
in class SnmpTableImplRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
rowIndex
- a SNMP row index (i.e., the OID suffix that identifies a row in the target table).public boolean doChange(SnmpValuesChangeSet changeSet)
MutableSnmpProxy
doChange
in interface MutableSnmpProxy
changeSet
- the change to perform atomically.true
if the change passed validation and thus was successfully added to the queue.public boolean doChange(SnmpValuesChangeSet changeSet, boolean addToCommitter)
SnmpProxyCommitter
. Optionally the change is then also
added the the proxy committer queue.changeSet
- a SnmpValuesChangeSet
that contains changes to model objects that refer to cells of this proxy table.addToCommitter
- if true
, the changes will also be added to the proxy committer change queue for committing the
changes to the target SNMP table.true
if the change set was valid. If not, no changes to the model and the target SNMP table
are performed.public boolean undoChange(SnmpValuesChangeSet changeSet)
MutableSnmpProxy
undoChange
in interface MutableSnmpProxy
changeSet
- the change to undo atomically.true
if the undo change passed validation and thus was successfully added to the queue.Copyright © 2020 SNMP4J.org. All rights reserved.