org.snmp4j.agent.agentx
Class AgentXMessageDispatcherImpl

java.lang.Object
  extended by org.snmp4j.agent.agentx.AgentXMessageDispatcherImpl
All Implemented Interfaces:
AgentXMessageDispatcher, org.snmp4j.transport.TransportListener

public class AgentXMessageDispatcherImpl
extends java.lang.Object
implements AgentXMessageDispatcher


Constructor Summary
AgentXMessageDispatcherImpl()
           
 
Method Summary
 void addCommandListener(AgentXCommandListener l)
           
 void addTransportMapping(org.snmp4j.TransportMapping transport)
          Adds a TransportMapping to the dispatcher.
protected  org.snmp4j.mp.PduHandle createPduHandle()
           
protected  void fireCommandEvent(AgentXCommandEvent event)
           
 int getNextPacketID()
           
 java.util.Collection<org.snmp4j.TransportMapping> getTransportMappings()
          Gets the Collection of transport mappings in this message dispatcher.
 void processMessage(org.snmp4j.TransportMapping sourceTransport, org.snmp4j.smi.Address incomingAddress, java.nio.ByteBuffer wholeMessage, org.snmp4j.TransportStateReference tmStateReference)
           
 void removeCommandListener(AgentXCommandListener l)
           
 org.snmp4j.TransportMapping removeTransportMapping(org.snmp4j.TransportMapping transport)
          Removes a previously added TransportMapping from the dispatcher.
 void send(org.snmp4j.smi.Address address, org.snmp4j.TransportMapping transport, java.nio.ByteBuffer message, org.snmp4j.TransportStateReference tmStateReference)
           
 org.snmp4j.mp.PduHandle send(org.snmp4j.TransportMapping transport, org.snmp4j.smi.Address address, AgentXPDU message, org.snmp4j.mp.PduHandleCallback<AgentXPDU> callback)
          Sends a AgentX PDU to the specified address using the specified transport mapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentXMessageDispatcherImpl

public AgentXMessageDispatcherImpl()
Method Detail

getNextPacketID

public int getNextPacketID()

createPduHandle

protected org.snmp4j.mp.PduHandle createPduHandle()

addTransportMapping

public void addTransportMapping(org.snmp4j.TransportMapping transport)
Description copied from interface: AgentXMessageDispatcher
Adds a TransportMapping to the dispatcher. The transport mapping is used to send and receive messages to/from the network.

Specified by:
addTransportMapping in interface AgentXMessageDispatcher
Parameters:
transport - a TransportMapping instance.

getTransportMappings

public java.util.Collection<org.snmp4j.TransportMapping> getTransportMappings()
Description copied from interface: AgentXMessageDispatcher
Gets the Collection of transport mappings in this message dispatcher.

Specified by:
getTransportMappings in interface AgentXMessageDispatcher
Returns:
Collection

processMessage

public void processMessage(org.snmp4j.TransportMapping sourceTransport,
                           org.snmp4j.smi.Address incomingAddress,
                           java.nio.ByteBuffer wholeMessage,
                           org.snmp4j.TransportStateReference tmStateReference)
Specified by:
processMessage in interface org.snmp4j.transport.TransportListener

removeTransportMapping

public org.snmp4j.TransportMapping removeTransportMapping(org.snmp4j.TransportMapping transport)
Description copied from interface: AgentXMessageDispatcher
Removes a previously added TransportMapping from the dispatcher.

Specified by:
removeTransportMapping in interface AgentXMessageDispatcher
Parameters:
transport - a TransportMapping instance.
Returns:
the TransportMapping instance supplied if it could be successfully removed, null otherwise.

send

public org.snmp4j.mp.PduHandle send(org.snmp4j.TransportMapping transport,
                                    org.snmp4j.smi.Address address,
                                    AgentXPDU message,
                                    org.snmp4j.mp.PduHandleCallback<AgentXPDU> callback)
                             throws java.io.IOException
Description copied from interface: AgentXMessageDispatcher
Sends a AgentX PDU to the specified address using the specified transport mapping.

Specified by:
send in interface AgentXMessageDispatcher
Parameters:
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.
Returns:
the PduHandle associated with the PDU.
Throws:
java.io.IOException - if the IO operation fails.

send

public void send(org.snmp4j.smi.Address address,
                 org.snmp4j.TransportMapping transport,
                 java.nio.ByteBuffer message,
                 org.snmp4j.TransportStateReference tmStateReference)
          throws java.io.IOException
Throws:
java.io.IOException

fireCommandEvent

protected void fireCommandEvent(AgentXCommandEvent event)

addCommandListener

public void addCommandListener(AgentXCommandListener l)
Specified by:
addCommandListener in interface AgentXMessageDispatcher

removeCommandListener

public void removeCommandListener(AgentXCommandListener l)
Specified by:
removeCommandListener in interface AgentXMessageDispatcher

Copyright 2005-2011 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.