- 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
TheDeniableEventObject
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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description DeniableEventObject(Object source, boolean deniable)
Creates an deniable event instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDenyReason()
Returns the reason (i.e., SNMPv2/v3 error status) that indicates the error condition that caused this event to be canceled.boolean
isDeniable()
Checks whether this event is fired in the preparation phase or the commit phase of the 2PC.void
setDenyReason(int denyReason)
Sets the reason why this event needs to be canceled.-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
Constructor Detail
-
DeniableEventObject
public DeniableEventObject(Object source, boolean deniable)
Creates an deniable event instance.- Parameters:
source
- the event source.deniable
- iftrue
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 andfalse
if it has been fired on behalf of the commit phase.
-
-