ManagedObject
, ManagedObjectValueAccess
, ChangeableManagedObject
, MOTable<R,C,M>
, MOScope
, RandomAccessManagedObject
, RegisteredManagedObject
, SerializableManagedObject
SNMPv2MIB.SysOREntry
public class DefaultMOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>> extends java.lang.Object implements MOTable<R,C,M>, MOScope, SerializableManagedObject, RandomAccessManagedObject
DefaultMOTable
class is the default implementation of the
MOTable
class. For most use cases, it is not necessary to customize
this class through deriving your own sub-class. Instead, using a different
MOTableModel
as table data provider is sufficient.
The default table model can be used to hold the data of a SNMP conceptual
table as real tabular data. If you want to implement a virtual table, you
will have to directly implement the interfaces MOTableModel
or
MOMutableTableModel
to access the data based on the actual view.
Modifier and Type | Class | Description |
---|---|---|
static class |
DefaultMOTable.ChangeSet |
Modifier and Type | Field | Description |
---|---|---|
protected java.util.List<MOChangeListener> |
moChangeListeners |
|
protected M |
model |
|
protected java.util.List<MOTableRowListener<R>> |
moTableRowListeners |
|
protected java.util.WeakHashMap<Request,java.util.Map<org.snmp4j.smi.OID,R>> |
newRows |
|
protected java.util.WeakHashMap<Request,java.util.Map<org.snmp4j.smi.OID,DefaultMOTable.ChangeSet>> |
pendingChanges |
|
protected java.util.List<RowModificationControlColumn> |
rowModificationControlColumns |
Constructor | Description |
---|---|
DefaultMOTable(org.snmp4j.smi.OID oid,
MOTableIndex indexDef,
C[] columns) |
|
DefaultMOTable(org.snmp4j.smi.OID oid,
MOTableIndex indexDef,
C[] columns,
M model) |
Creates a new SNMP table with the specified "Entry" OID, INDEX, columns,
and
MOTableModel . |
Modifier and Type | Method | Description |
---|---|---|
void |
addMOChangeListener(MOChangeListener l) |
Adds a
MOChangeListener that needs to be informed about
state changes of this ManagedObject . |
void |
addMOTableRowListener(MOTableRowListener<R> l) |
Adds a
MOTableRowListener listener that needs to be informed
about row changes (creation, addition, removal). |
R |
addNewRow(org.snmp4j.smi.OID index,
org.snmp4j.smi.Variable[] initialValues) |
Creates a new row for this table with the supplied index and initial
values and then immediately calls
MOTable.addRow(MOTableRow) . |
protected DefaultMOTable.ChangeSet |
addPendingChanges(SubRequest subRequest,
MOTableRow row,
boolean newRow) |
|
boolean |
addRow(R row) |
Adds the supplied row to the underlying table model and fires the
appropriate
MOTableRowEvent . |
void |
cleanup(SubRequest request) |
Cleansup a (sub)request and frees all resources locked during
the preparation phase.
|
void |
commit(SubRequest request) |
Commits a previously prepared SET (sub)request.
|
boolean |
covers(org.snmp4j.smi.OID oid) |
Checks if this scope covers the supplied OID.
|
R |
createRow(org.snmp4j.smi.OID index) |
Creates a new row for this table with the supplied index and
default values.
|
R |
createRow(org.snmp4j.smi.OID index,
org.snmp4j.smi.Variable[] initialValues) |
Creates a new row for this table with the supplied index and initial
values.
|
java.util.List<org.snmp4j.smi.VariableBinding> |
exportInstance(org.snmp4j.smi.OID instanceID) |
Exports the byte representation of an instance of the
ManagedObject . |
org.snmp4j.smi.OID |
find(MOScope range) |
Finds the object identifier of the first object instance in the specified
range.
|
protected MOTableCellInfo |
findCell(MOScope range,
SubRequest request) |
|
protected void |
fireAfterMOChange(MOChangeEvent changeEvent) |
|
protected void |
fireAfterPrepareMOChange(MOChangeEvent changeEvent) |
|
protected void |
fireBeforeMOChange(MOChangeEvent changeEvent) |
|
protected void |
fireBeforePrepareMOChange(MOChangeEvent changeEvent) |
|
protected void |
fireRowChanged(MOTableRowEvent<R> event) |
|
protected void |
fireRowExistsEvent(MOTableRowListener<R> l) |
Fires a
MOTableRowEvent.EXISTS for all rows in this table if the provided listener actively subscribes
to all such events this time by setting MOTableRowEvent.setSendNextEventsOfSameOrigin(boolean) to
true on the first rows and following events. |
void |
get(SubRequest request) |
Processes a GET request and return the result in the supplied sub-request.
|
MOTableCellInfo |
getCellInfo(org.snmp4j.smi.OID oid) |
Returns a
MOTableCellInfo instance for the supplied
cell OID. |
org.snmp4j.smi.OID |
getCellOID(org.snmp4j.smi.OID index,
int col) |
|
protected int |
getChangesFromRequest(org.snmp4j.smi.OID index,
MOTableRow row,
SubRequest request,
org.snmp4j.smi.Variable[] values,
boolean setDefaultValues,
boolean newRow) |
|
C |
getColumn(int index) |
Gets the column definition for the specified column.
|
int |
getColumnCount() |
Returns the number of columns in this table.
|
int |
getColumnIndex(int id) |
Returns the zero based column index for the specified column
sub-identifier.
|
C[] |
getColumns() |
Gets the column definitions for this table.
|
org.snmp4j.smi.Variable[] |
getDefaultValues() |
Returns an array of variables where each variable corresponds to the
column with the same index.
|
MOTableRow |
getDependentTableRow(org.snmp4j.smi.OID dependentTableID,
org.snmp4j.smi.OID index) |
Gets the row with the given index from the dependent table (thus a table which extends this table using
a
MOTableRelation ) with the provided table entry object identifier. |
org.snmp4j.smi.OID |
getID() |
Gets the unique object ID of the managed object.
|
MOTableIndex |
getIndexDef() |
Gets the index definition of this table.
|
org.snmp4j.smi.OID |
getIndexPart(org.snmp4j.smi.OID anyOID) |
Returns the index part of a column instance identifier of this table.
|
org.snmp4j.smi.OID |
getInstanceSubID(org.snmp4j.smi.OID instanceOID) |
Returns the instance sub-identifier sufix for the given instance OID.
|
org.snmp4j.smi.OID |
getLowerBound() |
Gets the lower bound OID of the scope.
|
M |
getModel() |
Gets the table model of this table.
|
protected java.util.Map<org.snmp4j.smi.OID,R> |
getNewRows(Request key) |
|
org.snmp4j.smi.OID |
getOID() |
Returns the OID of the table entry.
|
protected DefaultMOTable.ChangeSet |
getPendingChangeSet(SubRequest subRequest,
org.snmp4j.smi.OID index) |
|
protected org.snmp4j.smi.Variable[] |
getPersistentValues(MOTableRow row) |
Gets the values of a row that need to be made persistent on behalf of
a
save(MOOutput output) call. |
protected java.util.List<RowModificationControlColumn> |
getRowModificationControlColumns() |
|
DefaultMOTable.ChangeSet |
getRowPreview(Request request,
org.snmp4j.smi.OID index) |
Gets a
DefaultMOTable.ChangeSet that contains the row values as if they had been already committed (not
taking into account value modifications performed by the columns commit operations). |
MOScope |
getScope() |
Returns the scope of object identifiers this managed object is managing.
|
org.snmp4j.smi.OID |
getUpperBound() |
Gets the upper bound OID of the scope.
|
protected org.snmp4j.smi.Variable |
getValue(MOTableRow row,
int col,
SubRequest req) |
|
org.snmp4j.smi.Variable |
getValue(org.snmp4j.smi.OID cellOID) |
Gets the value of the cell instance with the specified instance OID.
|
org.snmp4j.smi.Variable |
getValue(org.snmp4j.smi.OID index,
int col) |
Gets the value of the cell instance in the specified column and row.
|
org.snmp4j.smi.Variable |
getValue(org.snmp4j.smi.OID index,
int col,
SubRequest req) |
|
protected boolean |
hasNewRows(Request key) |
|
boolean |
importInstance(org.snmp4j.smi.OID instanceID,
java.util.List<org.snmp4j.smi.VariableBinding> data,
ImportMode importMode) |
Imports the data that internally represents the instance specified by the OID suffix
instanceID
from the byte data provided which can be encoded in any representation the ManagedObject is able to
understand. |
int |
instanceCount() |
Returns the number of instances managed by this
ManagedObject . |
java.util.Iterator<org.snmp4j.smi.OID> |
instanceIterator() |
|
protected boolean |
isChangeSetComplete(SubRequest subRequest,
org.snmp4j.smi.OID index,
int column) |
|
boolean |
isCovered(MOScope other) |
Checks whether the supplied scope is covered by this scope.
|
boolean |
isLowerIncluded() |
Indicates whether the lower bound OID is included in the scope or not.
|
boolean |
isOverlapping(MOScope other) |
Checks whether the supplied scope overlap with this one, thus sharing at
least one OID with the supplied one.
|
boolean |
isUpperIncluded() |
Indicates whether the upper bound OID is included in the scope or not.
|
boolean |
isVolatile() |
Tests if this instance of a SerializableManagedObject should be
serialized or deserialized through persistent storage
load or save operation.
|
void |
load(MOInput input) |
Loads the content of the managed object from the specified input (stream).
|
protected void |
loadRow(org.snmp4j.smi.OID rowIndex,
org.snmp4j.smi.Variable[] rawRowValues,
int importMode) |
|
boolean |
next(SubRequest request) |
Finds the successor instance for the object instance ID (OID) given
by the supplied sub-request and returns it within the supplied sub-request
object.
|
void |
prepare(SubRequest request) |
Prepares a SET (sub)request.
|
int |
removeAll() |
Removes all rows from this table.
|
int |
removeAnyStorageType(java.util.Set<StorageType.StorageTypeEnum> storageTypeSet) |
Remove all rows that have a
StorageType column with a value that matches one of the provided values. |
protected int |
removeAnyStorageType(java.util.Set<StorageType.StorageTypeEnum> storageTypeSet,
int storageTypeColumn) |
|
void |
removeMOChangeListener(MOChangeListener l) |
Removes a
MOChangeListener from this ManagedObject . |
void |
removeMOTableRowListener(MOTableRowListener<R> l) |
Removes
MOTableRowListener instance. |
R |
removeRow(org.snmp4j.smi.OID index) |
Removes the row with the specified index and returns it if the operation
was successful.
|
void |
save(MOOutput output) |
Saves the (non-volatile) content of this managed object to the specified
output (stream).
|
void |
setModel(M model) |
|
boolean |
setValue(org.snmp4j.smi.VariableBinding newValueAndInstancceOID) |
Sets the value of a particular MIB object instance managed by
this
ManagedObject . |
void |
setVolatile(boolean isVolatile) |
|
java.lang.String |
toString() |
|
void |
undo(SubRequest request) |
Compensates (undo) a (sub)request when a commit of another subrequest
failed with an error.
|
void |
update(MOScope updateScope) |
Update the content of this table that is covered by the supplied
scope.
|
protected void |
update(MOScope range,
SubRequest request) |
Update this table for the supplied search range and sub-request if it has
not yet been updated for that request.
|
protected M extends MOTableModel<R> model
protected java.util.WeakHashMap<Request,java.util.Map<org.snmp4j.smi.OID,R extends MOTableRow>> newRows
protected java.util.WeakHashMap<Request,java.util.Map<org.snmp4j.smi.OID,DefaultMOTable.ChangeSet>> pendingChanges
protected transient java.util.List<MOChangeListener> moChangeListeners
protected transient java.util.List<MOTableRowListener<R extends MOTableRow>> moTableRowListeners
protected transient java.util.List<RowModificationControlColumn> rowModificationControlColumns
public DefaultMOTable(org.snmp4j.smi.OID oid, MOTableIndex indexDef, C[] columns)
public DefaultMOTable(org.snmp4j.smi.OID oid, MOTableIndex indexDef, C[] columns, M model)
MOTableModel
.oid
- the OID of the SNMP table's Entry object. If the table is ifTable
(1.3.6.1.2.1.2.2) then the OID to provide is 1.3.6.1.2.1.2.2.1
which is the ifEntry OID. By SMI rule, you can simply append ".1" to
the table OID.indexDef
- the index definition of the table based on the INDEX clause of the
table MIB definition.columns
- the column definitions which may also include non-accessible columns.model
- the table model holding the table data.public MOTableCellInfo getCellInfo(org.snmp4j.smi.OID oid)
MOTable
MOTableCellInfo
instance for the supplied
cell OID. The returned object contains the index, column index, and
column ID of the specified cell, if available.getCellInfo
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
oid
- cell instance OID.MOTableCellInfo
instance with the index, column index
and column ID of the specified cell if available.public int getColumnIndex(int id)
MOTable
getColumnIndex
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
id
- a column sub-identifier (normally one based) as defined in the MIB
specification.id
. The column index
points into the column array returned by MOTable.getColumns()
.
A value less than zero indicates that such a column does not exists
currently but could be inserted at the (-n)-1
position
if n
is the returned value.public C getColumn(int index)
MOTable
getColumn
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
index
- the (zero-based) column index.MOColumn
instance describing the attributes of requested
column.public int getColumnCount()
MOTable
getColumnCount
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
public R createRow(org.snmp4j.smi.OID index, org.snmp4j.smi.Variable[] initialValues)
MOMutableTableModel
instance or if one of the MOTableRowListener
deny the row creation
attempt then null
will be returned.createRow
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
index
- the index OID of the new row.initialValues
- the initial values that should be assigned to the new row. If the array
contains less values than this table has columns, default values will
be created for the missing columns.MOTableRow
instance or null
if
the row cannot be created.public R addNewRow(org.snmp4j.smi.OID index, org.snmp4j.smi.Variable[] initialValues)
MOTable
MOTable.addRow(MOTableRow)
.
If one of the MOTableRowListener
deny the row creation
attempt then null
will be returned and MOTable.addRow(MOTableRow)
will not be called.
This method is the same as calling:
R newRow = createRow(index, initialValues); if (newRow != null) { addRow(newRow); } return newRow;
addNewRow
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
index
- the index OID of the new row.initialValues
- the initial values that should be assigned to the new row.MOTableRow
instance or null
if
the row cannot be created.public R createRow(org.snmp4j.smi.OID index)
MOTable
MOTableRowListener
deny the row creation attempt then null
will be returned.createRow
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
index
- the index OID of the new row.MOTableRow
instance or null
if
the row cannot be created.public boolean addRow(R row)
MOTableRowEvent
. Since this method is typically
called during the commit phase of a SET request that creates a table,
it should be avoided to return an error here. Instead, error checking
should be placed in the prepare(org.snmp4j.agent.request.SubRequest)
method.addRow
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
row
- the MOTableRow
to add.true
if the row has been added or false
if it could not be added.public R removeRow(org.snmp4j.smi.OID index)
MOTable
removeRow
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
index
- the index OID of the row to remove.null
if the row cannot be found or
cannot be removed.public int removeAll()
public int removeAnyStorageType(java.util.Set<StorageType.StorageTypeEnum> storageTypeSet)
StorageType
column with a value that matches one of the provided values.storageTypeSet
- a set of StorageType.StorageTypeEnum
values.StorageType
column.protected int removeAnyStorageType(java.util.Set<StorageType.StorageTypeEnum> storageTypeSet, int storageTypeColumn)
public void commit(SubRequest request)
ManagedObject
commit
in interface ManagedObject
request
- the SubRequest
to process.public final org.snmp4j.smi.OID getIndexPart(org.snmp4j.smi.OID anyOID)
MOTable
getIndexPart
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
anyOID
- the OID of a column instance. The returned result is undefined, when
this OID is not a column instance OID.instanceIdentifier
column instance OID.public org.snmp4j.smi.OID getCellOID(org.snmp4j.smi.OID index, int col)
public org.snmp4j.smi.OID find(MOScope range)
MOTable
find
in interface ManagedObject
find
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
range
- a MOScope
specifying the search range.null
if no such instance exists.protected MOTableCellInfo findCell(MOScope range, SubRequest request)
public MOScope getScope()
ManagedObject
getScope
in interface ManagedObject
MOScope
that defines a range (possibly also a single
or none instance OID) of object IDs managed by this managed object.public org.snmp4j.smi.Variable getValue(org.snmp4j.smi.OID cellOID)
MOTable
getValue
in interface ManagedObjectValueAccess
getValue
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
cellOID
- the instance OID of the requested cell.null
if such a cell does not
exist.public org.snmp4j.smi.Variable getValue(org.snmp4j.smi.OID index, int col, SubRequest req)
public org.snmp4j.smi.Variable getValue(org.snmp4j.smi.OID index, int col)
MOTable
getValue
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
index
- the row index of the cell.col
- the column index of the cell.null
if such a cell does not
exist.protected org.snmp4j.smi.Variable getValue(MOTableRow row, int col, SubRequest req)
public void update(MOScope updateScope)
This method is part of the UpdatableManagedObject
interface.
Although the DefaultMOTable
does not implement that interface,
subclasses of this class may do so easily by overriding this hook-up
method.
updateScope
- the scope to update. If null
the whole managed object is
updated.update(MOScope range, SubRequest request)
protected void update(MOScope range, SubRequest request)
By default, the
update(MOScope updateScope)
is being called on behalf of this
method call (which itself does not nothing by default). You may choose
either to implement the UpdatableManagedObject
interface and
implement its interface in a subclass. Then it is recommended to overwrite
this method by an empty method. Otherwise, do not implement the
UpdatableManagedObject
interface.
range
- the search range.request
- the sub-request triggered the update or null
if that
request cannot be determined.public void get(SubRequest request)
ManagedObject
get
in interface ManagedObject
request
- the SubRequest
to process.public boolean next(SubRequest request)
ManagedObject
next
in interface ManagedObject
request
- the SubRequest
to process.true
if the search request found an appropriate instance,
false
otherwise.public void prepare(SubRequest request)
ManagedObject
prepare
in interface ManagedObject
request
- the SubRequest
to process.protected java.util.List<RowModificationControlColumn> getRowModificationControlColumns()
protected int getChangesFromRequest(org.snmp4j.smi.OID index, MOTableRow row, SubRequest request, org.snmp4j.smi.Variable[] values, boolean setDefaultValues, boolean newRow)
protected boolean hasNewRows(Request key)
protected boolean isChangeSetComplete(SubRequest subRequest, org.snmp4j.smi.OID index, int column)
protected DefaultMOTable.ChangeSet addPendingChanges(SubRequest subRequest, MOTableRow row, boolean newRow)
protected DefaultMOTable.ChangeSet getPendingChangeSet(SubRequest subRequest, org.snmp4j.smi.OID index)
public DefaultMOTable.ChangeSet getRowPreview(Request request, org.snmp4j.smi.OID index)
DefaultMOTable.ChangeSet
that contains the row values as if they had been already committed (not
taking into account value modifications performed by the columns commit operations).
This method can be called when processing commits of other ManagedObject
s on behalf of the same SNMP
request to determine what a certain row will contain if the this SET will be successful.request
- the request to preview. If null
or no pending changes exist for this request, the current row values
are returned.index
- the row index of the row to return.request
has already been committed of the row identified by index
.public void cleanup(SubRequest request)
ManagedObject
cleanup
in interface ManagedObject
request
- the SubRequest
to process.public void undo(SubRequest request)
ManagedObject
undo
in interface ManagedObject
request
- the SubRequest
to process.public org.snmp4j.smi.OID getOID()
MOTable
getOID
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
public void setModel(M model)
public void setVolatile(boolean isVolatile)
public M getModel()
MOTable
getModel
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
public C[] getColumns()
MOTable
getColumns
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
public MOTableIndex getIndexDef()
MOTable
getIndexDef
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
public boolean isVolatile()
SerializableManagedObject
isVolatile
in interface RandomAccessManagedObject
isVolatile
in interface SerializableManagedObject
true
if SerializableManagedObject.load(org.snmp4j.agent.io.MOInput)
and SerializableManagedObject.save(org.snmp4j.agent.io.MOOutput)
should not be
called through a persistent storage operation and false
if these method should be called.public org.snmp4j.smi.OID getLowerBound()
MOScope
MOScope.isLowerIncluded()
.getLowerBound
in interface MOScope
public org.snmp4j.smi.OID getUpperBound()
MOScope
MOScope.isUpperIncluded()
.getUpperBound
in interface MOScope
public boolean isLowerIncluded()
MOScope
isLowerIncluded
in interface MOScope
true
if the lower bound is included.public boolean isUpperIncluded()
MOScope
isUpperIncluded
in interface MOScope
true
if the upper bound is included.public boolean isCovered(MOScope other)
MOScope
public boolean isOverlapping(MOScope other)
MOScope
isOverlapping
in interface MOScope
other
- a MOScope
.true
if there exists at least one OID that is included in
both scopes.public void addMOChangeListener(MOChangeListener l)
ChangeableManagedObject
MOChangeListener
that needs to be informed about
state changes of this ManagedObject
.addMOChangeListener
in interface ChangeableManagedObject
l
- a MOChangeListener
instance.public void removeMOChangeListener(MOChangeListener l)
ChangeableManagedObject
MOChangeListener
from this ManagedObject
.removeMOChangeListener
in interface ChangeableManagedObject
l
- a MOChangeListener
instance.protected void fireBeforePrepareMOChange(MOChangeEvent changeEvent)
protected void fireAfterPrepareMOChange(MOChangeEvent changeEvent)
protected void fireBeforeMOChange(MOChangeEvent changeEvent)
protected void fireAfterMOChange(MOChangeEvent changeEvent)
public void addMOTableRowListener(MOTableRowListener<R> l)
MOTable
MOTableRowListener
listener that needs to be informed
about row changes (creation, addition, removal).addMOTableRowListener
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
l
- a MOTableRowListener
instance.public MOTableRow getDependentTableRow(org.snmp4j.smi.OID dependentTableID, org.snmp4j.smi.OID index)
MOTableRelation
) with the provided table entry object identifier.dependentTableID
- the OID of the MOTable
that is linked with a MOTableRelation
as dependent table.index
- the row index of the dependent's table row that should be returned.MOTableRow
if such a row exists or null
otherwise.protected void fireRowExistsEvent(MOTableRowListener<R> l)
MOTableRowEvent.EXISTS
for all rows in this table if the provided listener actively subscribes
to all such events this time by setting MOTableRowEvent.setSendNextEventsOfSameOrigin(boolean)
to
true
on the first rows and following events.l
- the table row listener.public void removeMOTableRowListener(MOTableRowListener<R> l)
MOTable
MOTableRowListener
instance.removeMOTableRowListener
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
l
- a MOTableRowListener
instance.protected void fireRowChanged(MOTableRowEvent<R> event)
public boolean importInstance(org.snmp4j.smi.OID instanceID, java.util.List<org.snmp4j.smi.VariableBinding> data, ImportMode importMode)
RandomAccessManagedObject
instanceID
from the byte data provided which can be encoded in any representation the ManagedObject
is able to
understand.importInstance
in interface RandomAccessManagedObject
instanceID
- the OID suffix identifying the instance to export, for scalars this is "0" and for tabular objects
this is the row index.data
- the SNMP data of the instance where the OID identifies the sub-instance (i.e. the column sub-ID for row
instances and "0" for scalar objects).importMode
- defines the import strategy - must not be null
!true
if the import was successful, false
otherwise.public java.util.List<org.snmp4j.smi.VariableBinding> exportInstance(org.snmp4j.smi.OID instanceID)
RandomAccessManagedObject
ManagedObject
.exportInstance
in interface RandomAccessManagedObject
instanceID
- the OID suffix identifying the instance to export, for scalars this is "0" and for tabular objects
this is the row index.public java.util.Iterator<org.snmp4j.smi.OID> instanceIterator()
instanceIterator
in interface RandomAccessManagedObject
public org.snmp4j.smi.OID getInstanceSubID(org.snmp4j.smi.OID instanceOID)
importInstance(OID, List, ImportMode)
,
exportInstance(OID)
, and instanceIterator()
.getInstanceSubID
in interface RandomAccessManagedObject
instanceOID
- the fully qualified OID
of a SNMP Variable
.Variable
belongs to within this RandomAccessManagedObject
.public int instanceCount()
ManagedObject
.instanceCount
in interface RandomAccessManagedObject
public org.snmp4j.smi.OID getID()
RegisteredManagedObject
getID
in interface RegisteredManagedObject
public void load(MOInput input) throws java.io.IOException
SerializableManagedObject
load
in interface SerializableManagedObject
input
- a MOInput
instance.java.io.IOException
- if an MOInput operation fails.protected void loadRow(org.snmp4j.smi.OID rowIndex, org.snmp4j.smi.Variable[] rawRowValues, int importMode)
public void save(MOOutput output) throws java.io.IOException
SerializableManagedObject
save
in interface SerializableManagedObject
output
- a MOOutput
instance.java.io.IOException
- if an MOOutput operation fails.protected org.snmp4j.smi.Variable[] getPersistentValues(MOTableRow row)
save(MOOutput output)
call.row
- a MOTableRow that is being saved into a MOOutput stream.Variable
instances that need to be saved.
Typically, these are all columns of the row - including hidden
extension columns/values.public org.snmp4j.smi.Variable[] getDefaultValues()
MOTable
null
and contains that default value.getDefaultValues
in interface MOTable<R extends MOTableRow,C extends MOColumn,M extends MOTableModel<R>>
Variable
instances.public java.lang.String toString()
toString
in class java.lang.Object
public boolean covers(org.snmp4j.smi.OID oid)
MOScope
public boolean setValue(org.snmp4j.smi.VariableBinding newValueAndInstancceOID)
ManagedObjectValueAccess
ManagedObject
. This is a low level operation, thus
no change events will be fired.setValue
in interface ManagedObjectValueAccess
newValueAndInstancceOID
- a VariableBinding
identifying the object instance to modify
by its OID and the new value by its variable part.true
if the object instance exists and has been modified
successfully, false
otherwise.Copyright © 2018 SNMP4J.org. All rights reserved.