org.snmp4j.agent.mo.snmp
Class DisplayString

java.lang.Object
  extended by org.snmp4j.agent.mo.MOColumn
      extended by org.snmp4j.agent.mo.MOMutableColumn
          extended by org.snmp4j.agent.mo.snmp.DisplayString
All Implemented Interfaces:
java.lang.Comparable

public class DisplayString
extends MOMutableColumn

The DisplayString class implements the DisplayString textual convention as defined by the SNMPv2-TC MIB specification for columnar objects.

Version:
1.0
Author:
Frank Fock

Nested Class Summary
static class DisplayString.DisplayStringValidation
          The DisplayStringValidation can be used to validate the contents of OctetString variables that follow the DisplayString TC rules.
 
Field Summary
static int MAX_SIZE
           
static int MIB_SIZE
           
 
Constructor Summary
DisplayString(int columnID, MOAccess access, org.snmp4j.smi.Variable defaultValue)
           
DisplayString(int columnID, MOAccess access, org.snmp4j.smi.Variable defaultValue, boolean mutableInService)
           
DisplayString(int columnID, MOAccess access, org.snmp4j.smi.Variable defaultValue, boolean mutableInService, int minSize, int maxSize)
           
 
Method Summary
 int validate(org.snmp4j.smi.Variable newValue, org.snmp4j.smi.Variable oldValue)
           
static int validateDisplayString(org.snmp4j.smi.Variable displayString, ValueConstraint sizeContraints)
          Validates a variable as a DisplayString OCTET STRING.
 
Methods inherited from class org.snmp4j.agent.mo.MOMutableColumn
addMOValueValidationListener, cleanup, commit, getDefaultValue, isMandatory, isMutableInService, prepare, removeMOValueValidationListener, setDefaultValue, setMandatory, setMutableInService, toString, undo, validateSetRequest
 
Methods inherited from class org.snmp4j.agent.mo.MOColumn
compareTo, get, getAccess, getColumnID, getSyntax, getTable, getValue, isVolatile, setAccess, setColumnID, setSyntax, setTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MIB_SIZE

public static final int MIB_SIZE
See Also:
Constant Field Values

MAX_SIZE

public static final int MAX_SIZE
See Also:
Constant Field Values
Constructor Detail

DisplayString

public DisplayString(int columnID,
                     MOAccess access,
                     org.snmp4j.smi.Variable defaultValue,
                     boolean mutableInService)

DisplayString

public DisplayString(int columnID,
                     MOAccess access,
                     org.snmp4j.smi.Variable defaultValue)

DisplayString

public DisplayString(int columnID,
                     MOAccess access,
                     org.snmp4j.smi.Variable defaultValue,
                     boolean mutableInService,
                     int minSize,
                     int maxSize)
Method Detail

validate

public int validate(org.snmp4j.smi.Variable newValue,
                    org.snmp4j.smi.Variable oldValue)
Overrides:
validate in class MOMutableColumn

validateDisplayString

public static int validateDisplayString(org.snmp4j.smi.Variable displayString,
                                        ValueConstraint sizeContraints)
Validates a variable as a DisplayString OCTET STRING. If the variable is not an OctetString instance, wrongType is returned as error status. Otherwise wrongValue is returned if the string contains non-printable characters other than 'return' and 'new-line'.

Parameters:
displayString - a variable to validate.
sizeContraints - a constraint for the size (length) of the string.
Returns:
a SNMP error status if the variable is not a valid DisplayString or zero if it is.

Copyright 2005-2010 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.