Package org.snmp4j.model.snmp.api
Class LocalTransaction
java.lang.Object
org.snmp4j.model.snmp.api.LocalTransaction
The
LocalTransaction
holds changes, error status, and target information
for a SNMP transaction.- Version:
- 1.0
- Author:
- Frank Fock
-
Constructor Summary
ConstructorsConstructorDescriptionLocalTransaction
(org.snmp4j.Target target) Create a new transaction for a specific SNMPTarget
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addUpdate
(SnmpValuesChangeSet changeSet) Adds a value change set to this transaction.Gets the list of (successfully) committed changes.int
Gets the SNMP error status of the transaction.List<org.snmp4j.smi.VariableBinding>
Gets the list of failed variable bindings (new values that could not applied to an error).Gets the queue of pendingSnmpValuesChangeSet
s.org.snmp4j.Target
Gets the SNMP target of this transaction.boolean
After this transaction completed, this method indicates whether there a failed change sets or not.void
setErrorIndex
(int errorIndex) void
setSnmpErrorStatus
(SnmpErrorStatus snmpErrorStatus) toString()
-
Constructor Details
-
LocalTransaction
public LocalTransaction(org.snmp4j.Target target) Create a new transaction for a specific SNMPTarget
.- Parameters:
target
- the target SNMP entity subject for this transaction.
-
-
Method Details
-
getTarget
public org.snmp4j.Target getTarget()Gets the SNMP target of this transaction.- Returns:
- a
Target
instance.
-
getPending
Gets the queue of pendingSnmpValuesChangeSet
s.- Returns:
- the queue of pending value changes. If empty, all changes have been committed (or there no changes in the transaction yet).
-
getCommitted
Gets the list of (successfully) committed changes.- Returns:
- a list of
SnmpValuesChangeSet
instances. If empty, no changes have been successfully committed yet. Failed changes will be reported bygetFailedVariableBindings()
.
-
addUpdate
Adds a value change set to this transaction. The change set is appended to the queue of pending change sets.- Parameters:
changeSet
- a value change set to include in a future commit.
-
isSuccess
public boolean isSuccess()After this transaction completed, this method indicates whether there a failed change sets or not.- Returns:
true
if there are failed value change sets.
-
getErrorStatus
Gets the SNMP error status of the transaction.- Returns:
- a
SnmpErrorStatus
instance that represents the status of the SNMP operation(s) used to execute this transaction.
-
getFailedVariableBindings
Gets the list of failed variable bindings (new values that could not applied to an error).- Returns:
- a possibly empty list of
VariableBinding
instances.
-
getErrorIndex
public int getErrorIndex() -
setErrorIndex
public void setErrorIndex(int errorIndex) -
setSnmpErrorStatus
-
toString
-