Class MIBTree
java.lang.Object
org.snmp4j.agent.io.prop.MIBTree
An in-memory representation of the managed objects configured by a
MOInput source (for example a PropertyMOInput properties
file), organised as an OID prefix tree (trie) per SNMP context.
Each configured managed object becomes a terminal MIBTree.Node located at its OID. A node is
either a scalar (carrying a single Variable value) or a table
(carrying a MIBTree.Table with one MIBTree.Row per configured row). Intermediate nodes model the
OID hierarchy and carry no value.
Values that could not be resolved during parsing are preserved as
UnresolvedReference instances so that their configured reference remains visible.
- Since:
- 3.9.2
- Version:
- 3.9.2
- Author:
- SNMP4J.org
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA node in the OID tree.static final classA single configured table row: an index OID and the per-column values.static final classThe configured rows of a conceptual table (SMI table row entry). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddScalar(org.snmp4j.smi.OctetString context, org.snmp4j.smi.OID oid, org.snmp4j.smi.Variable value) Adds a scalar managed object at the given OID within the given context.voidaddTable(org.snmp4j.smi.OctetString context, org.snmp4j.smi.OID oid, int columnCount, List<MIBTree.Row> rows) Adds a conceptual table (row entry) managed object at the given OID within the given context.Set<org.snmp4j.smi.OctetString> Returns the contexts present in this tree, in insertion order.getRoot(org.snmp4j.smi.OctetString context) Returns the root node for the given context, ornullif that context is not present.
-
Constructor Details
-
MIBTree
public MIBTree()
-
-
Method Details
-
getContexts
Returns the contexts present in this tree, in insertion order. The set may contain anullelement denoting the context-independent (default) data.- Returns:
- the set of context names (possibly including
null).
-
getRoot
Returns the root node for the given context, ornullif that context is not present.- Parameters:
context- the context name, ornullfor the context-independent data.- Returns:
- the context root
MIBTree.Node, ornull.
-
addScalar
public void addScalar(org.snmp4j.smi.OctetString context, org.snmp4j.smi.OID oid, org.snmp4j.smi.Variable value) Adds a scalar managed object at the given OID within the given context.- Parameters:
context- the context name, ornullfor the context-independent data.oid- the object instance OID.value- the configured value (nullif the configuration left the value empty).
-
addTable
public void addTable(org.snmp4j.smi.OctetString context, org.snmp4j.smi.OID oid, int columnCount, List<MIBTree.Row> rows) Adds a conceptual table (row entry) managed object at the given OID within the given context.- Parameters:
context- the context name, ornullfor the context-independent data.oid- the table entry OID.columnCount- the number of columns configured per row.rows- the configured rows.
-