Class LocalTransaction

java.lang.Object
org.snmp4j.model.snmp.api.LocalTransaction

public class LocalTransaction extends Object
The LocalTransaction holds changes, error status, and target information for a SNMP transaction.
Version:
1.0
Author:
Frank Fock
  • Constructor Details

    • LocalTransaction

      public LocalTransaction(org.snmp4j.Target target)
      Create a new transaction for a specific SNMP Target.
      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

      public Queue<SnmpValuesChangeSet> getPending()
      Gets the queue of pending SnmpValuesChangeSets.
      Returns:
      the queue of pending value changes. If empty, all changes have been committed (or there no changes in the transaction yet).
    • getCommitted

      public List<SnmpValuesChangeSet> 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 by getFailedVariableBindings().
    • addUpdate

      public void addUpdate(SnmpValuesChangeSet changeSet)
      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

      public SnmpErrorStatus 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

      public List<org.snmp4j.smi.VariableBinding> 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

      public void setSnmpErrorStatus(SnmpErrorStatus snmpErrorStatus)
    • toString

      public String toString()
      Overrides:
      toString in class Object