java.lang.Object
org.snmp4j.agent.mo.MOColumn<org.snmp4j.smi.Integer32>
org.snmp4j.agent.mo.MOMutableColumn<org.snmp4j.smi.Integer32>
org.snmp4j.agent.mo.snmp.StorageType
- All Implemented Interfaces:
Comparable<MOColumn<org.snmp4j.smi.Integer32>>
,RowModificationControlColumn
public class StorageType
extends MOMutableColumn<org.snmp4j.smi.Integer32>
implements RowModificationControlColumn
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
TheStorageTypeEnum
as a enumerated representastion of the StorageType SMI values. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
-
Constructor Summary
ConstructorDescriptionStorageType
(int columnID, MOAccess access, org.snmp4j.smi.Integer32 defaultValue) StorageType
(int columnID, MOAccess access, org.snmp4j.smi.Integer32 defaultValue, boolean mutableInService) -
Method Summary
Modifier and TypeMethodDescriptionstatic org.snmp4j.smi.Integer32
getStorageType
(MOTableRow row, MOTable<?, ?, ?> table) Gets the value of the StorageType column (if it exists) in the specified row and table.boolean
isVolatile
(MOTableRow row, int column) Checks if the row is volatile (i.e.void
prepareRow
(SubRequest<?> subRequest, MOMutableTableRow currentRow, MOTableRow changeSet) Prepares a row for changes described by the supplied change set.int
validate
(org.snmp4j.smi.Integer32 newValue, org.snmp4j.smi.Integer32 oldValue, org.snmp4j.smi.OID instanceOID) Validate the new value for a mutable column based on old value and (new in v3.7.0) the instance OID.Methods inherited from class org.snmp4j.agent.mo.MOMutableColumn
addMOValueValidationListener, cleanup, commit, getDefaultValue, isMandatory, isMutableInService, prepare, removeMOValueValidationListener, setDefaultValue, setMandatory, setMutableInService, toString, undo, validate, validateSetRequest
Methods inherited from class org.snmp4j.agent.mo.MOColumn
compareTo, get, getAccess, getColumnID, getRestoreValue, getStoreValue, getSyntax, getTable, getValue, setAccess, setColumnID, setSyntax, setTable
-
Field Details
-
other
public static final int other- See Also:
-
volatile_
public static final int volatile_- See Also:
-
nonVolatile
public static final int nonVolatile- See Also:
-
permanent
public static final int permanent- See Also:
-
readOnly
public static final int readOnly- See Also:
-
-
Constructor Details
-
StorageType
public StorageType(int columnID, MOAccess access, org.snmp4j.smi.Integer32 defaultValue, boolean mutableInService) -
StorageType
-
-
Method Details
-
getStorageType
Gets the value of the StorageType column (if it exists) in the specified row and table. It starts searching for theStorageType
column from the last column and then proceeds down to the first until it finds it. If noStorageType
column can be found,null
is returned.- Parameters:
row
- a row with aStorageType
column (otherwisenull
is returned).table
- the table of the givenrow
.- Returns:
- the
Integer32
value of theStorageType
column in the givenrow
ornull
if the table has noStorageType
column or the value of that column isnull
. - Since:
- 3.3.1
-
validate
public int validate(org.snmp4j.smi.Integer32 newValue, org.snmp4j.smi.Integer32 oldValue, org.snmp4j.smi.OID instanceOID) Description copied from class:MOMutableColumn
Validate the new value for a mutable column based on old value and (new in v3.7.0) the instance OID.- Overrides:
validate
in classMOMutableColumn<org.snmp4j.smi.Integer32>
- Parameters:
newValue
- the new value to be set.oldValue
- the existing value.instanceOID
- the instance OID of the table cell to be modified.- Returns:
SnmpConstants.SNMP_ERROR_SUCCESS
if the change is OK, otherwise a SNMP error status.
-
prepareRow
public void prepareRow(SubRequest<?> subRequest, MOMutableTableRow currentRow, MOTableRow changeSet) Prepares a row for changes described by the supplied change set. If the modification cannot be successfully prepared, the error status of the suppliedsubRequest
should be set to the appropriate error status value. This method is called only once per modified row.- Specified by:
prepareRow
in interfaceRowModificationControlColumn
- Parameters:
subRequest
- the sub-request that triggered the row change and that can be used to deny the commit phase by setting its error status.currentRow
- the current row (yet unmodified).changeSet
- a MOTableRow instance that represents the state of the row if all changes have been applied successfully.
-
isVolatile
Checks if the row is volatile (i.e. must not be stored in stable storage) or not. Note: In SNMP4J-Agent before 3.0, this method returned alsotrue
for rows with storage typereadOnly
which did not follow the SMI definition ofStorageType
. See alsoImportMode
for details about restore data from stable 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
if the storage type of this row isother
orvolatile_
.
-