Package org.snmp4j.agent.agentx.master
Class AgentXMasterEvent
java.lang.Object
java.util.EventObject
org.snmp4j.agent.agentx.master.AgentXMasterEvent
- All Implemented Interfaces:
Serializable
The
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.
- Version:
- 1.0
- Author:
- Frank Fock
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAgentXMasterEventtype "peer added".static final intAgentXMasterEventtype "peer removed".static final intAgentXMasterEventtype "registration added".static final intAgentXMasterEventtype "registration removed".static final intAgentXMasterEventtype "registration to be added".static final intAgentXMasterEventtype "session added".static final intAgentXMasterEventtype "session removed".static final intAgentXMasterEventtype "session added".Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionAgentXMasterEvent(Object source, int type, Object changedObject) Creates an new master agent event. -
Method Summary
Modifier and TypeMethodDescriptionReturns the changed object (or the object to be changed).intgetType()Returns the event type.intReturns the veto reason.voidsetVetoReason(int vetoReason) Sets the AgentX reason (seeAgentXProtocol) other thanAgentXProtocol.AGENTX_SUCCESSwhy the action caused this event should be rejected and undone.toString()Methods inherited from class java.util.EventObject
getSource
-
Field Details
-
SESSION_TO_ADD
public static final int SESSION_TO_ADDAgentXMasterEventtype "session added".- See Also:
-
REGISTRATION_TO_ADD
public static final int REGISTRATION_TO_ADDAgentXMasterEventtype "registration to be added".- See Also:
-
PEER_ADDED
public static final int PEER_ADDEDAgentXMasterEventtype "peer added".- See Also:
-
PEER_REMOVED
public static final int PEER_REMOVEDAgentXMasterEventtype "peer removed".- See Also:
-
SESSION_ADDED
public static final int SESSION_ADDEDAgentXMasterEventtype "session added".- See Also:
-
SESSION_REMOVED
public static final int SESSION_REMOVEDAgentXMasterEventtype "session removed".- See Also:
-
REGISTRATION_ADDED
public static final int REGISTRATION_ADDEDAgentXMasterEventtype "registration added".- See Also:
-
REGISTRATION_REMOVED
public static final int REGISTRATION_REMOVEDAgentXMasterEventtype "registration removed".- See Also:
-
-
Constructor Details
-
AgentXMasterEvent
Creates an new master agent event.- Parameters:
source- the command processor that fired the event.type- the event type (less than zero if veto-able, greater than zero if not).changedObject- an optional reference to the changed object, which might be an AgentXPeer, AgentXSession, or AgentXRegistration instance for example.
-
-
Method Details
-
getType
public int getType()Returns the event type.- Returns:
- if less than zero, this event can be canceled by setting an appropriate veto reason. If greater than zero, this event is for information only.
-
getChangedObject
Returns the changed object (or the object to be changed).- Returns:
- an AgentXPeer, AgentXSession, or AgentXRegistration instance for example.
-
getVetoReason
public int getVetoReason()Returns the veto reason. A value other than zero (=AgentXProtocol.AGENTX_SUCCESS) indicates that a vetoable event should be canceled.- Returns:
- an AgentX REASON code as defined by
AgentXProtocol.
-
toString
- Overrides:
toStringin classEventObject
-
setVetoReason
public void setVetoReason(int vetoReason) Sets the AgentX reason (seeAgentXProtocol) other thanAgentXProtocol.AGENTX_SUCCESSwhy the action caused this event should be rejected and undone.- Parameters:
vetoReason- an AgentX reason code.
-