Class SnmpValueChange

java.lang.Object
org.snmp4j.smi.VariableBinding
org.snmp4j.model.snmp.proxy.impl.SnmpValueChange
All Implemented Interfaces:
Serializable, Cloneable, org.snmp4j.asn1.BERSerializable, ChangeSet<SnmpValueChange>

public class SnmpValueChange extends org.snmp4j.smi.VariableBinding implements ChangeSet<SnmpValueChange>
The SnmpValueChange class represents a single value change with old a new value supporting undo and redo operations.
Author:
Frank Fock
See Also:
  • Constructor Details

    • SnmpValueChange

      public SnmpValueChange(org.snmp4j.smi.OID oid, Class valueClass, Object newValue, Object oldValue)
      Creates a value change with SNMP instance OID, model value class, old, and new value.
      Parameters:
      oid - the instance OID of the target SNMP object instance (i.e., for scalars including the .0 suffix).
      valueClass - the value class of the model values.
      newValue - the new model value.
      oldValue - the old model value (or null if it did not exist).
  • Method Details

    • getValueClass

      public Class getValueClass()
      Gets the class of the model values.
      Returns:
      the class of the model values.
    • getChangeStatus

      public ChangeSet.ChangeStatus getChangeStatus()
      Gets the status of the change as defined by ChangeSet.ChangeStatus.
      Returns:
      the status of the change.
    • getNewValue

      public Object getNewValue()
      Gets the new value.
      Returns:
      the new value.
    • setNewValue

      public void setNewValue(Object newValue)
      Sets the new value.
      Parameters:
      newValue - the new value (the value class must be compatible with the getValueClass() otherwise the mapping to the SNMP value and vice versa will fail (later).
    • getOldValue

      public Object getOldValue()
      Gets the old value.
      Returns:
      the old value.
    • setOldValue

      public void setOldValue(Object oldValue)
      Sets the old value.
      Parameters:
      oldValue - the old value (the value class must be compatible with the getValueClass() otherwise the mapping to the SNMP value and vice versa will fail (later).
    • getChanges

      public List<SnmpValueChange> getChanges()
      Description copied from interface: ChangeSet
      Gets a list of the changes objects.
      Specified by:
      getChanges in interface ChangeSet<SnmpValueChange>
      Returns:
      the changes as a new list.
    • getStatus

      public ChangeSet.ChangeStatus getStatus()
      Description copied from interface: ChangeSet
      The status of the change.
      Specified by:
      getStatus in interface ChangeSet<SnmpValueChange>
      Returns:
      the change status.
    • setStatus

      public void setStatus(ChangeSet.ChangeStatus status)
      Description copied from interface: ChangeSet
      Sets the status of the change.
      Specified by:
      setStatus in interface ChangeSet<SnmpValueChange>
      Parameters:
      status - the new status.
    • getErrorStatus

      public SnmpErrorStatus getErrorStatus()
      Gets the SNMP error status for this change.
      Specified by:
      getErrorStatus in interface ChangeSet<SnmpValueChange>
      Returns:
      the SNMP error status as defined by SnmpErrorStatus.
    • setErrorStatus

      public void setErrorStatus(SnmpErrorStatus errorStatus)
      Sets the SNMP error status for this change.
      Parameters:
      errorStatus - the new SNMP error status as defined by SnmpErrorStatus.
    • toString

      public String toString()
      Overrides:
      toString in class org.snmp4j.smi.VariableBinding