Java Doc for MessageDispatcher.java in  » Net » snmp4j » org » snmp4j » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Net » snmp4j » org.snmp4j 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.snmp4j.MessageDispatcher

All known Subclasses:   org.snmp4j.MessageDispatcherImpl,  org.snmp4j.util.MultiThreadedMessageDispatcher,
MessageDispatcher
public interface MessageDispatcher extends TransportListener(Code)
The MessageDispatcher interface defines common services of instances that process incoming SNMP messages and dispatch them to interested CommandResponder instances. It also provides a service to send out outgoing SNMP messages.

A MessageDispatcher needs at least one TransportMapping and at least one MessageProcessingModel in order to be able to process any messages.
author:
   Frank Fock
version:
   1.6





Method Summary
 voidaddCommandResponder(CommandResponder listener)
     Adds a CommandResponder instance to the message dispatcher.
 voidaddMessageProcessingModel(MessageProcessingModel model)
     Adds a MessageProcessingModel to the dispatcher.
 voidaddTransportMapping(TransportMapping transport)
     Adds a TransportMapping to the dispatcher.
 MessageProcessingModelgetMessageProcessingModel(int messageProcessingModel)
     Gets the MessageProcessingModel for the supplied message processing model ID.
 intgetNextRequestID()
     Gets the next unique request ID.
 TransportMappinggetTransport(Address destAddress)
     Returns a transport mapping that can handle the supplied address.
 CollectiongetTransportMappings()
     Gets the Collection of transport mappings in this message dispatcher.
 voidprocessMessage(TransportMapping sourceTransport, Address incomingAddress, BERInputStream wholeMessage)
     Process an incoming SNMP message.
 voidprocessMessage(TransportMapping sourceTransport, Address incomingAddress, ByteBuffer wholeMessage)
     Process an incoming SNMP message.
 voidreleaseStateReference(int messageProcessingModel, PduHandle pduHandle)
     Release any state references associated with the supplied PduHandle in the specified message processing model.
 voidremoveCommandResponder(CommandResponder listener)
     Removes a previously added CommandResponder instance from the message dispatcher.
 voidremoveMessageProcessingModel(MessageProcessingModel model)
     Removes a previously added MessageProcessingModel from the dispatcher.
 TransportMappingremoveTransportMapping(TransportMapping transport)
     Removes a previously added TransportMapping from the dispatcher.
 intreturnResponsePdu(int messageProcessingModel, int securityModel, byte[] securityName, int securityLevel, PDU pdu, int maxSizeResponseScopedPDU, StateReference stateReference, StatusInformation statusInformation)
     Returns a response PDU to the sender of the corresponding request PDU.
 PduHandlesendPdu(TransportMapping transportMapping, Address transportAddress, int messageProcessingModel, int securityModel, byte[] securityName, int securityLevel, PDU pdu, boolean expectResponse)
     Sends a PDU to the supplied transport address.
Parameters:
  transportMapping - the TransportMapping to be used to send the PDU.
 PduHandlesendPdu(TransportMapping transportMapping, Address transportAddress, int messageProcessingModel, int securityModel, byte[] securityName, int securityLevel, PDU pdu, boolean expectResponse, PduHandleCallback callback)
     Sends a PDU to the supplied transport address and returns the PduHandle that uniquely identifies the request as response after the request has been sent and otional, if a PduHandleCallback is given, it returns also the PduHandle just before the request is sent through the the callback interface.
Parameters:
  transportMapping - the TransportMapping to be used to send the PDU.
 PduHandlesendPdu(Address transportAddress, int messageProcessingModel, int securityModel, byte[] securityName, int securityLevel, PDU pdu, boolean expectResponse)
     Sends a PDU to the supplied transport address.



Method Detail
addCommandResponder
void addCommandResponder(CommandResponder listener)(Code)
Adds a CommandResponder instance to the message dispatcher. Successfully processed SNMP messages will be presented to all command responder (in the order in which they have been added) until a responder uses the CommandResponderEvent.setProcessed(boolean processed) to set the processed status of the event to true.
Parameters:
  listener - a CommandResponder instance.



