public class AgentXMessageDispatcherImpl extends Object implements AgentXMessageDispatcher
Constructor and Description |
---|
AgentXMessageDispatcherImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addCommandListener(AgentXCommandListener l) |
void |
addTransportMapping(TransportMapping transport)
Adds a
TransportMapping to the dispatcher. |
protected PduHandle |
createPduHandle() |
protected void |
fireCommandEvent(AgentXCommandEvent event) |
int |
getNextPacketID() |
Collection<TransportMapping> |
getTransportMappings()
Gets the
Collection of transport mappings in this message
dispatcher. |
void |
processMessage(TransportMapping sourceTransport,
Address incomingAddress,
ByteBuffer wholeMessage,
TransportStateReference tmStateReference) |
void |
removeCommandListener(AgentXCommandListener l) |
TransportMapping |
removeTransportMapping(TransportMapping transport)
Removes a previously added
TransportMapping from
the dispatcher. |
void |
send(Address address,
TransportMapping transport,
ByteBuffer message,
TransportStateReference tmStateReference) |
PduHandle |
send(TransportMapping transport,
Address address,
AgentXPDU message,
PduHandleCallback<AgentXPDU> callback)
Sends a AgentX PDU to the specified address using the specified transport
mapping.
|
public int getNextPacketID()
protected PduHandle createPduHandle()
public void addTransportMapping(TransportMapping transport)
AgentXMessageDispatcher
TransportMapping
to the dispatcher. The transport mapping
is used to send and receive messages to/from the network.addTransportMapping
in interface AgentXMessageDispatcher
transport
- a TransportMapping
instance.public Collection<TransportMapping> getTransportMappings()
AgentXMessageDispatcher
Collection
of transport mappings in this message
dispatcher.getTransportMappings
in interface AgentXMessageDispatcher
public void processMessage(TransportMapping sourceTransport, Address incomingAddress, ByteBuffer wholeMessage, TransportStateReference tmStateReference)
processMessage
in interface TransportListener
public TransportMapping removeTransportMapping(TransportMapping transport)
AgentXMessageDispatcher
TransportMapping
from
the dispatcher.removeTransportMapping
in interface AgentXMessageDispatcher
transport
- a TransportMapping
instance.TransportMapping
instance supplied if it
could be successfully removed, null
otherwise.public PduHandle send(TransportMapping transport, Address address, AgentXPDU message, PduHandleCallback<AgentXPDU> callback) throws IOException
AgentXMessageDispatcher
send
in interface AgentXMessageDispatcher
transport
- a TransportMapping supported by the AgentX protocol.address
- the target Address.message
- the AgentXPDU to send.callback
- an optional callback reference. If not null
then the
callback will be informed about the assigned PduHandle just before the
request is sent out.IOException
- if the IO operation fails.public void send(Address address, TransportMapping transport, ByteBuffer message, TransportStateReference tmStateReference) throws IOException
IOException
protected void fireCommandEvent(AgentXCommandEvent event)
public void addCommandListener(AgentXCommandListener l)
addCommandListener
in interface AgentXMessageDispatcher
public void removeCommandListener(AgentXCommandListener l)
removeCommandListener
in interface AgentXMessageDispatcher
Copyright © 2016 SNMP4J.org. All rights reserved.