Class EnumeratedScalar<V extends org.snmp4j.smi.Variable>

    • 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 corresponding EnumerationConstraint with setConstraint(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 a MOValueValidationEvent the registered listeners.
        Overrides:
        isValueOK in class MOScalar<V extends org.snmp4j.smi.Variable>
        Parameters:
        request - the SubRequest with the new value.
        Returns:
        SnmpConstants.SNMP_ERROR_SUCCESS if the new value is OK, any other appropriate SNMPv2/v3 error status if not.