org.snmp4j.agent.agentx.master
Class AgentXMasterEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.snmp4j.agent.agentx.master.AgentXMasterEvent
All Implemented Interfaces:
java.io.Serializable

public class AgentXMasterEvent
extends java.util.EventObject

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:
Serialized Form

Field Summary
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
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
AgentXMasterEvent(java.lang.Object source, int type, java.lang.Object changedObject)
          Creates an new master agent event.
 
Method Summary
 java.lang.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.
 java.lang.String toString()
           
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SESSION_TO_ADD

public static final int SESSION_TO_ADD
See Also:
Constant Field Values

REGISTRATION_TO_ADD

public static final int REGISTRATION_TO_ADD
See Also:
Constant Field Values

PEER_ADDED

public static final int PEER_ADDED
See Also:
Constant Field Values

PEER_REMOVED

public static final int PEER_REMOVED
See Also:
Constant Field Values

SESSION_ADDED

public static final int SESSION_ADDED
See Also:
Constant Field Values

SESSION_REMOVED

public static final int SESSION_REMOVED
See Also:
Constant Field Values

REGISTRATION_ADDED

public static final int REGISTRATION_ADDED
See Also:
Constant Field Values

REGISTRATION_REMOVED

public static final int REGISTRATION_REMOVED
See Also:
Constant Field Values
Constructor Detail

AgentXMasterEvent

public AgentXMasterEvent(java.lang.Object source,
                         int type,
                         java.lang.Object changedObject)
Creates an new master agent event.

Parameters:
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.
Method Detail

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

public java.lang.Object 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

public java.lang.String toString()
Overrides:
toString in class java.util.EventObject

setVetoReason

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

Parameters:
vetoReason - an AgentX reason code.

Copyright 2005-2011 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.