Class DeniableEventObject

    • Constructor Detail

      • 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 Detail

      • 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.