addMessageProcessingModel
void addMessageProcessingModel(MessageProcessingModel model)(Code)
Adds a MessageProcessingModel to the dispatcher. In order to support a specific SNMP protocol version, the message dispatcher needs a message processing model to process messages before they can be dispatched.
Parameters:
  model - a MessageProcessingModel instance.



addTransportMapping
void addTransportMapping(TransportMapping transport)(Code)
Adds a TransportMapping to the dispatcher. The transport mapping is used to send and receive messages to/from the network.
Parameters:
  transport - a TransportMapping instance.



getMessageProcessingModel
MessageProcessingModel getMessageProcessingModel(int messageProcessingModel)(Code)
Gets the MessageProcessingModel for the supplied message processing model ID.
Parameters:
  messageProcessingModel - a message processing model ID(see MessageProcessingModel.getID).a MessageProcessingModel instance if the ID is known, otherwisenull



getNextRequestID
int getNextRequestID()(Code)
Gets the next unique request ID. The returned ID is unique across the last 2^31-1 IDs generated by this message dispatcher. an integer value in the range 1..2^31-1. The returned ID can be usedto map responses to requests send through this message dispatcher.
since:
   1.1



getTransport
TransportMapping getTransport(Address destAddress)(Code)
Returns a transport mapping that can handle the supplied address.
Parameters:
  destAddress - an Address instance.a TransportMapping instance that can be used to senta SNMP message to destAddress or null ifsuch a transport mapping does not exists.
since:
   1.6



getTransportMappings
Collection getTransportMappings()(Code)
Gets the Collection of transport mappings in this message dispatcher. a Collection with the registered transport mappings.



processMessage
void processMessage(TransportMapping sourceTransport, Address incomingAddress, BERInputStream wholeMessage)(Code)
Process an incoming SNMP message. The message is processed and dispatched according to the message's content, the message processing models, and the command responder available to the dispatcher.
Parameters:
  sourceTransport - a TransportMapping instance denoting the transport thatreceived the message and that will be used to send any responses tothis message. The sourceTransport has to support theincomingAddress's implementation class.
Parameters:
  incomingAddress - the Address from which the message has been received.
Parameters:
  wholeMessage - an BERInputStream containing the received SNMP message.The supplied input stream must support marks, otherwise anIllegalArgumentException is thrown.MessageDispatcher.processMessage(TransportMapping,Address,ByteBuffer)



processMessage
void processMessage(TransportMapping sourceTransport, Address incomingAddress, ByteBuffer wholeMessage)(Code)
Process an incoming SNMP message. The message is processed and dispatched according to the message's content, the message processing models, and the command responder available to the dispatcher.
Parameters:
  sourceTransport - a TransportMapping instance denoting the transport thatreceived the message and that will be used to send any responses tothis message. The sourceTransport has to support theincomingAddress's implementation class.
Parameters:
  incomingAddress - the Address from which the message has been received.
Parameters:
  wholeMessage - an ByteBuffer containing the received SNMP message.



releaseStateReference
void releaseStateReference(int messageProcessingModel, PduHandle pduHandle)(Code)
Release any state references associated with the supplied PduHandle in the specified message processing model.
Parameters:
  messageProcessingModel - a message processing model ID.
Parameters:
  pduHandle - the PduHandle that identifies a confirmed class message.
See Also:   MessageProcessingModel



removeCommandResponder
void removeCommandResponder(CommandResponder listener)(Code)
Removes a previously added CommandResponder instance from the message dispatcher.
Parameters:
  listener - a CommandResponder instance.



removeMessageProcessingModel
void removeMessageProcessingModel(MessageProcessingModel model)(Code)
Removes a previously added MessageProcessingModel from the dispatcher.
Parameters:
  model - a MessageProcessingModel instance.



removeTransportMapping
TransportMapping removeTransportMapping(TransportMapping transport)(Code)
Removes a previously added TransportMapping from the dispatcher.
Parameters:
  transport - a TransportMapping instance.the TransportMapping instance supplied if itcould be successfully removed, null otherwise.



