Package org.snmp4j.agent.agentx
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
The
AgentXCommandEvent
implements an event object emitted during execution of a AgentX
command.- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionAgentXCommandEvent
(Object source, AgentXMessageDispatcher dispatcher, A peerAddress, org.snmp4j.transport.ConnectionOrientedTransportMapping<A> peerTransport, AgentXParseException exception, org.snmp4j.TransportStateReference tmStateReference) Creates a new command event.AgentXCommandEvent
(Object source, AgentXMessageDispatcher dispatcher, A peerAddress, org.snmp4j.transport.ConnectionOrientedTransportMapping<A> peerTransport, AgentXPDU command, org.snmp4j.TransportStateReference tmStateReference) Creates a new command event. -
Method Summary
Modifier and TypeMethodDescriptionCreate theAgentXPeer
based on peer address and peer transport.Gets the command.Gets theAgentXMessageDispatcher
.Gets the exception.Gets the peer address.org.snmp4j.transport.ConnectionOrientedTransportMapping
<A> Gets the peer transport.org.snmp4j.TransportStateReference
Gets the transport state reference.boolean
Checks if there was an exception processing the command.boolean
Checks if the command has been processed or not.void
setProcessed
(boolean done) Sets the processed flag.toString()
Methods inherited from class java.util.EventObject
getSource
-
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
- theAgentXMessageDispatcher
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
- theAgentXMessageDispatcher
used with the command.peerAddress
- the peer address.peerTransport
- the peer transport.exception
- theAgentXParseException
occurred.tmStateReference
- the transport mapping state reference.
-
-
Method Details
-
getCommand
Gets the command.- Returns:
- the command emitting the event or
null
if an exception occurred (usegetException()
then).
-
getPeerAddress
Gets the peer address.- Returns:
- peer address.
-
createAgentXPeer
Create theAgentXPeer
based on peer address and peer transport.- Returns:
- an
AgentXPeer
.
-
getPeerTransport
Gets the peer transport.- Returns:
- a
ConnectionOrientedTransportMapping
.
-
getDispatcher
Gets theAgentXMessageDispatcher
.- 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 orfalse
otheriwse.
-
isException
public boolean isException()Checks if there was an exception processing the command.- Returns:
true
if there was an exception orfalse
otheriwse.
-
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
- Overrides:
toString
in classEventObject
-