Package org.snmp4j.model.snmp.proxy.impl
Class SnmpScalarImplRO<T>
java.lang.Object
org.snmp4j.model.snmp.proxy.impl.SnmpProxyObjectImpl
org.snmp4j.model.snmp.proxy.impl.SnmpScalarImplRO<T>
- Type Parameters:
T
- specifies the model value type of the scalar proxy.
- All Implemented Interfaces:
SnmpProxyObject
,SnmpScalarRO<T>
- Direct Known Subclasses:
SnmpScalarImpl
The
SnmpScalarImpl
class implements a SNMP scalar proxy with read-only access.- Author:
- Frank Fock
-
Field Summary
Fields inherited from class org.snmp4j.model.snmp.proxy.impl.SnmpProxyObjectImpl
context, oid
-
Constructor Summary
ConstructorsConstructorDescriptionSnmpScalarImplRO
(org.snmp4j.smi.OID oid, org.snmp4j.smi.OctetString context, T value, Class<T> valueClass, int snmpSyntax) Creates aSnmpProxyObject
for a scalar SNMP OBJECT-TYPE. -
Method Summary
Modifier and TypeMethodDescriptiongetName()
int
getValue()
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.void
Sets the model value of this scalar proxy without changing the SNMP value of the target SNMP entity.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, getOID
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, getOID
-
Constructor Details
-
SnmpScalarImplRO
public SnmpScalarImplRO(org.snmp4j.smi.OID oid, org.snmp4j.smi.OctetString context, T value, Class<T> valueClass, int snmpSyntax) Creates aSnmpProxyObject
for a scalar SNMP OBJECT-TYPE.- Parameters:
oid
- the OID of the scalar instance value (thus including the .0 suffix).context
- the SNMP context associated with this proxy object.value
- the mode value of the scalar.valueClass
- the model value class.snmpSyntax
- the SNMP syntax (BER syntax code) of the OBJECT-TYPE's base syntax.
-
-
Method Details
-
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.
-
getName
- Specified by:
getName
in interfaceSnmpScalarRO<T>
-
getValue
- Specified by:
getValue
in interfaceSnmpScalarRO<T>
-
setValue
Sets the model value of this scalar proxy without changing the SNMP value of the target SNMP entity.- Specified by:
setValue
in interfaceSnmpScalarRO<T>
- Parameters:
value
- the new model value.
-
getValueClass
- Specified by:
getValueClass
in interfaceSnmpScalarRO<T>
-
getSnmpSyntax
public int getSnmpSyntax()- Specified by:
getSnmpSyntax
in interfaceSnmpScalarRO<T>
-
toString
- Overrides:
toString
in classSnmpProxyObjectImpl
-