Package org.snmp4j.agent.mo.snmp
Class RowStatus<R extends MOTableRow>
java.lang.Object
org.snmp4j.agent.mo.MOColumn<V>
org.snmp4j.agent.mo.MOMutableColumn<org.snmp4j.smi.Integer32>
org.snmp4j.agent.mo.snmp.RowStatus<R>
- Type Parameters:
R
- The row type of the rows managed by this RowStatus.
- All Implemented Interfaces:
Comparable
,EventListener
,MOChangeListener
,MOTableRowListener<R>
public class RowStatus<R extends MOTableRow>
extends MOMutableColumn<org.snmp4j.smi.Integer32>
implements MOChangeListener, MOTableRowListener<R>
The
RowStatus
class implements the columnar object TC RowStatus.
The RowStatus textual convention is used to manage the creation and deletion
of conceptual rows, and is used as the value of the SYNTAX clause for the
status column of a conceptual row. See RFC 2579.
The RowStatus column controls row creation and deletion in SNMP tables with
READ-CREATE maximum access. Since the state of a dynamic row is/may be
important to dependent rows / other objects of an agent, row status change
events can be propagated to other objects through registering
RowStatusListener
s.- Version:
- 1.0
- Author:
- Frank Fock
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
RowStatus.ActiveRowsFilter<R extends MOTableRow>
TheActiveRowsFilter
is aMOTableRowFilter
that returns only the active rows of a table with a RowStatus column. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
afterMOChange
(MOChangeEvent changeEvent) A change has been committed.void
afterPrepareMOChange
(MOChangeEvent changeEvent) A change has been prepared.protected void
assignNewValue
(SubRequest subRequest, MOTableRow row, int column, int newValue) void
beforeMOChange
(MOChangeEvent changeEvent) A ManagedObject change is being committed.void
beforePrepareMOChange
(MOChangeEvent changeEvent) A ManagedObject change is being prepared.void
commit
(SubRequest subRequest, MOTableRow row, MOTableRow changeSet, int column) protected void
void
get
(SubRequest subRequest, MOTableRow row, int column) Process a get sub-request for the specified table row and column.static org.snmp4j.smi.Integer32
getRowStatus
(MOTableRow<?> row, MOTable<?, ?, ?> table) Gets the value of the RowStatus column (if it exists) in the specified row and table.protected boolean
isReady
(MOTableRow row, int rowStatusColumn) protected boolean
isReady
(MOTableRow row, int rowStatusColumn, MOTableRow changeSet) static boolean
isRowActive
(MOTableRow row, int rowStatusColumnIndex) Tests if the specified row is active.boolean
isVolatile
(MOTableRow row, int column) Tests if the supplied row is volatile or persistent.void
prepare
(SubRequest subRequest, MOTableRow row, MOTableRow changeSet, int column) void
void
rowChanged
(MOTableRowEvent event) A column or a complete row is changed/has been changed.<R extends MOTableRow>
voidsetTable
(MOTable<R, ? extends MOColumn, ? extends MOTableModel<R>> table) Sets the table instance this columnar object is contained in.void
undo
(SubRequest subRequest, MOTableRow row, int column) void
unsetTable
(MOTable<R, ? extends MOColumn, ? extends MOTableModel<R>> table) Unsets the table instance and thus unregisters itself asMOChangeListener
andMOTableRowListener
.Methods inherited from class org.snmp4j.agent.mo.MOMutableColumn
addMOValueValidationListener, cleanup, getDefaultValue, isMandatory, isMutableInService, removeMOValueValidationListener, setDefaultValue, setMandatory, setMutableInService, toString, validate, validateSetRequest
Methods inherited from class org.snmp4j.agent.mo.MOColumn
compareTo, getAccess, getColumnID, getRestoreValue, getStoreValue, getSyntax, getTable, getValue, setAccess, setColumnID, setSyntax
-
Field Details
-
notExistant
public static final int notExistant- See Also:
-
active
public static final int active- See Also:
-
notInService
public static final int notInService- See Also:
-
notReady
public static final int notReady- See Also:
-
createAndGo
public static final int createAndGo- See Also:
-
createAndWait
public static final int createAndWait- See Also:
-
destroy
public static final int destroy- See Also:
-
-
Constructor Details
-
RowStatus
public RowStatus(int columnID) Creates a RowStatus column with the specified column sub-identifier and maximum access of 'read-create'.- Parameters:
columnID
- a column sub-identifier.
-
RowStatus
Creates a RowStatus column with the specified column sub-identifier.- Parameters:
columnID
- a column sub-identifier.access
- the maximum access for the RowStatus column (should be READ-CREATE).
-
-
Method Details
-
setTable
public <R extends MOTableRow> void setTable(MOTable<R, ? extends MOColumn, ? extends MOTableModel<R>> table) Sets the table instance this columnar object is contained in. This method should be called byMOTable
instance to register the table with the RowStatus column. When called, this RowStatus registers itself asMOChangeListener
andMOTableRowListener
.- Overrides:
setTable
in classMOColumn<org.snmp4j.smi.Integer32>
- Type Parameters:
R
- theMOTableRow
type supported by the table.- Parameters:
table
- theMOTable
instance where this column is contained in.
-
unsetTable
Unsets the table instance and thus unregisters itself asMOChangeListener
andMOTableRowListener
.- Parameters:
table
- theMOTable
instance where this column was part of.
-
isReady
-
isReady
-
getRowStatus
-
prepare
- Overrides:
prepare
in classMOMutableColumn<org.snmp4j.smi.Integer32>
-
commit
- Overrides:
commit
in classMOMutableColumn<org.snmp4j.smi.Integer32>
-
assignNewValue
-
undo
- Overrides:
undo
in classMOMutableColumn<org.snmp4j.smi.Integer32>
-
beforePrepareMOChange
Description copied from interface:MOChangeListener
A ManagedObject change is being prepared. To cancel preparation set the deny reason to a SNMPv2/v3 error status.- Specified by:
beforePrepareMOChange
in interfaceMOChangeListener
- Parameters:
changeEvent
- the change event object.
-
beforeMOChange
Description copied from interface:MOChangeListener
A ManagedObject change is being committed. To cancel the commit phase set the deny reason to a SNMPv2/v3 error status.NOTE: Canceling the commit phase must be avoided. Setting a deny reason has only an effect if
DeniableEventObject.isDeniable()
returnstrue
. Otherwise, you will need to throw an exception.- Specified by:
beforeMOChange
in interfaceMOChangeListener
- Parameters:
changeEvent
- the change event object.
-
afterMOChange
Description copied from interface:MOChangeListener
A change has been committed. Setting the deny reason of the supplied event object will be ignored.- Specified by:
afterMOChange
in interfaceMOChangeListener
- Parameters:
changeEvent
- the change event object.
-
afterPrepareMOChange
Description copied from interface:MOChangeListener
A change has been prepared. Setting the deny reason of the supplied event object will be ignored.- Specified by:
afterPrepareMOChange
in interfaceMOChangeListener
- Parameters:
changeEvent
- the change event object.
-
addRowStatusListener
-
removeRowStatusListener
-
fireRowStatusChanged
-
isRowActive
Tests if the specified row is active.- Parameters:
row
- a row with a RowStatus column.rowStatusColumnIndex
- the column index of the RowStatus column inrow
.- Returns:
true
ifrow
is active.
-
rowChanged
Description copied from interface:MOTableRowListener
A column or a complete row is changed/has been changed.- Specified by:
rowChanged
in interfaceMOTableRowListener<R extends MOTableRow>
- Parameters:
event
- aMOTableRowEvent
describing the event. To veto the event theMOTableRowEvent.setVetoStatus(int)
and optionally also theMOTableRowEvent.setVetoColumn(int)
can be called.
-
isVolatile
Description copied from class:MOColumn
Tests if the supplied row is volatile or persistent. If volatile then the row will not be saved when the table is saved to persistent storage.- Overrides:
isVolatile
in classMOColumn<org.snmp4j.smi.Integer32>
- Parameters:
row
- a row of the table where this column is part of.column
- the column index of this column inrow
.- Returns:
true
ifrow
should not be
-
get
Description copied from class:MOColumn
Process a get sub-request for the specified table row and column.
-