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

SipURI
public interface SipURI extends URI,Parameters(Code)
This class represents SIP URIs, that may have either a sip: or sips: scheme. All SIP implementations MUST support the sip: URI scheme.

SIP and SIPS URIs are used for addressing. They are similar to email addresses in that they are of the form user@host where user is either a user name or telephone number, and host is a host or domain name, or a numeric IP address. Additionally, SIP and SIPS URIs may contain parameters and headers (although headers are not legal in all contexts). A SipURI can be embedded in web pages, business cards or other hyperlinks to indicate that a particular user or service can be called via SIP.

Within a SIP Message, SipURIs are used to indicate the source and intended destination of a Request, redirection addresses and the current destination of a Request. Normally all these Headers will contain SipURIs.

Syntactically, SIP and SIPS URIs are identical except for the name of the URI scheme. The semantics differs in that the SIPS scheme implies that the identified resource is to be contacted using TLS. Because SIP and SIPS URIs are syntactically identical and because they're used the same way, they're both represented by the SipURI interface.

The SipURI interface extends the generic URI interface and provides additional convenience methods for the following components of a SipURI address, above the generic URI interface:

  • User - The set of valid telephone-subscriber strings is a subset of valid user strings. The user URI parameter exists to distinguish telephone numbers from user names that happen to look like telephone numbers. If the user string contains a telephone number formatted as a telephone-subscriber, the user parameter value "phone" SHOULD be present. Even without this parameter, recipients of SIP and SIPS URIs MAY interpret the pre-@ part as a telephone number if local restrictions on the name space for user name allow it.
  • UserPassword - A password associated with the user. While the SIP and SIPS URI syntax allows this field to be present, its use is NOT RECOMMENDED, because the passing of authentication information in clear text (such as URIs) has proven to be a security risk in almost every case where it has been used. For instance, transporting a PIN number in this field exposes the PIN.
  • URI parameters - Parameters affecting a request constructed from this URI. URI parameters are added after the hostport component and are separated by semi-colons. URI parameters take the form:
    parameter-name "=" parameter-value
    Even though an arbitrary number of URI parameters may be included in a URI, any given parameter-name MUST NOT appear more than once. The SipURI interface also provides convenience methods for the manipulation of popular parameters in a SipURI address, namely:
    • Lr Parameter - the element responsible for this resource implements the routing mechanisms specified in RFC 3261.
    • Method - The method of the SIP request constructed from the URI.
    • MAddr Parameter - the server address to be contacted for this user.
    • TTL Parameter - the time-to-live value when packets are sent using UDP multicast.
    • User Parameter - the set of valid telephone-subscriber strings.
    • Transport Parameter - specifies which transport protocol to use for sending requests and responses to this entity
  • URI Headers - Header fields to be included in a request constructed from the URI. Headers fields in the SIP request can be specified with the "?" mechanism within a URI. The header names and values are encoded in ampersand separated 'hname = hvalue' pairs. The special hname "body" indicates that the associated hvalue is the message-body of the SIP request.
  • Secure - This determines if the scheme of this URI is either sip: or sips:, where sips: is secure.
See section 19.1.2 of RFC3261 for the use of SIP and SIPS URI components based on the context in which the URI appears.
See Also:   javax.sip.header.FromHeader
See Also:   javax.sip.header.ToHeader
See Also:   javax.sip.header.ContactHeader
See Also:   URI
author:
   BEA Systems, NIST
version:
   1.2




Method Summary
public  StringgetHeader(String name)
     Returns the value of the named header, or null if it is not set. SIP/SIPS URIs may specify headers.
public  IteratorgetHeaderNames()
     Returns an Iterator over the String names of all headers present in this SipURI.
public  StringgetHost()
     Returns the host part of this SipURI.
public  StringgetMAddrParam()
     Returns the value of the maddr parameter, or null if this is not set.
public  StringgetMethodParam()
     Returns the value of the method parameter, or null if this is not set.
public  intgetPort()
     Returns the port part of this SipURI.
public  intgetTTLParam()
     Returns the value of the "ttl" parameter, or -1 if this is not set.
public  StringgetTransportParam()
     Returns the value of the "transport" parameter, or null if this is not set.
