Class SnmpSubTreeImplRO<T>

java.lang.Object
org.snmp4j.model.snmp.proxy.impl.SnmpProxyObjectImpl
org.snmp4j.model.snmp.proxy.impl.SnmpSubTreeImplRO<T>
Type Parameters:
T - specifies the common base value type for all model values in the sub-tree.
All Implemented Interfaces:
SnmpProxyObject, SnmpSubTreeRO<T>

public class SnmpSubTreeImplRO<T> extends SnmpProxyObjectImpl implements SnmpSubTreeRO<T>
The SnmpSubTreeImplRO class implements a read-only SnmpProxyObject for MIB sub-trees.
Author:
Frank Fock
  • Constructor Details

    • SnmpSubTreeImplRO

      public SnmpSubTreeImplRO(org.snmp4j.smi.OID oid, org.snmp4j.smi.OctetString context, Class<T> valueClass)
      Creates a sub-tree proxy based on the sub-tree root OID and the common value class for the model values.
      Parameters:
      oid - the root object identifier of the sub-tree.
      context - the SNMPv3 context of the sub-tree,
      valueClass - the common value class for the model values in the sub-tree. If no common class is available, Object should be used.
  • Method Details

    • getValues

      public SortedMap<org.snmp4j.smi.OID,T> getValues()
      Description copied from interface: SnmpSubTreeRO
      Get the model value map for this subtree. The map's keys are the instance object identifier of the target SNMP MIB and the values are the corresponding model values.
      Specified by:
      getValues in interface SnmpSubTreeRO<T>
      Returns:
      the sub-tree model values as map.
    • getOID

      public org.snmp4j.smi.OID getOID()
      Description copied from interface: SnmpProxyObject
      Gets the unique identifier of this proxy object. Typically this is the root OID of the MIB objects managed by this proxy. If the proxy manages a single instance only, this should be the instance identifier.
      Specified by:
      getOID in interface SnmpProxyObject
      Overrides:
      getOID in class SnmpProxyObjectImpl
      Returns:
      the OID for this proxy object.
    • reload

      public TaskId reload(SnmpService snmpService, org.snmp4j.Target target, VariableBindingMapper variableBindingMapper, SnmpProxyReloadListener reloadListener)
      Description copied from interface: SnmpProxyObject
      Reload the model content of the proxy object from the target SNMP entity asynchronously in the background.
      Specified by:
      reload in interface SnmpProxyObject
      Parameters:
      snmpService - the SNMP service to use.
      target - the SNMP target (i.e., address, timeouts, etc.) to use.
      variableBindingMapper - the variable binding mapper that maps the retrieved SNMP values to model values (based on SNMP types or specific OID based mappings).
      reloadListener - a callback listener that is informed about the reloading status.
      Returns:
      the task ID for the background task.
    • waitForTask

      public boolean waitForTask(TaskId taskId, long timeout)
      Description copied from interface: SnmpProxyObject
      Wait until the specified background task terminates.
      Specified by:
      waitForTask in interface SnmpProxyObject
      Parameters:
      taskId - the task ID of the task to wait for.
      timeout - the maximum time to wait in millis.
      Returns:
      true if the task has terminated, false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class SnmpProxyObjectImpl