- 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<MOColumn<org.snmp4j.smi.Integer32>>,EventListener,MOChangeListener,MOTableRowListener<R>
public class RowStatus<R extends MOTableRow> extends MOMutableColumn<org.snmp4j.smi.Integer32> implements MOChangeListener, MOTableRowListener<R>
TheRowStatusclass 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
RowStatusListeners.- Version:
- 1.0
- Author:
- Frank Fock
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRowStatus.ActiveRowsFilter<R extends MOTableRow>TheActiveRowsFilteris aMOTableRowFilterthat returns only the active rows of a table with a RowStatus column.static classRowStatus.RowStatusEnumstatic classRowStatus.RowStatusFilter<R extends MOTableRow>TheRowStatusFilteris aMOTableRowFilterthat returns only those rows that have a status that equals one of those provided during creation of the filter.
-
Field Summary
Fields Modifier and Type Field Description static intactivestatic intcreateAndGostatic intcreateAndWaitstatic intdestroystatic intnotExistentstatic intnotInServicestatic intnotReady
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRowStatusListener(RowStatusListener l)voidafterMOChange(MOChangeEvent changeEvent)A change has been committed.voidafterPrepareMOChange(MOChangeEvent changeEvent)A change has been prepared.protected voidassignNewValue(SubRequest<?> subRequest, MOTableRow row, int column, int newValue)voidbeforeMOChange(MOChangeEvent changeEvent)A ManagedObject change is being committed.voidbeforePrepareMOChange(MOChangeEvent changeEvent)A ManagedObject change is being prepared.voidcommit(SubRequest<?> subRequest, MOTableRow row, MOTableRow changeSet, int column)protected voidfireRowStatusChanged(RowStatusEvent event)voidget(SubRequest<?> subRequest, MOTableRow row, int column)Process a get sub-request for the specified table row and column.static org.snmp4j.smi.Integer32getRowStatus(MOTableRow row, MOTable<?,?,?> table)Gets the value of the RowStatus column (if it exists) in the specified row and table.protected booleanisReady(MOTableRow row, int rowStatusColumn)protected booleanisReady(MOTableRow row, int rowStatusColumn, MOTableRow changeSet)static booleanisRowActive(MOTableRow row, int rowStatusColumnIndex)Tests if the specified row is active.booleanisVolatile(MOTableRow row, int column)Tests if the supplied row is volatile or persistent.voidprepare(SubRequest<?> subRequest, MOTableRow row, MOTableRow changeSet, int column)voidremoveRowStatusListener(RowStatusListener l)voidrowChanged(MOTableRowEvent<R> 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.voidundo(SubRequest<?> subRequest, MOTableRow row, int column)voidunsetTable(MOTable<R,? extends MOColumn,? extends MOTableModel<R>> table)Unsets the table instance and thus unregisters itself asMOChangeListenerandMOTableRowListener.-
Methods inherited from class org.snmp4j.agent.mo.MOColumn
compareTo, getAccess, getColumnID, getRestoreValue, getStoreValue, getSyntax, getTable, getValue, setAccess, setColumnID, setSyntax
-
Methods inherited from class org.snmp4j.agent.mo.MOMutableColumn
addMOValueValidationListener, cleanup, getDefaultValue, isMandatory, isMutableInService, removeMOValueValidationListener, setDefaultValue, setMandatory, setMutableInService, toString, validate, validateSetRequest
-
-
-
-
Field Detail
-
notExistent
public static final int notExistent
- See Also:
- Constant Field Values
-
active
public static final int active
- See Also:
- Constant Field Values
-
notInService
public static final int notInService
- See Also:
- Constant Field Values
-
notReady
public static final int notReady
- See Also:
- Constant Field Values
-
createAndGo
public static final int createAndGo
- See Also:
- Constant Field Values
-
createAndWait
public static final int createAndWait
- See Also:
- Constant Field Values
-
destroy
public static final int destroy
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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
public RowStatus(int columnID, MOAccess access)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 Detail
-
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 byMOTableinstance to register the table with the RowStatus column. When called, this RowStatus registers itself asMOChangeListenerandMOTableRowListener.- Overrides:
setTablein classMOColumn<org.snmp4j.smi.Integer32>- Type Parameters:
R- theMOTableRowtype supported by the table.- Parameters:
table- theMOTableinstance where this column is contained in.
-
unsetTable
public void unsetTable(MOTable<R,? extends MOColumn,? extends MOTableModel<R>> table)
Unsets the table instance and thus unregisters itself asMOChangeListenerandMOTableRowListener.- Parameters:
table- theMOTableinstance where this column was part of.
-
isReady
protected boolean isReady(MOTableRow row, int rowStatusColumn)
-
isReady
protected boolean isReady(MOTableRow row, int rowStatusColumn, MOTableRow changeSet)
-
prepare
public void prepare(SubRequest<?> subRequest, MOTableRow row, MOTableRow changeSet, int column)
- Overrides:
preparein classMOMutableColumn<org.snmp4j.smi.Integer32>
-
commit
public void commit(SubRequest<?> subRequest, MOTableRow row, MOTableRow changeSet, int column)
- Overrides:
commitin classMOMutableColumn<org.snmp4j.smi.Integer32>
-
assignNewValue
protected void assignNewValue(SubRequest<?> subRequest, MOTableRow row, int column, int newValue)
-
undo
public void undo(SubRequest<?> subRequest, MOTableRow row, int column)
- Overrides:
undoin classMOMutableColumn<org.snmp4j.smi.Integer32>
-
beforePrepareMOChange
public void beforePrepareMOChange(MOChangeEvent changeEvent)
Description copied from interface:MOChangeListenerA ManagedObject change is being prepared. To cancel preparation set the deny reason to a SNMPv2/v3 error status.- Specified by:
beforePrepareMOChangein interfaceMOChangeListener- Parameters:
changeEvent- the change event object.
-
beforeMOChange
public void beforeMOChange(MOChangeEvent changeEvent)
Description copied from interface:MOChangeListenerA 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:
beforeMOChangein interfaceMOChangeListener- Parameters:
changeEvent- the change event object.
-
afterMOChange
public void afterMOChange(MOChangeEvent changeEvent)
Description copied from interface:MOChangeListenerA change has been committed. Setting the deny reason of the supplied event object will be ignored.- Specified by:
afterMOChangein interfaceMOChangeListener- Parameters:
changeEvent- the change event object.
-
afterPrepareMOChange
public void afterPrepareMOChange(MOChangeEvent changeEvent)
Description copied from interface:MOChangeListenerA change has been prepared. Setting the deny reason of the supplied event object will be ignored.- Specified by:
afterPrepareMOChangein interfaceMOChangeListener- Parameters:
changeEvent- the change event object.
-
addRowStatusListener
public void addRowStatusListener(RowStatusListener l)
-
removeRowStatusListener
public void removeRowStatusListener(RowStatusListener l)
-
fireRowStatusChanged
protected void fireRowStatusChanged(RowStatusEvent event)
-
isRowActive
public static boolean isRowActive(MOTableRow row, int rowStatusColumnIndex)
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:
trueifrowis active.
-
getRowStatus
public static org.snmp4j.smi.Integer32 getRowStatus(MOTableRow row, MOTable<?,?,?> table)
-
rowChanged
public void rowChanged(MOTableRowEvent<R> event)
Description copied from interface:MOTableRowListenerA column or a complete row is changed/has been changed.- Specified by:
rowChangedin interfaceMOTableRowListener<R extends MOTableRow>- Parameters:
event- aMOTableRowEventdescribing the event. To veto the event theMOTableRowEvent.setVetoStatus(int)and optionally also theMOTableRowEvent.setVetoColumn(int)can be called. IfMOTableRowEvent.getNumberOfConsecutiveEventsOfSameOrigin()is greater than zero you need to setMOTableRowEvent.setSendNextEventsOfSameOrigin(boolean)totruein order to receive those consecutive events too. Otherwise they will be ignored and not been propagated to this listener.
-
isVolatile
public boolean isVolatile(MOTableRow row, int column)
Description copied from class:MOColumnTests 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:
isVolatilein 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:
trueifrowshould not be
-
get
public void get(SubRequest<?> subRequest, MOTableRow row, int column)
Description copied from class:MOColumnProcess a get sub-request for the specified table row and column.
-
-