Package org.snmp4j.agent.agentx
Interface AgentXMessageDispatcher
- All Superinterfaces:
org.snmp4j.transport.TransportListener
- All Known Implementing Classes:
AgentXMessageDispatcherImpl
public interface AgentXMessageDispatcher
extends org.snmp4j.transport.TransportListener
The
AgentXMessageDispatcher
implements a TransportListener
for dispatching AgentX messages.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCommandListener
(AgentXCommandListener listener) Adds aAgentXCommandListener
to this message dispatcher.void
addTransportMapping
(org.snmp4j.TransportMapping<?> transport) Adds aTransportMapping
to the dispatcher.Collection
<org.snmp4j.TransportMapping<?>> Gets theCollection
of transport mappings in this message dispatcher.void
removeCommandListener
(AgentXCommandListener listener) Removes aAgentXCommandListener
from this message dispatcher.org.snmp4j.TransportMapping
<?> removeTransportMapping
(org.snmp4j.TransportMapping<?> transport) Removes a previously addedTransportMapping
from the dispatcher.<A extends org.snmp4j.smi.Address>
org.snmp4j.mp.PduHandlesend
(org.snmp4j.TransportMapping<? super A> transport, A address, AgentXPDU message, org.snmp4j.mp.PduHandleCallback<AgentXPDU> pduHandleCallback) Sends a AgentX PDU to the specified address using the specified transport mapping.Methods inherited from interface org.snmp4j.transport.TransportListener
processMessage
-
Method Details
-
addTransportMapping
void addTransportMapping(org.snmp4j.TransportMapping<?> transport) Adds aTransportMapping
to the dispatcher. The transport mapping is used to send and receive messages to/from the network.- Parameters:
transport
- aTransportMapping
instance.
-
removeTransportMapping
org.snmp4j.TransportMapping<?> removeTransportMapping(org.snmp4j.TransportMapping<?> transport) Removes a previously addedTransportMapping
from the dispatcher.- Parameters:
transport
- aTransportMapping
instance.- Returns:
- the
TransportMapping
instance supplied if it could be successfully removed,null
otherwise.
-
getTransportMappings
Collection<org.snmp4j.TransportMapping<?>> getTransportMappings()Gets theCollection
of transport mappings in this message dispatcher.- Returns:
- Collection
-
addCommandListener
Adds aAgentXCommandListener
to this message dispatcher.- Parameters:
listener
- the command listener to add.
-
removeCommandListener
Removes aAgentXCommandListener
from this message dispatcher.- Parameters:
listener
- the listener to be removed.
-
send
<A extends org.snmp4j.smi.Address> org.snmp4j.mp.PduHandle send(org.snmp4j.TransportMapping<? super A> transport, A address, AgentXPDU message, org.snmp4j.mp.PduHandleCallback<AgentXPDU> pduHandleCallback) throws IOException Sends a AgentX PDU to the specified address using the specified transport mapping.- Type Parameters:
A
- targetAddress
type.- Parameters:
transport
- a TransportMapping supported by the AgentX protocol.address
- the target Address.message
- the AgentXPDU to send.pduHandleCallback
- an optional callback reference. If notnull
then the callback will be informed about the assigned PduHandle just before the request is sent out.- Returns:
- the PduHandle associated with the PDU.
- Throws:
IOException
- if the IO operation fails.
-