Class UnresolvedReference

java.lang.Object
org.snmp4j.smi.AbstractVariable
org.snmp4j.smi.OctetString
org.snmp4j.agent.io.prop.UnresolvedReference
All Implemented Interfaces:
Serializable, Cloneable, Comparable<org.snmp4j.smi.Variable>, org.snmp4j.asn1.BERSerializable, org.snmp4j.smi.AssignableFromByteArray, org.snmp4j.smi.AssignableFromString, org.snmp4j.smi.Variable

public class UnresolvedReference extends org.snmp4j.smi.OctetString
An UnresolvedReference represents a configured variable value that references another variable or object instance (using the {$name} / ${name} syntax of the PropertyMOInput format) which could not be resolved to an actual value — typically because the configuration is inspected statically, without a running agent to supply the referenced instance value.

Instead of dropping such a value (which would lose information), the reference token is preserved so that tools building a MIB tree from a configuration can display which instance the value would have been taken from at runtime.

The class extends OctetString (and therefore is a fully usable Variable) so that it can flow through the PropertyMOInput parsing pipeline unchanged: its octets are the UTF-8 bytes of the reference token, which keeps any downstream sub-index conversion deterministic. Consumers that want to treat it specially can test with instanceof.

Since:
3.9.2
Version:
3.9.2
Author:
SNMP4J.org
See Also:
  • Field Summary

    Fields inherited from class org.snmp4j.smi.AbstractVariable

    SMISYNTAXES_PROPERTIES
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new unresolved reference for the given reference token.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the raw reference token (without any surrounding {$...} decoration).
    Returns the reference in its configured source form, i.e.

    Methods inherited from class org.snmp4j.smi.OctetString

    append, append, append, append, clear, clone, compareTo, decodeBER, encodeBER, equals, equalsValue, fromByteArray, fromCharArray, fromCharArray, fromHexString, fromHexString, fromHexStringPairs, fromIndex, fromString, fromString, fromString, fromSubIndex, get, getBERLength, getBERPayloadLength, getSyntax, getValue, hashCode, isPrintable, length, mask, set, setValue, setValue, split, startsWith, substring, toASCII, toByteArray, toByteArray, toHexString, toHexString, toInt, toLong, toString, toString, toSubIndex

    Methods inherited from class org.snmp4j.smi.AbstractVariable

    createFromBER, createFromSyntax, equal, getSyntaxFromString, getSyntaxFromStringOrNull, getSyntaxString, getSyntaxString, isDynamic, isException

    Methods inherited from class Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • UnresolvedReference

      public UnresolvedReference(String reference)
      Creates a new unresolved reference for the given reference token.
      Parameters:
      reference - the name or dotted instance OID of the variable that the configuration referenced, e.g. "1.3.6.1.6.3.10.2.1.1.0". A null value is treated as an empty reference.
  • Method Details

    • getReference

      public String getReference()
      Returns the raw reference token (without any surrounding {$...} decoration).
      Returns:
      the configured reference.
    • toString

      public String toString()
      Returns the reference in its configured source form, i.e. {$<reference>}.
      Specified by:
      toString in interface org.snmp4j.smi.Variable
      Overrides:
      toString in class org.snmp4j.smi.OctetString
      Returns:
      the decorated reference token.