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
ConstructorsConstructorDescriptionAgentXCommandEvent(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 theAgentXPeerbased 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.TransportStateReferenceGets the transport state reference.booleanChecks if there was an exception processing the command.booleanChecks if the command has been processed or not.voidsetProcessed(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- theAgentXMessageDispatcherused 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- theAgentXMessageDispatcherused with the command.peerAddress- the peer address.peerTransport- the peer transport.exception- theAgentXParseExceptionoccurred.tmStateReference- the transport mapping state reference.
-
-
Method Details
-
getCommand
Gets the command.- Returns:
- the command emitting the event or
nullif an exception occurred (usegetException()then).
-
getPeerAddress
Gets the peer address.- Returns:
- peer address.
-
createAgentXPeer
Create theAgentXPeerbased 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:
trueif the command was processed orfalseotheriwse.
-
isException
public boolean isException()Checks if there was an exception processing the command.- Returns:
trueif there was an exception orfalseotheriwse.
-
getException
Gets the exception.- Returns:
- the exception or
nullif there was none.
-
setProcessed
public void setProcessed(boolean done) Sets the processed flag.- Parameters:
done-trueif the command has been done,falseotherwise.
-
getTmStateReference
public org.snmp4j.TransportStateReference getTmStateReference()Gets the transport state reference.- Returns:
- a
TransportStateReference.
-
toString
- Overrides:
toStringin classEventObject
-