- java.lang.Object
-
- org.snmp4j.agent.mo.snmp.smi.ValueConstraintValidator
-
- All Implemented Interfaces:
EventListener
,MOValueValidationListener
- Direct Known Subclasses:
DisplayString.DisplayStringValidation
public class ValueConstraintValidator extends Object implements MOValueValidationListener
- Version:
- 1.0
- Author:
- Frank Fock
-
-
Constructor Summary
Constructors Constructor Description ValueConstraintValidator(ValueConstraint valueConstraint)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueConstraint
getValueConstraint()
void
validate(MOValueValidationEvent validationEvent)
Validates a value by returning a SNMP error code if validation fails or 0 (SnmpConstants.SNMP_ERROR_SUCCESS
) if the validation was successful.
-
-
-
Constructor Detail
-
ValueConstraintValidator
public ValueConstraintValidator(ValueConstraint valueConstraint)
-
-
Method Detail
-
validate
public void validate(MOValueValidationEvent validationEvent)
Validates a value by returning a SNMP error code if validation fails or 0 (SnmpConstants.SNMP_ERROR_SUCCESS
) if the validation was successful. The validation is returned by calling theMOValueValidationEvent.setValidationStatus(int)
method. If an error occured the returned status value should be one of the following values:SnmpConstants.SNMP_ERROR_WRONG_LENGTH
SnmpConstants.SNMP_ERROR_WRONG_VALUE
SnmpConstants.SNMP_ERROR_WRONG_TYPE
SnmpConstants.SNMP_ERROR_WRONG_ENCODING
SnmpConstants.SNMP_ERROR_BAD_VALUE
- Specified by:
validate
in interfaceMOValueValidationListener
- Parameters:
validationEvent
- theMOValueValidationEvent
containing the value to validate.
-
getValueConstraint
public ValueConstraint getValueConstraint()
-
-