Package org.snmp4j.model.snmp.proxy.impl
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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.snmp4j.model.snmp.proxy.ChangeSet
ChangeSet.ChangeStatus
-
Constructor Summary
ConstructorsConstructorDescriptionSnmpValueChange
(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. -
Method Summary
Modifier and TypeMethodDescriptionGets a list of the changes objects.Gets the status of the change as defined byChangeSet.ChangeStatus
.Gets the SNMP error status for this change.Gets the new value.Gets the old value.The status of the change.Gets the class of the model values.void
setErrorStatus
(SnmpErrorStatus errorStatus) Sets the SNMP error status for this change.void
setNewValue
(Object newValue) Sets the new value.void
setOldValue
(Object oldValue) Sets the old value.void
setStatus
(ChangeSet.ChangeStatus status) Sets the status of the change.toString()
Methods inherited from class org.snmp4j.smi.VariableBinding
clone, createFromOIDs, decodeBER, encodeBER, equals, getBERLength, getBERPayloadLength, getOid, getSyntax, getVariable, hashCode, isException, setOid, setVariable, toValueString
-
Constructor Details
-
SnmpValueChange
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 (ornull
if it did not exist).
-
-
Method Details
-
getValueClass
Gets the class of the model values.- Returns:
- the class of the model values.
-
getChangeStatus
Gets the status of the change as defined byChangeSet.ChangeStatus
.- Returns:
- the status of the change.
-
getNewValue
Gets the new value.- Returns:
- the new value.
-
setNewValue
Sets the new value.- Parameters:
newValue
- the new value (the value class must be compatible with thegetValueClass()
otherwise the mapping to the SNMP value and vice versa will fail (later).
-
getOldValue
Gets the old value.- Returns:
- the old value.
-
setOldValue
Sets the old value.- Parameters:
oldValue
- the old value (the value class must be compatible with thegetValueClass()
otherwise the mapping to the SNMP value and vice versa will fail (later).
-
getChanges
Description copied from interface:ChangeSet
Gets a list of the changes objects.- Specified by:
getChanges
in interfaceChangeSet<SnmpValueChange>
- Returns:
- the changes as a new list.
-
getStatus
Description copied from interface:ChangeSet
The status of the change.- Specified by:
getStatus
in interfaceChangeSet<SnmpValueChange>
- Returns:
- the change status.
-
setStatus
Description copied from interface:ChangeSet
Sets the status of the change.- Specified by:
setStatus
in interfaceChangeSet<SnmpValueChange>
- Parameters:
status
- the new status.
-
getErrorStatus
Gets the SNMP error status for this change.- Specified by:
getErrorStatus
in interfaceChangeSet<SnmpValueChange>
- Returns:
- the SNMP error status as defined by
SnmpErrorStatus
.
-
setErrorStatus
Sets the SNMP error status for this change.- Parameters:
errorStatus
- the new SNMP error status as defined bySnmpErrorStatus
.
-
toString
- Overrides:
toString
in classorg.snmp4j.smi.VariableBinding
-