public  StringgetUser()
     Returns the user part of this SipURI.
public  StringgetUserParam()
     Returns the value of the userParam, or null if this is not set.
public  StringgetUserPassword()
     Gets user password of SipURI, or null if it is not set.
public  booleanhasLrParam()
     Returns whether the the lr parameter is set.
public  booleanisSecure()
     Returns true if this SipURI is secure i.e.
public  voidremovePort()
     Removes the port part of this SipURI.
public  voidsetHeader(String name, String value)
     Sets the value of the specified header fields to be included in a request constructed from the URI.
public  voidsetHost(String host)
     Set the host part of this SipURI to the newly supplied host parameter.
public  voidsetLrParam()
     Sets the value of the lr parameter of this SipURI.
public  voidsetMAddrParam(String mAddr)
     Sets the value of the maddr parameter of this SipURI.
public  voidsetMethodParam(String method)
     Sets the value of the method parameter.
public  voidsetPort(int port)
     Set the port part of this SipURI to the newly supplied port parameter.
public  voidsetSecure(boolean secure)
     Sets the scheme of this URI to sip or sips depending on whether the argument is true or false.
public  voidsetTTLParam(int ttl)
     Sets the value of the ttl parameter.
public  voidsetTransportParam(String transport)
     Sets the value of the "transport" parameter.
public  voidsetUser(String user)
     Sets the user of SipURI.
public  voidsetUserParam(String userParam)
     Sets the value of the user parameter.
public  voidsetUserPassword(String userPassword)
     Sets the user password associated with the user of SipURI.
public  StringtoString()
     This method returns the URI as a string.



Method Detail
getHeader
public String getHeader(String name)(Code)
Returns the value of the named header, or null if it is not set. SIP/SIPS URIs may specify headers. As an example, the URI sip:jimmy@jcp.org?priority=urgent has a header "priority" whose value is "urgent".
Parameters:
  name - name of header to retrieve the value of specified header



getHeaderNames
public Iterator getHeaderNames()(Code)
Returns an Iterator over the String names of all headers present in this SipURI. an Iterator over all the header names



getHost
public String getHost()(Code)
Returns the host part of this SipURI. the host part of this SipURI



getMAddrParam
public String getMAddrParam()(Code)
Returns the value of the maddr parameter, or null if this is not set. This is equivalent to getParameter("maddr"). the value of the maddr parameter



getMethodParam
public String getMethodParam()(Code)
Returns the value of the method parameter, or null if this is not set. This is equivalent to getParameter("method"). the value of the method parameter



getPort
public int getPort()(Code)
Returns the port part of this SipURI. the port part of this SipURI



getTTLParam
public int getTTLParam()(Code)
Returns the value of the "ttl" parameter, or -1 if this is not set. This method is equivalent to getParameter("ttl"). the value of the ttl parameter



getTransportParam
public String getTransportParam()(Code)
Returns the value of the "transport" parameter, or null if this is not set. This is equivalent to getParameter("transport"). the transport paramter of the SipURI



getUser
public String getUser()(Code)
Returns the user part of this SipURI. the user part of this SipURI, this value may be null.



getUserParam
public String getUserParam()(Code)
Returns the value of the userParam, or null if this is not set.

This is equivalent to getParameter("user"). the value of the userParam of the SipURI




getUserPassword
public String getUserPassword()(Code)
Gets user password of SipURI, or null if it is not set. the user password of this SipURI



hasLrParam
public boolean hasLrParam()(Code)
Returns whether the the lr parameter is set. This is equivalent to hasParameter("lr"). This interface has no getLrParam as RFC3261 does not specify any values for the "lr" paramater. true if the "lr" parameter is set, false otherwise.



isSecure
public boolean isSecure()(Code)
Returns true if this SipURI is secure i.e. if this SipURI represents a sips URI. A sip URI returns false. true if this SipURI represents a sips URI, andfalse if it represents a sip URI.



removePort
public void removePort()(Code)
Removes the port part of this SipURI. If no port is specified the stack will assume the default port.



setHeader
public void setHeader(String name, String value) throws ParseException(Code)
Sets the value of the specified header fields to be included in a request constructed from the URI. If the header already had a value it will be overwritten.
Parameters:
  name - - a String specifying the header name
