Java Doc for UDPMessageChannel.java in  » 6.0-JDK-Modules » j2me » gov » nist » siplite » stack » 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 » 6.0 JDK Modules » j2me » gov.nist.siplite.stack 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   gov.nist.siplite.stack.MessageChannel
      gov.nist.siplite.stack.UDPMessageChannel

UDPMessageChannel
public class UDPMessageChannel extends MessageChannel implements ParseExceptionListener,Runnable(Code)
This is the UDP Message handler that gets created when a UDP message needs to be processed. The message is processed by creating a String Message parser and invoking it on the message read from the UPD socket. The parsed structure is handed off via a SIP stack request for further processing. This stack structure isolates the message handling logic from the mechanics of sending and recieving messages (which could be either udp or tcp. Acknowledgement: Kim Kirby of Keyvoice suggested that duplicate checking should be added to the stack.
See Also:   gov.nist.siplite.parser.StringMsgParser
See Also:   gov.nist.siplite.stack.SIPServerRequestInterface
since:
   v1.0


Field Summary
protected static  Hashtableduplicates
     Pool of duplicate messages.
protected  SIPMessageStackstack
     SIP Stack structure for this channel.

Constructor Summary
public  UDPMessageChannel(Datagram packet, SIPMessageStack sipStack, MessageProcessor messageProcessor)
     Constructor - takes a datagram packet and a stack structure Extracts the address of the other from the datagram packet and stashes away the pointer to the passed stack structure.
public  UDPMessageChannel(String targetAddr, int port, SIPMessageStack sipStack, UDPMessageProcessor processor)
     Constructor.

Method Summary
public  voidclose()
     Closes the message channel.
public  booleanequals(Object other)
     Compares two UDP Message channels for equality.
Parameters:
  other - The other message channel with which to compare oursleves.
public  StringgetHost()
     Gets the stack address for the stack that received this message.
public  StringgetKey()
     Gets the key.
public  StringgetPeerAddress()
     Gets the peer address of the machine that sent us this message.
public  intgetPeerPort()
     Gets the sender port (the port of the other end that sent me the message).
public  intgetPort()
     Gets the port.
public  SIPMessageStackgetSIPStack()
     Gets the stack pointer.
public  StringgetTransport()
     Returns a transport string.
public  StringgetViaHost()
     Gets the logical originator of the message (from the top via header).
public  intgetViaPort()
     Gets the logical port of the message orginator (from the top via hdr).
public  voidhandleException(SIPServerException ex)
     Handles an exception - construct a sip reply and send it back to the caller.
public  voidhandleException(ParseException ex, Message sipMessage, Class hdrClass, String headerText, String messageText)
     This gets called from the parser when a parse error is generated. The handler is supposed to introspect on the error class and header name to handle the error appropriately.
public  booleanisReliable()
    
public  booleanisSecure()
     Returns true if this is a secure channel.
public  voidrun()
     Runs method specified by runnnable.
public  voidsendMessage(Message sipMessage)
     Returns a reply from a pre-constructed reply.
protected  voidsendMessage(byte[] msg, String receiverAddress, int receiverPort)
     Sends a message to a specified receiver address.
protected  voidsendMessage(byte[] msg, String receiverAddress, int receiverPort, String receiverProtocol)
     Sends a message to a specified receiver address.

Field Detail
duplicates
protected static Hashtable duplicates(Code)
Pool of duplicate messages.



stack
protected SIPMessageStack stack(Code)
SIP Stack structure for this channel.




Constructor Detail
UDPMessageChannel
public UDPMessageChannel(Datagram packet, SIPMessageStack sipStack, MessageProcessor messageProcessor)(Code)
Constructor - takes a datagram packet and a stack structure Extracts the address of the other from the datagram packet and stashes away the pointer to the passed stack structure.
Parameters:
  packet - is the UDP Packet that contains the request.
Parameters:
  sipStack - stack is the shared SipStack structure
Parameters:
  messageProcessor - the UDP input message channel



UDPMessageChannel
public UDPMessageChannel(String targetAddr, int port, SIPMessageStack sipStack, UDPMessageProcessor processor)(Code)
Constructor. We create one of these when we send out a message.
Parameters:
  targetAddr - internet address of the place where we want to sendmessages.
Parameters:
  port - target port (where we want to send the message).
Parameters:
  sipStack - our SIP Stack.
Parameters:
  processor - inbound message processor




Method Detail
close
public void close()(Code)
Closes the message channel.



equals
public boolean equals(Object other)(Code)
Compares two UDP Message channels for equality.
Parameters:
  other - The other message channel with which to compare oursleves. true if the objects match



getHost
public String getHost()(Code)
Gets the stack address for the stack that received this message. The stack address for our stack.



getKey
public String getKey()(Code)
Gets the key. the key



getPeerAddress
public String getPeerAddress()(Code)
Gets the peer address of the machine that sent us this message. a string contianing the ip address or host name of the senderof the message.



getPeerPort
public int getPeerPort()(Code)
Gets the sender port (the port of the other end that sent me the message). the remote port number



getPort
public int getPort()(Code)
Gets the port. Our port (on which we are getting datagrampackets).



getSIPStack
public SIPMessageStack getSIPStack()(Code)
Gets the stack pointer. The sip stack for this channel.



getTransport
public String getTransport()(Code)
Returns a transport string. the string "udp" in this case.



getViaHost
public String getViaHost()(Code)
Gets the logical originator of the message (from the top via header). topmost via header sentby field



getViaPort
public int getViaPort()(Code)
Gets the logical port of the message orginator (from the top via hdr). the via port from the topmost via header.



handleException
public void handleException(SIPServerException ex)(Code)
Handles an exception - construct a sip reply and send it back to the caller.
Parameters:
  ex - The exception thrown at us by ourapplication.



handleException
public void handleException(ParseException ex, Message sipMessage, Class hdrClass, String headerText, String messageText) throws ParseException(Code)
This gets called from the parser when a parse error is generated. The handler is supposed to introspect on the error class and header name to handle the error appropriately. The error can be handled by :
  • 1. Re-throwing an exception and aborting the parse.
  • 2. Ignoring the header (attach the unparseable header to the Message being parsed).
  • 3. Re-Parsing the bad header and adding it to the sipMessage

Parameters:
  ex - parse exception being processed.
Parameters:
  sipMessage - sip message being processed.
Parameters:
  hdrClass - header parsing class
Parameters:
  headerText - header/RL/SL text being parsed.
Parameters:
  messageText - message where this header was detected.



isReliable
public boolean isReliable()(Code)
Checks if the transport is reliable always false



isSecure
public boolean isSecure()(Code)
Returns true if this is a secure channel. always false



run
public void run()(Code)
Runs method specified by runnnable.



sendMessage
public void sendMessage(Message sipMessage) throws IOException(Code)
Returns a reply from a pre-constructed reply. This sends the message back to the entity who caused us to create this channel in the first place.
Parameters:
  sipMessage - Message string to send.
throws:
  IOException - If there is a problem with sending themessage.



sendMessage
protected void sendMessage(byte[] msg, String receiverAddress, int receiverPort) throws IOException(Code)
Sends a message to a specified receiver address.
Parameters:
  msg - message string to send.
Parameters:
  receiverAddress - Address of the place to send it to.
Parameters:
  receiverPort - the port to send it to.
throws:
  IOException - If there is trouble sending this message.



sendMessage
protected void sendMessage(byte[] msg, String receiverAddress, int receiverPort, String receiverProtocol) throws IOException(Code)
Sends a message to a specified receiver address.
Parameters:
  msg - message string to send.
Parameters:
  receiverAddress - Address of the place to send it to.
Parameters:
  receiverPort - the port to send it to.
Parameters:
  receiverProtocol - protocol to use to send.
throws:
  IOException - If there is trouble sending this message.



Fields inherited from gov.nist.siplite.stack.MessageChannel
protected MessageProcessor messageProcessor(Code)(Java Doc)

Methods inherited from gov.nist.siplite.stack.MessageChannel
abstract public void close()(Code)(Java Doc)
public String getHost()(Code)(Java Doc)
public HostPort getHostPort()(Code)(Java Doc)
abstract public String getKey()(Code)(Java Doc)
public static String getKey(String inetAddr, int port, String transport)(Code)(Java Doc)
public MessageProcessor getMessageProcessor()(Code)(Java Doc)
abstract public String getPeerAddress()(Code)(Java Doc)
public HostPort getPeerHostPort()(Code)(Java Doc)
abstract public int getPeerPort()(Code)(Java Doc)
public int getPort()(Code)(Java Doc)
abstract public SIPMessageStack getSIPStack()(Code)(Java Doc)
abstract public String getTransport()(Code)(Java Doc)
public ViaHeader getViaHeader()(Code)(Java Doc)
abstract public String getViaHost()(Code)(Java Doc)
public HostPort getViaHostPort()(Code)(Java Doc)
abstract public int getViaPort()(Code)(Java Doc)
abstract public void handleException(SIPServerException ex)(Code)(Java Doc)
abstract public boolean isReliable()(Code)(Java Doc)
abstract public boolean isSecure()(Code)(Java Doc)
protected void logMessage(Message sipMessage, String address, int port, long time)(Code)(Java Doc)
public void logResponse(Response sipResponse, long receptionTime, String status)(Code)(Java Doc)
abstract public void sendMessage(Message sipMessage) throws IOException(Code)(Java Doc)
abstract protected void sendMessage(byte[] message, String receiverAddress, int receiverPort) throws IOException(Code)(Java Doc)
public void sendMessage(Message sipMessage, String receiverAddress, int receiverPort) throws IOException(Code)(Java Doc)

Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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