Class AgentXCommandEvent<A extends org.snmp4j.smi.Address>

java.lang.Object
java.util.EventObject
org.snmp4j.agent.agentx.AgentXCommandEvent<A>
Type Parameters:
A - the address class of the underlying transport.
All Implemented Interfaces:
Serializable

public class AgentXCommandEvent<A extends org.snmp4j.smi.Address> extends EventObject
The AgentXCommandEvent implements an event object emitted during execution of a AgentX command.
See Also:
  • Constructor Details

    • AgentXCommandEvent

      public AgentXCommandEvent(Object source, AgentXMessageDispatcher dispatcher, A peerAddress, org.snmp4j.transport.ConnectionOrientedTransportMapping<A> peerTransport, AgentXPDU command, org.snmp4j.TransportStateReference tmStateReference)
      Creates a new command event.
      Parameters:
      source - the source of the event.
      dispatcher - the AgentXMessageDispatcher used with the command.
      peerAddress - the peer address.
      peerTransport - the peer transport.
      command - the command on whose behalf this event is emitted.
      tmStateReference - the transport mapping state reference.
    • AgentXCommandEvent

      public AgentXCommandEvent(Object source, AgentXMessageDispatcher dispatcher, A peerAddress, org.snmp4j.transport.ConnectionOrientedTransportMapping<A> peerTransport, AgentXParseException exception, org.snmp4j.TransportStateReference tmStateReference)
      Creates a new command event.
      Parameters:
      source - the source of the event.
      dispatcher - the AgentXMessageDispatcher used with the command.
      peerAddress - the peer address.
      peerTransport - the peer transport.
      exception - the AgentXParseException occurred.
      tmStateReference - the transport mapping state reference.
  • Method Details

    • getCommand

      public AgentXPDU getCommand()
      Gets the command.
      Returns:
      the command emitting the event or null if an exception occurred (use getException() then).
    • getPeerAddress

      public A getPeerAddress()
      Gets the peer address.
      Returns:
      peer address.
    • createAgentXPeer

      public AgentXPeer<A> createAgentXPeer()
      Create the AgentXPeer based on peer address and peer transport.
      Returns:
      an AgentXPeer.
    • getPeerTransport

      public org.snmp4j.transport.ConnectionOrientedTransportMapping<A> getPeerTransport()
      Gets the peer transport.
      Returns:
      a ConnectionOrientedTransportMapping.
    • getDispatcher

      public AgentXMessageDispatcher getDispatcher()
      Returns:
      the AgentX message dispatcher.
    • isProcessed

      public boolean isProcessed()
      Checks if the command has been processed or not.
      Returns:
      true if the command was processed or false otheriwse.
    • isException

      public boolean isException()
      Checks if there was an exception processing the command.
      Returns:
      true if there was an exception or false otheriwse.
    • getException

      public AgentXParseException getException()
      Gets the exception.
      Returns:
      the exception or null if there was none.
    • setProcessed

      public void setProcessed(boolean done)
      Sets the processed flag.
      Parameters:
      done - true if the command has been done, false otherwise.
    • getTmStateReference

      public org.snmp4j.TransportStateReference getTmStateReference()
      Gets the transport state reference.
      Returns:
      a TransportStateReference.
    • toString

      public String toString()
      Overrides:
      toString in class EventObject