T
- specifies the model value type of the scalar proxy.SnmpCommitListener
, SnmpProxyObject
, SnmpScalar<T>
, SnmpScalarRO<T>
public class SnmpScalarImpl<T> extends SnmpScalarImplRO<T> implements SnmpCommitListener, SnmpScalar<T>
SnmpScalarImpl
class implements a SNMP scalar proxy with write access.context, oid
Constructor | Description |
---|---|
SnmpScalarImpl(org.snmp4j.smi.OID oid,
org.snmp4j.smi.OctetString context,
T value,
Class<T> valueClass,
int snmpSyntax,
SnmpProxyCommitter committer) |
Creates a
SnmpProxyObject for a scalar SNMP OBJECT-TYPE. |
Modifier and Type | Method | Description |
---|---|---|
void |
changeValue(T value) |
Change the mode value of this scalar proxy.
|
void |
commitFailure(List<SnmpValuesChangeSet> failedChanges,
SnmpErrorStatus errorStatus,
int errorIndex) |
Indicates a failed commit operation.
|
void |
commitSuccess(List<SnmpValuesChangeSet> committedChanges) |
Indication of a successful commit.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getContext
getContext, getOID, reload, waitForTask
getContext, getOID
getName, getSnmpSyntax, getValue, getValueClass, reload, setValue, waitForTask
getName, getSnmpSyntax, getValue, getValueClass, setValue
public SnmpScalarImpl(org.snmp4j.smi.OID oid, org.snmp4j.smi.OctetString context, T value, Class<T> valueClass, int snmpSyntax, SnmpProxyCommitter committer)
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.committer
- the SnmpProxyCommitter
to commit changes applied to the scalar proxy to the target SNMP entity.public void changeValue(T value)
SnmpValuesChangeSet
to the
SnmpProxyCommitter
if the committer is not null
.changeValue
in interface SnmpScalar<T>
value
- the new model value for the scalar.public void commitSuccess(List<SnmpValuesChangeSet> committedChanges)
SnmpCommitListener
commitSuccess
in interface SnmpCommitListener
committedChanges
- the list of successfully committed change sets (each change set was committed atomically for itself).public void commitFailure(List<SnmpValuesChangeSet> failedChanges, SnmpErrorStatus errorStatus, int errorIndex)
SnmpCommitListener
commitFailure
in interface SnmpCommitListener
failedChanges
- the changes that failed to commit (none of the changes within a single change set must have been committed, if
the change set was small enough to be committed atomically).errorStatus
- the SNMP error status of the first failed change set.errorIndex
- the index in the original list of changes committed that failed (zero based).public String toString()
toString
in class SnmpScalarImplRO<T>
Copyright © 2020 SNMP4J.org. All rights reserved.