Parameters:
  value - - a String specifying the header value
throws:
  ParseException - which signals that an error has been reachedunexpectedly while parsing the name or value parameters.



setHost
public void setHost(String host) throws ParseException(Code)
Set the host part of this SipURI to the newly supplied host parameter.
Parameters:
  host - - the new interger value of the host of this SipURI
throws:
  ParseException - which signals that an error has been reachedunexpectedly while parsing the host value.



setLrParam
public void setLrParam()(Code)
Sets the value of the lr parameter of this SipURI. The lr parameter, when present, indicates that the element responsible for this resource implements the routing mechanisms specified in RFC 3261. This parameter will be used in the URIs proxies place in the Record-Route header field values, and may appear in the URIs in a pre-existing route set.



setMAddrParam
public void setMAddrParam(String mAddr) throws ParseException(Code)
Sets the value of the maddr parameter of this SipURI. The maddr parameter indicates the server address to be contacted for this user, overriding any address derived from the host field. This is equivalent to setParameter("maddr", maddr).
Parameters:
  mAddr - new value of the maddr parameter
throws:
  ParseException - which signals that an error has been reachedunexpectedly while parsing the mAddr value.



setMethodParam
public void setMethodParam(String method) throws ParseException(Code)
Sets the value of the method parameter. This specifies which SIP method to use in requests directed at this URI. This is equivalent to setParameter("method", method).
Parameters:
  method - - new value String value of the method parameter
throws:
  ParseException - which signals that an error has been reachedunexpectedly while parsing the method value.



setPort
public void setPort(int port)(Code)
Set the port part of this SipURI to the newly supplied port parameter.
Parameters:
  port - - the new interger value of the port of this SipURI



setSecure
public void setSecure(boolean secure)(Code)
Sets the scheme of this URI to sip or sips depending on whether the argument is true or false. The default value is false.
Parameters:
  secure - - the boolean value indicating if the SipURI is secure.



setTTLParam
public void setTTLParam(int ttl) throws InvalidArgumentException(Code)
Sets the value of the ttl parameter. The ttl parameter specifies the time-to-live value when packets are sent using UDP multicast. This is equivalent to setParameter("ttl", ttl).
Parameters:
  ttl - - new value of the ttl parameter
throws:
  InvalidArgumentException - if supplied value is less than zero, excluding -1 the default not set value.



setTransportParam
public void setTransportParam(String transport) throws ParseException(Code)
Sets the value of the "transport" parameter. This parameter specifies which transport protocol to use for sending requests and responses to this entity. The following values are defined: "udp", "tcp", "sctp", "tls", but other values may be used also. This method is equivalent to setParameter("transport", transport). Transport parameter constants are defined in the javax.sip.ListeningPoint .
Parameters:
  transport - - new value for the "transport" parameter
throws:
  ParseException - which signals that an error has been reachedunexpectedly while parsing the transport value.



setUser
public void setUser(String user) throws ParseException(Code)
Sets the user of SipURI. The identifier of a particular resource at the host being addressed. The user and the user password including the '@' sign make up the user-info.
Parameters:
  user - - the new String value of the user.
throws:
  ParseException - which signals that an error has been reachedunexpectedly while parsing the user value.



setUserParam
public void setUserParam(String userParam) throws ParseException(Code)
Sets the value of the user parameter. The user URI parameter exists to distinguish telephone numbers from user names that happen to look like telephone numbers. This is equivalent to setParameter("user", user).
Parameters:
  userParam - - new value String value of the method parameter
throws:
  ParseException - which signals that an error has been reachedunexpectedly while parsing the userParam value.



setUserPassword
public void setUserPassword(String userPassword) throws ParseException(Code)
Sets the user password associated with the user of SipURI. While the SIP and SIPS URI syntax allows this field to be present, its use is NOT RECOMMENDED, because the passing of authentication information in clear text (such as URIs) has proven to be a security risk in almost every case where it has been used. The user password and the user including the @ sign make up the user-info.
Parameters:
  userPassword - - the new String value of the user password
throws:
  ParseException - which signals that an error has been reachedunexpectedly while parsing the userPassword value.



toString
public String toString()(Code)
This method returns the URI as a string. the stringified version of the URI



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