Java Doc for ClientTransaction.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » javax » sip » 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 » Java Advanced Imaging » javax.sip 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.sip.ClientTransaction

ClientTransaction
public interface ClientTransaction extends Transaction(Code)
A client transaction is used by a User Agent Client application to send Request messages to a User Agent Server application. The client transaction is also used to match Responses from the User Agent Server to fire Response events to the SipListener for a specific client transaction. This interfaces enables an application to send a javax.sip.message.Request 's statefully. A new client transaction is generated by the application calling the SipProvider.getNewClientTransaction(Request) method.

A client transaction of the transaction layer is represented by a finite state machine that is constructed to process a particular request under the covers of a stateful SipProvider. The transaction layer handles application-layer retransmissions, matching of responses to requests, and application-layer timeouts. Any task that a User Agent Client accomplishes takes place using a series of transactions.

The client transaction must be unique within the underlying implementation. A common way to create this value is to compute a cryptographic hash of the To tag, From tag, Call-ID header field, the Request-URI of the request received (before translation), the topmost Via header, and the sequence number from the CSeq header field, in addition to any Proxy-Require and Proxy-Authorization header fields that may be present. The algorithm used to compute the hash is implementation-dependent.

For the detailed client transaction state machines refer to Chapter 17 of RFC 3261, the allowable transitions are summarized below:

Invite Transaction:
Calling --> Proceeding --> Completed --> Terminated

Non-Invite Transaction:
Trying --> Proceeding --> Completed --> Terminated
author:
   BEA Systems, NIST
version:
   1.2





Method Summary
public  RequestcreateAck()
     Creates a new Ack message from the Request associated with this client transaction.
public  RequestcreateCancel()
     Creates a new Cancel message from the Request associated with this client transaction.
public  voidsendRequest()
     Sends the Request which created this ClientTransaction.



Method Detail
createAck
public Request createAck() throws SipException(Code)
Creates a new Ack message from the Request associated with this client transaction. This ACK can be used to acknowledge the 2xx response to the request sent by this transaction. the new ACK Request specific to the Request of this clienttransaction.
throws:
  SipException - if this method is called before a final response is received for the transaction.Dialog.createAck(long)



createCancel
public Request createCancel() throws SipException(Code)
Creates a new Cancel message from the Request associated with this client transaction. The CANCEL request, is used to cancel the previous request sent by this client transaction. Specifically, it asks the UAS to cease processing the request and to generate an error response to that request. A CANCEL request constitutes its own transaction, but also references the transaction to be cancelled. CANCEL has no effect on a request to which a UAS has already given a final response.

Note that both the transaction corresponding to the original request and the CANCEL transaction will complete independently. However, a UAC canceling a request cannot rely on receiving a 487 (Request Terminated) response for the original request, as an RFC 2543 compliant UAS will not generate such a response. Therefore if there is no final response for the original request the application will receieve a TimeoutEvent with javax.sip.Timeout.TRANSACTION and the client should then consider the original transaction cancelled.

  • UAC - A UAC should not send a CANCEL request to any request explicitly supported by this specification other than INVITE request. The reason being requests other than INVITE are responded to immediately and sending a CANCEL for a non-INVITE request would always create a race condition. CANCELs are useful as a UAC can not send a BYE request on a dialog until receipt of 2xx final response to the INVITE request. The CANCEL attempts to force a non-2xx response to the INVITE, therefore if a UAC wishes to give up on its call attempt entirely it can send a CANCEL.
  • Stateful proxies - A stateful proxy may generate CANCEL requests for:
    • INVITE Requests - A CANCEL can be sent on pending INVITE client transactions based on the period specified in the INVITE's Expires header field elapsing. However, this is generally unnecessary since the endpoints involved will take care of signaling the end of the transaction.
    • Other Requests - An implementation of this specification does not need to support CANCELing non-INVITE transactions.
the new cancel Request specific to the Request of this clienttransaction.
throws:
  SipException - if this method is called to cancel a request thatcan't be cancelled i.e. ACK.



sendRequest
public void sendRequest() throws SipException(Code)
Sends the Request which created this ClientTransaction. When an application wishes to send a Request message, it creates a Request from the javax.sip.message.MessageFactory and then creates a new ClientTransaction from SipProvider.getNewClientTransaction(Request) . Calling this method on the ClientTransaction sends the Request onto the network. The Request message gets sent via the ListeningPoint information of the SipProvider that is associated to this ClientTransaction.

This method assumes that the Request is sent out of Dialog. It uses the Router to determine the next hop. If the Router returns a empty iterator, and a Dialog is associated with the outgoing request of the Transaction then the Dialog route set is used to send the outgoing request.

This method implies that the application is functioning as either a UAC or a stateful proxy, hence the underlying implementation acts statefully.
throws:
  SipException - if the SipProvider cannot send the Request for any reason.
See Also:   Request




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