Serializable
, Iterable<C>
, Collection<R>
, TableModel
, SnmpProxyObject
, SnmpTableRO<IC,C,IT,T,R>
, SnmpTableUpdateListener<C>
SnmpTableImpl
public class SnmpTableImplRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>> extends AbstractTableModel implements SnmpTableRO<IC,C,IT,T,R>, Collection<R>
SnmpTableImplRO
class implements a proxy for a read-only SNMP table. Although it can be used
on a read-writable SNMP table too, modifications of the proxy table model cannot be committed to the
backing agent.Modifier and Type | Class | Description |
---|---|---|
protected class |
SnmpTableImplRO.RowUpdateError |
|
protected class |
SnmpTableImplRO.SnmpColumnOidComparator |
|
protected class |
SnmpTableImplRO.SnmpProxyRowOidComparator |
Modifier and Type | Field | Description |
---|---|---|
protected List<C> |
columns |
|
protected org.snmp4j.smi.OctetString |
context |
|
protected int |
currentIndex |
|
protected List<IC> |
indexColumns |
|
protected Object[] |
minIndex |
|
protected int |
pageSize |
|
protected ConcurrentHashMap<org.snmp4j.smi.OID,SnmpTableImplRO.RowUpdateError> |
rowErrors |
|
protected SnmpProxyRowFactory<R,IT,T> |
rowFactory |
|
protected SnmpProxyRowFilter |
rowFilter |
|
protected List<R> |
rows |
|
protected org.snmp4j.smi.OID |
tableEntryOID |
|
protected List<R> |
updatingRows |
listenerList
Constructor | Description |
---|---|
SnmpTableImplRO(org.snmp4j.smi.OID tableEntryOID,
org.snmp4j.smi.OctetString context,
SnmpProxyRowFactory<R,IT,T> rowFactory,
List<C> columns,
List<IC> indexColumns,
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 |
---|---|---|
boolean |
add(R r) |
|
boolean |
addAll(Collection<? extends R> c) |
|
void |
addError(List<SnmpValuesChangeSet> valuesChangeSets,
SnmpErrorStatus errorStatus,
int errorIndex) |
|
void |
beginUpdate(Object userObject) |
This method is called when a table update begins.
|
void |
clear() |
|
void |
clearAllErrors() |
|
SnmpErrorStatus |
clearError(org.snmp4j.smi.OID rowIndex) |
|
boolean |
contains(Object o) |
|
boolean |
containsAll(Collection<?> c) |
|
int |
findColumn(String columnName) |
|
void |
finishUpdate(Object userObject) |
This method is called when the update with the given update ID has been finished.
|
SnmpCell |
getCell(org.snmp4j.smi.OID instanceOID) |
|
Class<?> |
getColumnClass(int columnIndex) |
|
int |
getColumnCount() |
|
String |
getColumnName(int column) |
|
int |
getColumnNumber(org.snmp4j.smi.OID columnOID) |
|
List<C> |
getColumns() |
Gets the list of columnar proxy objects of this table.
|
org.snmp4j.smi.OctetString |
getContext() |
Get the context of the proxy object.
|
int |
getCurrentIndex() |
|
SnmpErrorStatus |
getError(org.snmp4j.smi.OID rowIndex,
int column) |
|
List<IC> |
getIndexColumns() |
Gets the list of index columnar proxy objects of this table.
|
List<org.snmp4j.smi.OID> |
getIndexOIDs(org.snmp4j.smi.OID index,
List<? extends SnmpProxyIndexColumn> indexColumns) |
Split a table index into an array of object IDs each representing the
value of its corresponding index object.
|
static org.snmp4j.smi.VariableBinding |
getIndexVariable(SnmpProxyIndexColumn indexColumn,
org.snmp4j.smi.OID subIndex) |
|
List<org.snmp4j.smi.VariableBinding> |
getIndexVariableBindings(org.snmp4j.smi.OID index) |
|
static List<org.snmp4j.smi.VariableBinding> |
getIndexVariables(List<? extends SnmpProxyIndexColumn> indexes,
List<? extends org.snmp4j.smi.OID> indexValues) |
|
static List<org.snmp4j.smi.VariableBinding> |
getIndexVariableTemplates(List<? extends SnmpProxyIndexColumn> indexes) |
|
Object[] |
getMinIndex() |
|
protected int |
getNonPagedRowIndex(int pageRowIndex) |
|
org.snmp4j.smi.OID |
getOID() |
Gets the table entry OID (thus including the
.1 suffix) for the associated SNMP table. |
int |
getPageSize() |
Gets the page size.
|
int |
getRowCount() |
|
SnmpProxyRowFactory<R,IT,T> |
getRowFactory() |
|
SnmpProxyRowFilter |
getRowFilter() |
|
org.snmp4j.smi.OID |
getRowIndex(int rowNumber) |
|
List<org.snmp4j.smi.OID> |
getRowIndexes() |
|
int |
getRowNumber(org.snmp4j.smi.OID index) |
|
TableColumnModel |
getTableColumnModel(int maxCharacterPixelWidth,
int maxColumnCharacters) |
|
Object |
getValueAt(int rowIndex,
int columnIndex) |
|
boolean |
isEmpty() |
|
Iterator<R> |
iterator() |
|
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.
|
boolean |
remove(Object o) |
|
boolean |
removeAll(Collection<?> c) |
|
boolean |
retainAll(Collection<?> c) |
|
void |
setCurrentIndex(int startPos) |
|
void |
setMinIndex(Object[] minIndex) |
|
void |
setPageSize(int numRows) |
Sets the page size for this table.
|
void |
setRowFactory(SnmpProxyRowFactory<R,IT,T> rowFactory) |
|
void |
setRowFilter(SnmpProxyRowFilter rowFilter) |
|
int |
size() |
|
Object[] |
toArray() |
|
<T> T[] |
toArray(T[] a) |
|
String |
toString() |
|
void |
updateRow(Object userObject,
R updateRow) |
This method is called when the provided row has been updated.
|
boolean |
waitForTask(TaskId taskId,
long timeout) |
Wait until the specified background task terminates.
|
addTableModelListener, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
equals, hashCode, parallelStream, removeIf, spliterator, stream
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addTableModelListener, isCellEditable, removeTableModelListener, setValueAt
protected List<C extends SnmpProxyColumn> columns
protected List<IC extends SnmpProxyIndexColumn> indexColumns
protected List<R extends SnmpProxyRow<IT,T>> rows
protected List<R extends SnmpProxyRow<IT,T>> updatingRows
protected org.snmp4j.smi.OID tableEntryOID
protected int pageSize
protected int currentIndex
protected Object[] minIndex
protected SnmpProxyRowFilter rowFilter
protected SnmpProxyRowFactory<R extends SnmpProxyRow<IT,T>,IT,T> rowFactory
protected ConcurrentHashMap<org.snmp4j.smi.OID,SnmpTableImplRO.RowUpdateError> rowErrors
protected org.snmp4j.smi.OctetString context
public SnmpTableImplRO(org.snmp4j.smi.OID tableEntryOID, org.snmp4j.smi.OctetString context, SnmpProxyRowFactory<R,IT,T> rowFactory, List<C> columns, List<IC> indexColumns, 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.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 org.snmp4j.smi.OctetString getContext()
SnmpProxyObject
getContext
in interface SnmpProxyObject
public String getColumnName(int column)
getColumnName
in interface TableModel
getColumnName
in class AbstractTableModel
public int findColumn(String columnName)
findColumn
in class AbstractTableModel
public Class<?> getColumnClass(int columnIndex)
getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
public org.snmp4j.smi.OID getOID()
SnmpTableRO
.1
suffix) for the associated SNMP table.getOID
in interface SnmpProxyObject
getOID
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public SnmpCell getCell(org.snmp4j.smi.OID instanceOID)
getCell
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public TaskId reload(SnmpService snmpService, org.snmp4j.Target target, VariableBindingMapper variableBindingMapper, SnmpProxyReloadListener reloadListener)
SnmpProxyObject
reload
in interface SnmpProxyObject
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 boolean waitForTask(TaskId taskId, long timeout)
SnmpProxyObject
waitForTask
in interface SnmpProxyObject
taskId
- the task ID of the task to wait for.timeout
- the maximum time to wait in millis.true
if the task has terminated, false
otherwise.public List<C> getColumns()
SnmpTableRO
getColumns
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public List<IC> getIndexColumns()
SnmpTableRO
getIndexColumns
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public void setPageSize(int numRows)
SnmpTableRO
TableModel
will view only
a single page of rows of this proxy table.setPageSize
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
numRows
- the number of rows in the table.public int getPageSize()
SnmpTableRO
getPageSize
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public void setCurrentIndex(int startPos)
setCurrentIndex
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public int getCurrentIndex()
getCurrentIndex
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public void setRowFilter(SnmpProxyRowFilter rowFilter)
setRowFilter
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public SnmpProxyRowFilter getRowFilter()
getRowFilter
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public Object[] getMinIndex()
getMinIndex
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public List<org.snmp4j.smi.VariableBinding> getIndexVariableBindings(org.snmp4j.smi.OID index)
getIndexVariableBindings
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public void setMinIndex(Object[] minIndex)
setMinIndex
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public SnmpProxyRowFactory<R,IT,T> getRowFactory()
getRowFactory
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public void setRowFactory(SnmpProxyRowFactory<R,IT,T> rowFactory)
public void beginUpdate(Object userObject)
SnmpTableUpdateListener
beginUpdate
in interface SnmpTableUpdateListener<C extends SnmpProxyColumn>
userObject
- the ID of the update procedure.public void updateRow(Object userObject, R updateRow)
SnmpTableUpdateListener
updateRow
in interface SnmpTableUpdateListener<C extends SnmpProxyColumn>
userObject
- the ID of the update procedure.updateRow
- the updated row.public void finishUpdate(Object userObject)
SnmpTableUpdateListener
finishUpdate
in interface SnmpTableUpdateListener<C extends SnmpProxyColumn>
userObject
- the ID of the update procedure.public int getRowCount()
getRowCount
in interface TableModel
public int getColumnCount()
getColumnCount
in interface TableModel
public Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in interface TableModel
protected int getNonPagedRowIndex(int pageRowIndex)
public static org.snmp4j.smi.VariableBinding getIndexVariable(SnmpProxyIndexColumn indexColumn, org.snmp4j.smi.OID subIndex)
public static List<org.snmp4j.smi.VariableBinding> getIndexVariables(List<? extends SnmpProxyIndexColumn> indexes, List<? extends org.snmp4j.smi.OID> indexValues)
public static List<org.snmp4j.smi.VariableBinding> getIndexVariableTemplates(List<? extends SnmpProxyIndexColumn> indexes)
public List<org.snmp4j.smi.OID> getIndexOIDs(org.snmp4j.smi.OID index, List<? extends SnmpProxyIndexColumn> indexColumns)
index
- an OID denoting a table's index value.indexColumns
- an array of index object descriptions.public TableColumnModel getTableColumnModel(int maxCharacterPixelWidth, int maxColumnCharacters)
getTableColumnModel
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public void addError(List<SnmpValuesChangeSet> valuesChangeSets, SnmpErrorStatus errorStatus, int errorIndex)
addError
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public SnmpErrorStatus getError(org.snmp4j.smi.OID rowIndex, int column)
getError
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public void clearAllErrors()
clearAllErrors
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public SnmpErrorStatus clearError(org.snmp4j.smi.OID rowIndex)
clearError
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public int size()
size
in interface Collection<C extends SnmpProxyColumn>
public boolean isEmpty()
isEmpty
in interface Collection<C extends SnmpProxyColumn>
public boolean contains(Object o)
contains
in interface Collection<C extends SnmpProxyColumn>
public Iterator<R> iterator()
iterator
in interface Collection<C extends SnmpProxyColumn>
iterator
in interface Iterable<C extends SnmpProxyColumn>
public Object[] toArray()
toArray
in interface Collection<C extends SnmpProxyColumn>
public <T> T[] toArray(T[] a)
toArray
in interface Collection<C extends SnmpProxyColumn>
public boolean add(R r)
add
in interface Collection<C extends SnmpProxyColumn>
public boolean remove(Object o)
remove
in interface Collection<C extends SnmpProxyColumn>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<C extends SnmpProxyColumn>
public boolean addAll(Collection<? extends R> c)
addAll
in interface Collection<C extends SnmpProxyColumn>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<C extends SnmpProxyColumn>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<C extends SnmpProxyColumn>
public void clear()
clear
in interface Collection<C extends SnmpProxyColumn>
public int getRowNumber(org.snmp4j.smi.OID index)
getRowNumber
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public int getColumnNumber(org.snmp4j.smi.OID columnOID)
getColumnNumber
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public List<org.snmp4j.smi.OID> getRowIndexes()
getRowIndexes
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
public org.snmp4j.smi.OID getRowIndex(int rowNumber)
getRowIndex
in interface SnmpTableRO<C extends SnmpProxyColumn,IC extends SnmpProxyIndexColumn,IT,T,R extends SnmpProxyRow<IT,T>>
Copyright © 2020 SNMP4J.org. All rights reserved.