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
ConstructorsConstructorDescriptionUnresolvedReference(String reference) Creates a new unresolved reference for the given reference token. -
Method Summary
Modifier and TypeMethodDescriptionReturns the raw reference token (without any surrounding{$...}decoration).toString()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, toSubIndexMethods inherited from class org.snmp4j.smi.AbstractVariable
createFromBER, createFromSyntax, equal, getSyntaxFromString, getSyntaxFromStringOrNull, getSyntaxString, getSyntaxString, isDynamic, isException
-
Constructor Details
-
UnresolvedReference
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". Anullvalue is treated as an empty reference.
-
-
Method Details
-
getReference
Returns the raw reference token (without any surrounding{$...}decoration).- Returns:
- the configured reference.
-
toString
Returns the reference in its configured source form, i.e.{$<reference>}.- Specified by:
toStringin interfaceorg.snmp4j.smi.Variable- Overrides:
toStringin classorg.snmp4j.smi.OctetString- Returns:
- the decorated reference token.
-