T
- specifies the model value type of the scalar proxy.SnmpProxyObject
, SnmpScalarRO<T>
SnmpScalarImpl
public class SnmpScalarImplRO<T> extends SnmpProxyObjectImpl implements SnmpScalarRO<T>
SnmpScalarImpl
class implements a SNMP scalar proxy with read-only access.context, oid
Constructor | Description |
---|---|
SnmpScalarImplRO(org.snmp4j.smi.OID oid,
org.snmp4j.smi.OctetString context,
T value,
Class<T> valueClass,
int snmpSyntax) |
Creates a
SnmpProxyObject for a scalar SNMP OBJECT-TYPE. |
Modifier and Type | Method | Description |
---|---|---|
String |
getName() |
|
int |
getSnmpSyntax() |
|
T |
getValue() |
|
Class<T> |
getValueClass() |
|
TaskId |
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 |
setValue(T value) |
Sets the model value of this scalar proxy without changing the SNMP value of the target SNMP entity.
|
String |
toString() |
|
boolean |
waitForTask(TaskId taskId,
long timeout) |
Wait until the specified background task terminates.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getContext, getOID
getContext, getOID
public SnmpScalarImplRO(org.snmp4j.smi.OID oid, org.snmp4j.smi.OctetString context, T value, Class<T> valueClass, int snmpSyntax)
SnmpProxyObject
for a scalar SNMP OBJECT-TYPE.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.public TaskId reload(SnmpService snmpService, org.snmp4j.Target target, VariableBindingMapper variableBindingMapper, SnmpProxyReloadListener reloadListener)
SnmpProxyObject
reload
in interface SnmpProxyObject
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.public boolean waitForTask(TaskId taskId, long timeout)
SnmpProxyObject
waitForTask
in interface SnmpProxyObject
taskId
- the task ID of the task to wait for.timeout
- the maximum time to wait in millis.true
if the task has terminated, false
otherwise.public String getName()
getName
in interface SnmpScalarRO<T>
public T getValue()
getValue
in interface SnmpScalarRO<T>
public void setValue(T value)
setValue
in interface SnmpScalarRO<T>
value
- the new model value.public Class<T> getValueClass()
getValueClass
in interface SnmpScalarRO<T>
public int getSnmpSyntax()
getSnmpSyntax
in interface SnmpScalarRO<T>
public String toString()
toString
in class SnmpProxyObjectImpl
Copyright © 2020 SNMP4J.org. All rights reserved.