Package org.snmp4j.model.snmp.proxy.impl
Class SnmpScalarImpl<T>
java.lang.Object
org.snmp4j.model.snmp.proxy.impl.SnmpProxyObjectImpl
org.snmp4j.model.snmp.proxy.impl.SnmpScalarImplRO<T>
org.snmp4j.model.snmp.proxy.impl.SnmpScalarImpl<T>
- Type Parameters:
T
- specifies the model value type of the scalar proxy.
- All Implemented Interfaces:
SnmpCommitListener
,SnmpProxyObject
,SnmpScalar<T>
,SnmpScalarRO<T>
public class SnmpScalarImpl<T>
extends SnmpScalarImplRO<T>
implements SnmpCommitListener, SnmpScalar<T>
The
SnmpScalarImpl
class implements a SNMP scalar proxy with write access.- Author:
- Frank Fock
-
Field Summary
Fields inherited from class org.snmp4j.model.snmp.proxy.impl.SnmpProxyObjectImpl
context, oid
-
Constructor Summary
ConstructorsConstructorDescriptionSnmpScalarImpl
(org.snmp4j.smi.OID oid, org.snmp4j.smi.OctetString context, T value, Class<T> valueClass, int snmpSyntax, SnmpProxyCommitter committer) Creates aSnmpProxyObject
for a scalar SNMP OBJECT-TYPE. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.toString()
Methods inherited from class org.snmp4j.model.snmp.proxy.impl.SnmpScalarImplRO
getName, getSnmpSyntax, getValue, getValueClass, reload, setValue, waitForTask
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.SnmpCommitListener
getContext
Methods inherited from interface org.snmp4j.model.snmp.proxy.SnmpProxyObject
getContext, getOID, reload, waitForTask
Methods inherited from interface org.snmp4j.model.snmp.proxy.SnmpScalarRO
getName, getSnmpSyntax, getValue, getValueClass, setValue
-
Constructor Details
-
SnmpScalarImpl
public SnmpScalarImpl(org.snmp4j.smi.OID oid, org.snmp4j.smi.OctetString context, T value, Class<T> valueClass, int snmpSyntax, SnmpProxyCommitter committer) 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.committer
- theSnmpProxyCommitter
to commit changes applied to the scalar proxy to the target SNMP entity.
-
-
Method Details
-
changeValue
Change the mode value of this scalar proxy. This action will add a newSnmpValuesChangeSet
to theSnmpProxyCommitter
if the committer is notnull
.- Specified by:
changeValue
in interfaceSnmpScalar<T>
- Parameters:
value
- the new model value for the scalar.
-
commitSuccess
Description copied from interface:SnmpCommitListener
Indication of a successful commit.- Specified by:
commitSuccess
in interfaceSnmpCommitListener
- Parameters:
committedChanges
- the list of successfully committed change sets (each change set was committed atomically for itself).
-
commitFailure
public void commitFailure(List<SnmpValuesChangeSet> failedChanges, SnmpErrorStatus errorStatus, int errorIndex) Description copied from interface:SnmpCommitListener
Indicates a failed commit operation.- Specified by:
commitFailure
in interfaceSnmpCommitListener
- Parameters:
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).
-
toString
- Overrides:
toString
in classSnmpScalarImplRO<T>
-