Module org.snmp4j.agent
Package org.snmp4j.agent.mo.snmp
Class Enumerated<V extends org.snmp4j.smi.Variable>
java.lang.Object
org.snmp4j.agent.mo.MOColumn<V>
org.snmp4j.agent.mo.MOMutableColumn<V>
org.snmp4j.agent.mo.snmp.Enumerated<V>
- All Implemented Interfaces:
Comparable<MOColumn<V>>
The
Enumerated
class represents enumerated SMI INTEGER
(=Integer32
) or an OCTET STRING with enumerated named bits for
columnar objects. The latter represents the SMI construct BITS.- Version:
- 2.0.5
- Author:
- Frank Fock
-
Constructor Summary
ConstructorDescriptionEnumerated
(int columnID, int smiSyntax, MOAccess access, V defaultValue) Creates an enumerated INTEGER column.Enumerated
(int columnID, int smiSyntax, MOAccess access, V defaultValue, boolean mutableInService) Creates an enumerated INTEGER or BITS column.Enumerated
(int columnID, int smiSyntax, MOAccess access, V defaultValue, boolean mutableInService, int[] allowedValues) Creates an enumerated INTEGER or BITS column with specifying a set of possible values.Enumerated
(int columnID, MOAccess access, V defaultValue) Deprecated.Enumerated
(int columnID, MOAccess access, V defaultValue, boolean mutableInService) Deprecated.As this version of the constructor does not safely define the column syntax if the defaultValue is null, useEnumerated(int, int, org.snmp4j.agent.MOAccess, org.snmp4j.smi.Variable, boolean)
instead.Enumerated
(int columnID, MOAccess access, V defaultValue, boolean mutableInService, int[] allowedValues) Deprecated.As this version of the constructor does not safely define the column syntax if the defaultValue is null, useEnumerated(int, int, org.snmp4j.agent.MOAccess, org.snmp4j.smi.Variable, boolean, int[])
instead. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
setConstraint
(EnumerationConstraint constraint) int
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, isVolatile, setAccess, setColumnID, setSyntax, setTable
-
Constructor Details
-
Enumerated
@Deprecated public Enumerated(int columnID, MOAccess access, V defaultValue, boolean mutableInService, int[] allowedValues) Deprecated.As this version of the constructor does not safely define the column syntax if the defaultValue is null, useEnumerated(int, int, org.snmp4j.agent.MOAccess, org.snmp4j.smi.Variable, boolean, int[])
instead.Creates an enumerated INTEGER or BITS column with specifying a set of possible values.- Parameters:
columnID
- the column ID (sub-identifier) of the column.access
- the maximum access for this column.defaultValue
- the default value used for new rows (must not benull
for INTEGER enumerations). This value also defines the syntax of the column.mutableInService
- specifies whether this column can be changed while in service (active).allowedValues
- an array of possible values for this object.
-
Enumerated
@Deprecated public Enumerated(int columnID, MOAccess access, V defaultValue, boolean mutableInService) Deprecated.As this version of the constructor does not safely define the column syntax if the defaultValue is null, useEnumerated(int, int, org.snmp4j.agent.MOAccess, org.snmp4j.smi.Variable, boolean)
instead.Creates an enumerated INTEGER or BITS column. To constraint the possible values assignable to this object, you will have to set the correspondingEnumerationConstraint
withsetConstraint(org.snmp4j.agent.mo.snmp.smi.EnumerationConstraint)
or use an appropriate value validation listener.- Parameters:
columnID
- the column ID (sub-identifier) of the column.access
- the maximum access for this column.defaultValue
- the default value used for new rows (must not benull
for INTEGER enumerations). This value also defines the syntax of the column.mutableInService
- specifies whether this column can be changed while in service (active).
-
Enumerated
Deprecated.As this version of the constructor does not safely define the column syntax if the defaultValue is null, useEnumerated(int, int, org.snmp4j.agent.MOAccess, org.snmp4j.smi.Variable)
instead.Creates an enumerated INTEGER column. To constraint the possible values assignable to this object, you will have to set the correspondingEnumerationConstraint
withsetConstraint(org.snmp4j.agent.mo.snmp.smi.EnumerationConstraint)
or use an appropriate value validation listener.- Parameters:
columnID
- the column ID (sub-identifier) of the column.access
- the maximum access for this column.defaultValue
- the default value used for new rows (must not benull
for INTEGER enumerations). This value also defines the syntax of the column.
-
Enumerated
public Enumerated(int columnID, int smiSyntax, MOAccess access, V defaultValue, boolean mutableInService, int[] allowedValues) Creates an enumerated INTEGER or BITS column with specifying a set of possible values.- Parameters:
columnID
- the column ID (sub-identifier) of the column.smiSyntax
- the smiSyntax for this column, which can beSMIConstants.SYNTAX_INTEGER32
orSMIConstants.SYNTAX_OCTET_STRING
.access
- the maximum access for this column.defaultValue
- the default value used for new rows (must not benull
for INTEGER enumerations). This value also defines the syntax of the column.mutableInService
- specifies whether this column can be changed while in service (active).allowedValues
- an array of possible values for this object.
-
Enumerated
public Enumerated(int columnID, int smiSyntax, MOAccess access, V defaultValue, boolean mutableInService) Creates an enumerated INTEGER or BITS column. To constraint the possible values assignable to this object, you will have to set the correspondingEnumerationConstraint
withsetConstraint(org.snmp4j.agent.mo.snmp.smi.EnumerationConstraint)
or use an appropriate value validation listener.- Parameters:
columnID
- the column ID (sub-identifier) of the column.smiSyntax
- the smiSyntax for this column, which can beSMIConstants.SYNTAX_INTEGER32
orSMIConstants.SYNTAX_OCTET_STRING
.access
- the maximum access for this column.defaultValue
- the default value used for new rows (must not benull
for INTEGER enumerations). This value also defines the syntax of the column.mutableInService
- specifies whether this column can be changed while in service (active).
-
Enumerated
Creates an enumerated INTEGER column. To constraint the possible values assignable to this object, you will have to set the correspondingEnumerationConstraint
withsetConstraint(org.snmp4j.agent.mo.snmp.smi.EnumerationConstraint)
or use an appropriate value validation listener.- Parameters:
columnID
- the column ID (sub-identifier) of the column.smiSyntax
- the smiSyntax for this column, which can beSMIConstants.SYNTAX_INTEGER32
orSMIConstants.SYNTAX_OCTET_STRING
.access
- the maximum access for this column.defaultValue
- the default value used for new rows (must not benull
for INTEGER enumerations). This value also defines the syntax of the column.
-
-
Method Details
-
validate
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<V extends org.snmp4j.smi.Variable>
- 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.
-
setConstraint
-
Enumerated(int, int, org.snmp4j.agent.MOAccess, org.snmp4j.smi.Variable)
instead.