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 TypeMethodDescriptionvoidaddCommandListener(AgentXCommandListener listener) Adds aAgentXCommandListenerto this message dispatcher.voidaddTransportMapping(org.snmp4j.TransportMapping<?> transport) Adds aTransportMappingto the dispatcher.Collection<org.snmp4j.TransportMapping<?>> Gets theCollectionof transport mappings in this message dispatcher.voidremoveCommandListener(AgentXCommandListener listener) Removes aAgentXCommandListenerfrom this message dispatcher.org.snmp4j.TransportMapping<?> removeTransportMapping(org.snmp4j.TransportMapping<?> transport) Removes a previously addedTransportMappingfrom 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 aTransportMappingto the dispatcher. The transport mapping is used to send and receive messages to/from the network.- Parameters:
transport- aTransportMappinginstance.
-
removeTransportMapping
org.snmp4j.TransportMapping<?> removeTransportMapping(org.snmp4j.TransportMapping<?> transport) Removes a previously addedTransportMappingfrom the dispatcher.- Parameters:
transport- aTransportMappinginstance.- Returns:
- the
TransportMappinginstance supplied if it could be successfully removed,nullotherwise.
-
getTransportMappings
Collection<org.snmp4j.TransportMapping<?>> getTransportMappings()Gets theCollectionof transport mappings in this message dispatcher.- Returns:
- Collection
-
addCommandListener
Adds aAgentXCommandListenerto this message dispatcher.- Parameters:
listener- the command listener to add.
-
removeCommandListener
Removes aAgentXCommandListenerfrom 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- targetAddresstype.- Parameters:
transport- a TransportMapping supported by the AgentX protocol.address- the target Address.message- the AgentXPDU to send.pduHandleCallback- an optional callback reference. If notnullthen 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.
-