Module org.snmp4j.agent
Package org.snmp4j.agent.mo.snmp
Class EnumeratedScalar<V extends org.snmp4j.smi.Variable>
- java.lang.Object
-
- org.snmp4j.agent.mo.MOScalar<V>
-
- org.snmp4j.agent.mo.snmp.EnumeratedScalar<V>
-
- All Implemented Interfaces:
ManagedObject<V>
,ManagedObjectValueAccess<V>
,ChangeableManagedObject<V>
,GenericManagedObject
,MOScope
,RandomAccessManagedObject<V>
,RegisteredManagedObject<V>
,SerializableManagedObject<V>
- Direct Known Subclasses:
AgentppSimulationMib.AgentppSimMode
,Snmp4jConfigMib.Snmp4jCfgReset
,Snmp4jConfigMib.Snmp4jCfgSecSrcAddrValidation
public class EnumeratedScalar<V extends org.snmp4j.smi.Variable> extends MOScalar<V>
TheEnumeratedScalar
class represents enumerated SMI INTEGER (=Integer32
) or an OCTET STRING with enumerated named bits for scalar objects. The latter represents the SMI construct BITS.- Version:
- 3.1.0
- Author:
- Frank Fock
-
-
Constructor Summary
Constructors Constructor Description EnumeratedScalar(org.snmp4j.smi.OID oid, MOAccess access, V value)
Creates an enumerated Integer32 or BITS (OctetString) scalar with specifying a set of possible values.EnumeratedScalar(org.snmp4j.smi.OID oid, MOAccess access, V value, int[] allowedValues)
Creates an enumerated scalar with specifying a set of possible values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
isValueOK(SubRequest<?> request)
Checks whether the new value contained in the supplied sub-request is a valid value for this object.protected void
setConstraint(EnumerationConstraint constraint)
-
Methods inherited from class org.snmp4j.agent.mo.MOScalar
addMOChangeListener, addMOValueValidationListener, changeValue, checkRequestScope, cleanup, commit, covers, exportInstance, find, fireAfterMOChange, fireAfterPrepareMOChange, fireBeforeMOChange, fireBeforePrepareMOChange, fireValidate, get, getAccess, getID, getLowerBound, getOid, getScope, getSingleInstanceScope, getSyntax, getUpperBound, getValue, getValue, importInstance, instanceCount, instanceIterator, isCovered, isLowerIncluded, isOverlapping, isUpperIncluded, isVolatile, load, next, prepare, removeMOChangeListener, removeMOValueValidationListener, save, setValue, setValue, setVolatile, toString, toStringDetails, undo
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.snmp4j.agent.RandomAccessManagedObject
getInstanceSubID, isVolatile
-
-
-
-
Constructor Detail
-
EnumeratedScalar
public EnumeratedScalar(org.snmp4j.smi.OID oid, MOAccess access, V value)
Creates an enumerated Integer32 or BITS (OctetString) scalar with specifying a set of possible values. 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:
oid
- the instance oid (with ".0" suffix) of the scalar.access
- the maximum access for this column.value
- the initial value.
-
EnumeratedScalar
public EnumeratedScalar(org.snmp4j.smi.OID oid, MOAccess access, V value, int[] allowedValues)
Creates an enumerated scalar with specifying a set of possible values.- Parameters:
oid
- the instance oid (with ".0" suffix) of the scalar.access
- the maximum access for this column.value
- the initial value.allowedValues
- an array of possible values for this object.
-
-
Method Detail
-
isValueOK
public int isValueOK(SubRequest<?> request)
Description copied from class:MOScalar
Checks whether the new value contained in the supplied sub-request is a valid value for this object. The checks are performed by firing aMOValueValidationEvent
the registered listeners.
-
setConstraint
protected void setConstraint(EnumerationConstraint constraint)
-
-