Package org.snmp4j.model.snmp.proxy.impl
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>
The
SnmpSubTreeImplRO
class implements a read-only SnmpProxyObject
for MIB sub-trees.- Author:
- Frank Fock
-
Field Summary
Fields inherited from class org.snmp4j.model.snmp.proxy.impl.SnmpProxyObjectImpl
context, oid
-
Constructor Summary
ConstructorsConstructorDescriptionSnmpSubTreeImplRO
(org.snmp4j.smi.OID oid, org.snmp4j.smi.OctetString context, Class<T> valueClass) Creates a sub-tree proxy based on the sub-tree rootOID
and the common value class for the model values. -
Method Summary
Modifier and TypeMethodDescriptionorg.snmp4j.smi.OID
getOID()
Gets the unique identifier of this proxy object.Get the model value map for this subtree.reload
(SnmpService snmpService, org.snmp4j.Target target, VariableBindingMapper variableBindingMapper, SnmpProxyReloadListener reloadListener) Reload the model content of the proxy object from the target SNMP entity asynchronously in the background.toString()
boolean
waitForTask
(TaskId taskId, long timeout) Wait until the specified background task terminates.Methods inherited from class org.snmp4j.model.snmp.proxy.impl.SnmpProxyObjectImpl
getContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.snmp4j.model.snmp.proxy.SnmpProxyObject
getContext
-
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 rootOID
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
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 interfaceSnmpSubTreeRO<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 interfaceSnmpProxyObject
- Overrides:
getOID
in classSnmpProxyObjectImpl
- 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 interfaceSnmpProxyObject
- 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
Description copied from interface:SnmpProxyObject
Wait until the specified background task terminates.- Specified by:
waitForTask
in interfaceSnmpProxyObject
- 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
- Overrides:
toString
in classSnmpProxyObjectImpl
-