Package org.snmp4j.agent.mo
Class MOMutableColumn<V extends org.snmp4j.smi.Variable>
java.lang.Object
org.snmp4j.agent.mo.MOColumn<V>
org.snmp4j.agent.mo.MOMutableColumn<V>
- All Implemented Interfaces:
Comparable
- Direct Known Subclasses:
AutonomousType
,DateAndTime
,DisplayString
,Enumerated
,KeyChange
,RowPointer
,RowStatus
,SnmpAdminString
,SnmpTagList
,SnmpTagValue
,StorageType
The
MOMutableColumn
class represents mutable columnar SMI
objects. It represents all instances of a table's column not only a
single instance (cell).
Objects represented by MOMutableColumn
can be modified via SNMP,
thus MOColumn
supports read-only, read-write, and read-create
maximum access.
- Version:
- 1.0
- Author:
- Frank Fock
- See Also:
-
Constructor Summary
ConstructorDescriptionMOMutableColumn
(int columnID, int syntax) Creates a read-only column object with the given column and syntax.MOMutableColumn
(int columnID, int syntax, MOAccess access) Creates a column object with the given column, syntax, and maximum access.MOMutableColumn
(int columnID, int syntax, MOAccess access, org.snmp4j.smi.Variable defaultValue) Creates a column object with the given column, syntax, and maximum access.MOMutableColumn
(int columnID, int syntax, MOAccess access, org.snmp4j.smi.Variable defaultValue, boolean mutableInService) Creates a column object with the given column, syntax, and maximum access. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
cleanup
(SubRequest subRequest, MOTableRow row, int column) void
commit
(SubRequest subRequest, MOTableRow row, MOTableRow changeSet, int column) org.snmp4j.smi.Variable
boolean
Returnstrue
if this column must be specified in a SET request which creates a row.boolean
void
prepare
(SubRequest subRequest, MOTableRow row, MOTableRow changeSet, int column) void
void
setDefaultValue
(org.snmp4j.smi.Variable defaultValue) void
setMandatory
(boolean mandatory) Sets a flag that determines if this column must be specified in a SET request which creates a row.void
setMutableInService
(boolean mutableInService) toString()
void
undo
(SubRequest subRequest, MOTableRow row, int column) int
validate
(org.snmp4j.smi.Variable newValue, org.snmp4j.smi.Variable oldValue) protected boolean
validateSetRequest
(SubRequest subRequest, MOTableRow row, int column) Methods inherited from class org.snmp4j.agent.mo.MOColumn
compareTo, get, getAccess, getColumnID, getRestoreValue, getStoreValue, getSyntax, getTable, getValue, isVolatile, setAccess, setColumnID, setSyntax, setTable
-
Constructor Details
-
MOMutableColumn
public MOMutableColumn(int columnID, int syntax) Creates a read-only column object with the given column and syntax.- Parameters:
columnID
- the column ID which is ID the last sub-identifier of the corresponding OBJECT-TYPE definition.syntax
- the syntax of the objects in this column. SeeSMIConstants
for possible values.
-
MOMutableColumn
Creates a column object with the given column, syntax, and maximum access. SinceMOColumn
only supports read-only columns the only reasonable values foraccess
are 'not-accessible' and 'read-only'. Generally this constructor should not be called directly.- Parameters:
columnID
- the column ID which is ID the last sub-identifier of the corresponding OBJECT-TYPE definition.syntax
- the syntax of the objects in this column. SeeSMIConstants
for possible values.access
- the maximum access of the column.
-
MOMutableColumn
public MOMutableColumn(int columnID, int syntax, MOAccess access, org.snmp4j.smi.Variable defaultValue) Creates a column object with the given column, syntax, and maximum access. SinceMOColumn
only supports read-only columns the only reasonable values foraccess
are 'not-accessible' and 'read-only'. Generally this constructor should not be called directly.- Parameters:
columnID
- the column ID which is ID the last sub-indentifer of the corresponding OBJECT-TYPE definition.syntax
- the syntax of the objects in this column. SeeSMIConstants
for possible values.access
- the maximum access of the column.defaultValue
- the default value for new rows.
-
MOMutableColumn
public MOMutableColumn(int columnID, int syntax, MOAccess access, org.snmp4j.smi.Variable defaultValue, boolean mutableInService) Creates a column object with the given column, syntax, and maximum access. SinceMOColumn
only supports read-only columns the only reasonable values foraccess
are 'not-accessible' and 'read-only'. Generally this constructor should not be called directly.- Parameters:
columnID
- the column ID which is ID the last sub-indentifer of the corresponding OBJECT-TYPE definition.syntax
- the syntax of the objects in this column. SeeSMIConstants
for possible values.access
- the maximum access of the column.defaultValue
- the default value for new rows.mutableInService
- iftrue
this column accepts value changes through SNMP (viaprepare(org.snmp4j.agent.request.SubRequest, MOTableRow, MOTableRow, int)
andcommit(org.snmp4j.agent.request.SubRequest, MOTableRow, MOTableRow, int)
while the rowsRowStatus
object is in stateRowStatus.active
. Otherwise, such an operation will result in aPDU.inconsistentValue
error.
-
-
Method Details
-
addMOValueValidationListener
-
removeMOValueValidationListener
-
validate
public int validate(org.snmp4j.smi.Variable newValue, org.snmp4j.smi.Variable oldValue) -
validateSetRequest
-
prepare
-
commit
-
undo
-
cleanup
-
setDefaultValue
public void setDefaultValue(org.snmp4j.smi.Variable defaultValue) -
setMutableInService
public void setMutableInService(boolean mutableInService) -
getDefaultValue
public org.snmp4j.smi.Variable getDefaultValue() -
isMutableInService
public boolean isMutableInService() -
isMandatory
public boolean isMandatory()Returnstrue
if this column must be specified in a SET request which creates a row.- Returns:
true
if this row has a maximum access of READ-CREATE and has anull
default value,false
otherwise.
-
setMandatory
public void setMandatory(boolean mandatory) Sets a flag that determines if this column must be specified in a SET request which creates a row. The default istrue
.- Parameters:
mandatory
- iftrue
and a row has a maximum access of READ-CREATE and has anull
default value, then it must be provided in order to activate the row.- Since:
- 1.3.2
-
toString
-