returnResponsePdu
int returnResponsePdu(int messageProcessingModel, int securityModel, byte[] securityName, int securityLevel, PDU pdu, int maxSizeResponseScopedPDU, StateReference stateReference, StatusInformation statusInformation) throws MessageException(Code)
Returns a response PDU to the sender of the corresponding request PDU.
Parameters:
  messageProcessingModel - int
Parameters:
  securityModel - int
Parameters:
  securityName - byte[]
Parameters:
  securityLevel - int
Parameters:
  pdu - PDU
Parameters:
  maxSizeResponseScopedPDU - int
Parameters:
  stateReference - StateReference
Parameters:
  statusInformation - StatusInformation
throws:
  MessageException - int



sendPdu
PduHandle sendPdu(TransportMapping transportMapping, Address transportAddress, int messageProcessingModel, int securityModel, byte[] securityName, int securityLevel, PDU pdu, boolean expectResponse) throws MessageException(Code)
Sends a PDU to the supplied transport address.
Parameters:
  transportMapping - the TransportMapping to be used to send the PDU. IftransportMapping is null the messagedispatcher will determine the appropriate transport mapping for thegiven transport address.
Parameters:
  transportAddress - the target transport address.
Parameters:
  messageProcessingModel - typically the SNMP version.
Parameters:
  securityModel - Security Model to use.
Parameters:
  securityName - on behalf of this principal.
Parameters:
  securityLevel - Level of Security requested.
Parameters:
  pdu - the SNMP Protocol Data Unit
Parameters:
  expectResponse - true if a response is expected and a state reference shouldbe saved (if needed for the supplied message processing model).an PduHandle that uniquely identifies this request.
throws:
  MessageException -



sendPdu
PduHandle sendPdu(TransportMapping transportMapping, Address transportAddress, int messageProcessingModel, int securityModel, byte[] securityName, int securityLevel, PDU pdu, boolean expectResponse, PduHandleCallback callback) throws MessageException(Code)
Sends a PDU to the supplied transport address and returns the PduHandle that uniquely identifies the request as response after the request has been sent and otional, if a PduHandleCallback is given, it returns also the PduHandle just before the request is sent through the the callback interface.
Parameters:
  transportMapping - the TransportMapping to be used to send the PDU. IftransportMapping is null the messagedispatcher will determine the appropriate transport mapping for thegiven transport address.
Parameters:
  transportAddress - the target transport address.
Parameters:
  messageProcessingModel - typically the SNMP version.
Parameters:
  securityModel - Security Model to use.
Parameters:
  securityName - on behalf of this principal.
Parameters:
  securityLevel - Level of Security requested.
Parameters:
  pdu - the SNMP Protocol Data Unit
Parameters:
  expectResponse - true if a response is expected and a state reference shouldbe saved (if needed for the supplied message processing model).
Parameters:
  callback - an optional callback instance that is informed (if notnull) about the newly assigned PduHandle just before themessage is sent out.an PduHandle that uniquely identifies this request.
throws:
  MessageException -



sendPdu
PduHandle sendPdu(Address transportAddress, int messageProcessingModel, int securityModel, byte[] securityName, int securityLevel, PDU pdu, boolean expectResponse) throws MessageException(Code)
Sends a PDU to the supplied transport address. This method behaves like a call to MessageDispatcher.sendPdu(TransportMapping transportMapping,Address transportAddress,int messageProcessingModel,int securityModel,byte[] securityName,int securityLevel,PDU pdu,boolean expectResponse) with transportMapping set to null.
Parameters:
  transportAddress - the target transport address.
Parameters:
  messageProcessingModel - typically the SNMP version.
Parameters:
  securityModel - Security Model to use.
Parameters:
  securityName - on behalf of this principal.
Parameters:
  securityLevel - Level of Security requested.
Parameters:
  pdu - the SNMP Protocol Data Unit
Parameters:
  expectResponse - true if a response is expected and a state reference shouldbe saved (if needed for the supplied message processing model).an PduHandle that uniquely identifies this request.
throws:
  MessageException -



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.