Java Doc for TCPMessageChannel.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.TCPMessageChannel

TCPMessageChannel
public class TCPMessageChannel extends MessageChannel implements SIPMessageListener(Code)
Handle a TCP stream connection.
version:
   1.0



Constructor Summary
protected  TCPMessageChannel(SocketConnection sock, SIPMessageStack sipStack, TCPMessageProcessor msgProcessor)
     Constructor - gets called from the SIPMessageStack class with a socket on accepting a new client.
protected  TCPMessageChannel(HostPort targetHostPort, SIPMessageStack sipStack, TCPMessageProcessor msgProcessor)
     Constructor - connects to the given inet address.

Method Summary
public synchronized  voidclose()
     Closes the message channel.
public  booleanequals(Object other)
     Equals predicate.
protected synchronized  voidexit()
     Closes the message channel regardless whether it is used or not.
public  StringgetKey()
     Gets an identifying key.
public  StringgetPeerAddress()
     Gets the address of the client that sent the data to us.
public  intgetPeerPort()
     Gets the port of the peer to whom we are sending messages.
public  SIPMessageStackgetSIPStack()
     Gets my SIP Stack.
public  StringgetTransport()
     Gets the transport string.
public  StringgetViaHost()
     Gets the host to assign to outgoing messages.
public  intgetViaPort()
     Gets the port for outgoing messages sent from the channel.
public  voidhandleException(SIPServerException ex)
     Exception processor for exceptions detected from the application.
public  voidhandleException(ParseException ex, Message sipMessage, Class hdrClass, String header, String message)
     Exception processor for exceptions detected from the parser.
public  voidhandleIOException()
     Called when the pipelined parser cannot read input because the other end closed the connection.
protected synchronized  voidincrementUseCounter()
     Increments the number of user of this channel.
public  booleanisReliable()
     Returns "true" as this is a reliable transport.
public  booleanisSecure()
     TCP Is not a secure protocol.
public  voidprocessMessage(Message sipMessage)
     Gets invoked by the parser as a callback on successful message parsing (i.e.
public  voidsendMessage(Message sipMessage)
     Returns a formatted message to the client.
public  voidsendMessage(byte message, String receiverAddress, int receiverPort)
     Sends a message to a specified address.


Constructor Detail
TCPMessageChannel
protected TCPMessageChannel(SocketConnection sock, SIPMessageStack sipStack, TCPMessageProcessor msgProcessor) throws IOException(Code)
Constructor - gets called from the SIPMessageStack class with a socket on accepting a new client. All the processing of the message is done here with the stack being freed up to handle new connections. The sock input is the socket that is returned from the accept. Global data that is shared by all threads is accessible in the Server structure.
Parameters:
  sock - Socket from which to read and write messages. The socketis already connected (was created as a result of an accept).
Parameters:
  sipStack - Ptr to SIP Stack
Parameters:
  msgProcessor - handler for TCP message communication



TCPMessageChannel
protected TCPMessageChannel(HostPort targetHostPort, SIPMessageStack sipStack, TCPMessageProcessor msgProcessor) throws IOException(Code)
Constructor - connects to the given inet address.
Parameters:
  targetHostPort - inet address to connect to.
Parameters:
  sipStack - is the sip stack from which we are created.
Parameters:
  msgProcessor - TCP message processor
throws:
  IOException - if we cannot connect.




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



equals
public boolean equals(Object other)(Code)
Equals predicate.
Parameters:
  other - is the other object to compare ourselves to for equals true if object matches



exit
protected synchronized void exit()(Code)
Closes the message channel regardless whether it is used or not.



getKey
public String getKey()(Code)
Gets an identifying key. This key is used to cache the connection and re-use it if necessary. the identifying key



getPeerAddress
public String getPeerAddress()(Code)
Gets the address of the client that sent the data to us. Address of the client that sent us datathat resulted in this channel beingcreated.



getPeerPort
public int getPeerPort()(Code)
Gets the port of the peer to whom we are sending messages. the peer port.



getSIPStack
public SIPMessageStack getSIPStack()(Code)
Gets my SIP Stack. The SIP Stack for this message channel.



getTransport
public String getTransport()(Code)
Gets the transport string. "tcp" in this case.



getViaHost
public String getViaHost()(Code)
Gets the host to assign to outgoing messages. the host to assign to the via header.



getViaPort
public int getViaPort()(Code)
Gets the port for outgoing messages sent from the channel. the port to assign to the via header.



handleException
public void handleException(SIPServerException ex)(Code)
Exception processor for exceptions detected from the application.
Parameters:
  ex - The exception that was generated.



handleException
public void handleException(ParseException ex, Message sipMessage, Class hdrClass, String header, String message) throws ParseException(Code)
Exception processor for exceptions detected from the parser. (This is invoked by the parser when an error is detected).
Parameters:
  ex - parse exception detected by the parser.
Parameters:
  sipMessage - message that incurred the error.
Parameters:
  hdrClass - header parsing class
Parameters:
  header - header that caused the error.
Parameters:
  message - descriptive text for exception
throws:
  ParseException - Thrown if we want to reject the message.



handleIOException
public void handleIOException()(Code)
Called when the pipelined parser cannot read input because the other end closed the connection.



incrementUseCounter
protected synchronized void incrementUseCounter()(Code)
Increments the number of user of this channel.



isReliable
public boolean isReliable()(Code)
Returns "true" as this is a reliable transport. true if reliable stream transport



isSecure
public boolean isSecure()(Code)
TCP Is not a secure protocol. always false



processMessage
public void processMessage(Message sipMessage)(Code)
Gets invoked by the parser as a callback on successful message parsing (i.e. no parser errors).
Parameters:
  sipMessage - Mesage to process (this calls the applicationfor processing the message).



sendMessage
public void sendMessage(Message sipMessage) throws IOException(Code)
Returns a formatted message to the client. We try to re-connect with the peer on the other end if possible.
Parameters:
  sipMessage - Message to send.
throws:
  IOException - If there is an error sending the message



sendMessage
public void sendMessage(byte message, String receiverAddress, int receiverPort) throws IOException, IllegalArgumentException(Code)
Sends a message to a specified address.
Parameters:
  message - Pre-formatted message to send.
Parameters:
  receiverAddress - Address to send it to.
Parameters:
  receiverPort - Receiver port.
throws:
  IOException - If there is a problem connecting or sending.



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.