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


javax.sip.address.Router

All known Subclasses:   examples.tls.MyRouter,  test.tck.msgflow.callflows.NonSipUriRouter,
Router
public interface Router (Code)
The Router interface may be implemented by the application to provide custom routing logic. It is used to determine the next hop for a given request.

For backwards compatibility reasons, the default behavior of the stack is to consult the application provided Router implementation for all requests outside of a dialog. This is controlled through the stack property javax.sip.USE_ROUTER_FOR_ALL_URIS which defaults to true when not set.

This specification recommends to set the stack property javax.sip.USE_ROUTER_FOR_ALL_URIS to false. This will cause the stack to only consult the application provided Router implementation for requests with a non-SIP URI as request URI (such as tel: or pres:) and without Route headers. This enables an application to implement DNS lookups and other resolution algorithms

When javax.sip.USE_ROUTER_FOR_ALL_URIS is set to false, the next hop is determined according to the following algorithm:

  • If the request contains one or more Route headers, use the URI of the topmost Route header as next hop, possibly modifying the request in the process if the topmost Route header contains no lr parameter(See Note below))
  • Else, if the property javax.sip.OUTBOUND_PROXY is set, use its value as the next hop
  • Otherwise, use the request URI as next hop. If the request URI is not a SIP URI, call javax.sip.address.Router.getNextHop(Request) provided by the application.

Note: In case the topmost Route header contains no 'lr' parameter (which means the next hop is a strict router), the implementation will perform 'Route Information Postprocessing' as described in RFC3261 section 16.6 step 6 (also known as "Route header popping"). That is, the following modifications will be made to the request:

  1. The implementation places the Request-URI into the Route header field as the last value.
  2. The implementation then places the first Route header field value into the Request-URI and removes that value from the Route header field.
Subsequently, the request URI will be used as next hop target.

The location (classname) of the user-defined Router object is supplied in the Properties object passed to the javax.sip.SipFactory.createSipStack(Properties) method upon creation of the SIP Stack object. The Router object must accept a SipStack as an argument to the constructor in order for the Router to access attributes of the SipStack The constructor of an object implementing the Router interface must be RouterImpl(SipStack sipStack, String outboundProxy) {}

The routing policy can not be changed dynamically, i.e. the SipStack needs to be deleted and re-created. Outbound proxy should be passed to the javax.sip.SipFactory.createSipStack(Properties) method upon creation of the SIP Stack object.

Application Notes

A UAC application which desires to use a particular outbound proxy should prepend a Route header with the URI of that proxy (and 'lr' flag if appropriate). Alternatively, it may achieve the same result by setting the OUTBOUND_PROXY property (although the Route header approach is more flexible and therefore RECOMMENDED)

A proxy application may either rewrite the request URI (if the proxy is responsible for the domain), or prepend a Route header.
author:
   BEA Systems, NIST
version:
   1.2





Method Summary
public  HopgetNextHop(Request request)
     Gets the next Hop from this Router for the specified request, this method may return null if a default route is not defined.
public  ListIteratorgetNextHops(Request request)
     Gets the ListIterator of the hops of the default Route.
public  HopgetOutboundProxy()
     Gets the Outbound Proxy parameter of this Router, this method may return null if no outbound proxy is defined.



Method Detail
getNextHop
public Hop getNextHop(Request request) throws SipException(Code)
Gets the next Hop from this Router for the specified request, this method may return null if a default route is not defined. the next Hop from this Router for the Request.
See Also:   Hop
since:
   v1.2
throws:
  SipException - when there is something wrong with the request



getNextHops
public ListIterator getNextHops(Request request)(Code)
Gets the ListIterator of the hops of the default Route. This method may return null if a default route is not defined. Router.getNextHop(Request)



getOutboundProxy
public Hop getOutboundProxy()(Code)
Gets the Outbound Proxy parameter of this Router, this method may return null if no outbound proxy is defined. the Outbound Proxy of this Router.
See Also:   Hop



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