Class DeniableEventObject

java.lang.Object
java.util.EventObject
org.snmp4j.agent.mo.DeniableEventObject
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MOChangeEvent, MOTableRowEvent, RowStatusEvent

public class DeniableEventObject extends EventObject
The DeniableEventObject describes an event that can be canceled through reporting a SNMP error status to the event source.
Since:
1.1
Version:
1.1
Author:
Frank Fock
See Also:
  • Constructor Details

    • DeniableEventObject

      public DeniableEventObject(Object source, boolean deniable)
      Creates an deniable event instance.
      Parameters:
      source - the event source.
      deniable - if true the event can be canceled by setting its deny reason to a SNMPv2/v3 error status, false if the event cannot be canceled, because, for example, it is fired on behalf of the commit phase of a 2PC transaction.
  • Method Details

    • setDenyReason

      public void setDenyReason(int denyReason)
      Sets the reason why this event needs to be canceled. A reason other than zero will cancel the change if it has not been performed yet.
      Parameters:
      denyReason - a SNMPv2/v3 error status.
    • getDenyReason

      public int getDenyReason()
      Returns the reason (i.e., SNMPv2/v3 error status) that indicates the error condition that caused this event to be canceled.
      Returns:
      a SNMP2v/v3 error status.
    • isDeniable

      public boolean isDeniable()
      Checks whether this event is fired in the preparation phase or the commit phase of the 2PC.
      Returns:
      true if the event can be canceled and thus the event has been fired on behalf of the preparation phase and false if it has been fired on behalf of the commit phase.