Class 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
  • 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 a SnmpProxyObject 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 - the SnmpProxyCommitter to commit changes applied to the scalar proxy to the target SNMP entity.
  • Method Details

    • changeValue

      public void changeValue(T value)
      Change the mode value of this scalar proxy. This action will add a new SnmpValuesChangeSet to the SnmpProxyCommitter if the committer is not null.
      Specified by:
      changeValue in interface SnmpScalar<T>
      Parameters:
      value - the new model value for the scalar.
    • commitSuccess

      public void commitSuccess(List<SnmpValuesChangeSet> committedChanges)
      Description copied from interface: SnmpCommitListener
      Indication of a successful commit.
      Specified by:
      commitSuccess in interface SnmpCommitListener
      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 interface SnmpCommitListener
      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

      public String toString()
      Overrides:
      toString in class SnmpScalarImplRO<T>