public class AgentXMasterEvent extends EventObject
AgentXMasterEvent
object describes an event that has been
triggered on behalf of a sub-agent to master agent connection/session.
When the type of the event is vetoable (i.e. the event can be used to cancel an action), its type has to be an integer value less than zero. If the type is greater than zero, the event is fired for information only and changing the veto reason has no effect.
Modifier and Type | Field and Description |
---|---|
static int |
PEER_ADDED |
static int |
PEER_REMOVED |
static int |
REGISTRATION_ADDED |
static int |
REGISTRATION_REMOVED |
static int |
REGISTRATION_TO_ADD |
static int |
SESSION_ADDED |
static int |
SESSION_REMOVED |
static int |
SESSION_TO_ADD |
source
Constructor and Description |
---|
AgentXMasterEvent(Object source,
int type,
Object changedObject)
Creates an new master agent event.
|
Modifier and Type | Method and Description |
---|---|
Object |
getChangedObject()
Returns the changed object (or the object to be changed).
|
int |
getType()
Returns the event type.
|
int |
getVetoReason()
Returns the veto reason.
|
void |
setVetoReason(int vetoReason)
Sets the AgentX reason (see
AgentXProtocol ) other than
AgentXProtocol.AGENTX_SUCCESS why the action caused this event
should be rejected and undone. |
String |
toString() |
getSource
public static final int SESSION_TO_ADD
public static final int REGISTRATION_TO_ADD
public static final int PEER_ADDED
public static final int PEER_REMOVED
public static final int SESSION_ADDED
public static final int SESSION_REMOVED
public static final int REGISTRATION_ADDED
public static final int REGISTRATION_REMOVED
public AgentXMasterEvent(Object source, int type, Object changedObject)
source
- the command processor that fired the event.type
- the event type (less than zero if vetoable, greater than zero if not).changedObject
- an optional reference to the changed object, which might be an
AgentXPeer, AgentXSession, or AgentXRegistration instance for example.public int getType()
public Object getChangedObject()
public int getVetoReason()
AgentXProtocol.AGENTX_SUCCESS
) indicates that a vetoable event
should be canceled.AgentXProtocol
.public String toString()
toString
in class EventObject
public void setVetoReason(int vetoReason)
AgentXProtocol
) other than
AgentXProtocol.AGENTX_SUCCESS
why the action caused this event
should be rejected and undone.vetoReason
- an AgentX reason code.Copyright © 2016 SNMP4J.org. All rights reserved.