|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SipURI
Represents sip
and sips
URIs.
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).
Syntactically, SIP and SIPS URIs are identical except for the name of URI scheme. The semantics differs in that the SIPS scheme implies that the identified resource is to be contacted using TLS. The following quote is from RFC 3261:
"A SIPS URI specifies that the resource be contacted securely. This means, in particular, that TLS is to be used between the UAC and the domain that owns the URI. From there, secure communications are used to reach the user, where the specific security mechanism depends on the policy of the domain. Any resource described by a SIP URI can be "upgraded" to a SIPS URI by just changing the scheme, if it is desired to communicate with that resource securely."
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 string form of SIP and SIPS URIs may contain escaped characters. The SIP servlet container is responsible for unescaping those characters before presenting URIs to servlets. Likewise, string values passed to setters for various SIP(S) URI components may contain reserved or excluded characters that need escaping before being used. The container is responsible for escaping those values.
Address
,
SipFactory.createSipURI(java.lang.String, java.lang.String)
,
SipServletRequest.getRequestURI()
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Compares the given SipURI with this SipURI. |
java.lang.String |
getHeader(java.lang.String name)
Returns the value of the specified header. |
java.util.Iterator<java.lang.String> |
getHeaderNames()
Returns an Iterator over the names of all headers
present in this SipURI . |
java.lang.String |
getHost()
Returns the host part of this SipURI . |
boolean |
getLrParam()
Returns true if the "lr" flag parameter is set, and false otherwise. |
java.lang.String |
getMAddrParam()
Returns the value of the "maddr" parameter, or null if this is not set. |
java.lang.String |
getMethodParam()
Returns the value of the "method" parameter, or null if this is not set. |
int |
getPort()
Returns the port number of this SipURI ,
or -1 if this is not set. |
java.lang.String |
getTransportParam()
Returns the value of the "transport" parameter, or null if this is not set. |
int |
getTTLParam()
Returns the value of the "ttl" parameter, or -1 if this is not set. |
java.lang.String |
getUser()
Returns the user part of this SipURI . |
java.lang.String |
getUserParam()
Returns the value of the "user" parameter, or null if this is not set. |
java.lang.String |
getUserPassword()
Returns the password of this SipURI ,
or null if this is not set. |
boolean |
isSecure()
Returns true if this SipURI is secure, that is,
if this it represents a sips URI. |
void |
removeHeader(java.lang.String name)
Removes the named header from this SipURI . |
void |
setHeader(java.lang.String name,
java.lang.String value)
Sets the value of the specified header in this SipURI . |
void |
setHost(java.lang.String host)
Sets the host part of this SipURI . |
void |
setLrParam(boolean flag)
Sets or removes the "lr" parameter depending on the value of the flag. |
void |
setMAddrParam(java.lang.String maddr)
Sets the value of the "maddr" parameter. |
void |
setMethodParam(java.lang.String method)
Sets the value of the "method" parameter. |
void |
setPort(int port)
Sets the port number of this SipURI . |
void |
setSecure(boolean b)
Sets the scheme of this URI to sip or sips
depending on whether the argument is true or not. |
void |
setTransportParam(java.lang.String transport)
Sets the value of the "transport" parameter. |
void |
setTTLParam(int ttl)
Sets the value of the "ttl" parameter. |
void |
setUser(java.lang.String user)
Sets the user part of this SipURI . |
void |
setUserParam(java.lang.String user)
Sets the value of the "user" parameter. |
void |
setUserPassword(java.lang.String password)
Sets the password of this SipURI . |
java.lang.String |
toString()
Returns the String representation of this
SipURI . |
Methods inherited from interface javax.servlet.sip.URI |
---|
clone, getParameter, getParameterNames, getScheme, isSipURI, removeParameter, setParameter |
Method Detail |
---|
java.lang.String getUser()
SipURI
.
SipURI
void setUser(java.lang.String user)
SipURI
.
user
- the new user partjava.lang.String getUserPassword()
SipURI
,
or null if this is not set.
SipURI
void setUserPassword(java.lang.String password)
SipURI
. The use of passwords
in SIP or SIPS URIs is discouraged as sending passwords in clear text
is a security risk.
password
- the new passwordjava.lang.String getHost()
SipURI
.
SipURI
void setHost(java.lang.String host)
SipURI
. This should be a fully
qualified domain name or a numeric IP address.
host
- the new host nameint getPort()
SipURI
,
or -1 if this is not set.
SipURI
void setPort(int port)
SipURI
.
port
- the new port number. A negative value means the
port number is not set and a subsequent call to
getPort() should return -1.boolean isSecure()
SipURI
is secure, that is,
if this it represents a sips
URI. For "ordinary"
sip
URIs, false is returned.
SipURI
represents a sips
URI, and false if it represents a sip
URIvoid setSecure(boolean b)
sip
or sips
depending on whether the argument is true or not.
b
- determines whether the scheme of this SipURI
is set to sip
or sips
java.lang.String getTransportParam()
getParameter("transport")
.
void setTransportParam(java.lang.String transport)
This method is equivalent to
setParameter("transport", transport)
.
transport
- new value for the "transport" parameterjava.lang.String getMAddrParam()
getParameter("maddr")
.
void setMAddrParam(java.lang.String maddr)
setParameter("maddr", maddr)
.
maddr
- new value of the "maddr" parameterjava.lang.String getMethodParam()
getParameter("method")
.
void setMethodParam(java.lang.String method)
This method is equivalent to
setParameter("method", method)
.
method
- new value of the "method" parameterint getTTLParam()
getParameter("ttl")
.
void setTTLParam(int ttl)
This is equivalent to setParameter("ttl", ttl)
.
ttl
- new value of the "ttl" parameterjava.lang.String getUserParam()
getParameter("user")
.
void setUserParam(java.lang.String user)
setParameter("user", user)
.
user
- new value for the "user" parameterboolean getLrParam()
"".equals(getParameter("lr"))
.
void setLrParam(boolean flag)
flag
- specifies that the "lr" flag parameter is to be set (true)
or removed (false)java.lang.String getHeader(java.lang.String name)
sip:joe@example.com?Priority=emergency
has a header
"Priority" whose value is "emergency".
name
- the header name
SipURI
java.lang.NullPointerException
- if the name
is null.void setHeader(java.lang.String name, java.lang.String value)
SipURI
.
name
- header namevalue
- header valuevoid removeHeader(java.lang.String name)
SipURI
. Nothing is
done if the SipURI
did not already contain the
specific header.
name
- header namejava.util.Iterator<java.lang.String> getHeaderNames()
Iterator
over the names of all headers
present in this SipURI
.
Iterator
over all header namesjava.lang.String toString()
String
representation of this
SipURI
. Any reserved characters will be properly escaped
according to RFC2396.
toString
in interface URI
toString
in class java.lang.Object
sip
or sips
URI as a
String
boolean equals(java.lang.Object o)
equals
in interface URI
equals
in class java.lang.Object
o
- the URI which is to be compared with this.
true
if the two SipURIs are equal.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |