|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents SIP contact addresses. The value of the SIP Contact header
is represented as a List
of Contact
objects.
The SIP Contact header specifies one or more locations (URIs) where a
user is reachable. and consists of an optional display name along with
a URI
and a set of parameters.
Contacts in SIP serve two purposes:
setContacts
or the generic
setHeader
and
addHeader
on
SipServletMessage
.
The SIP specification specifies the meaning of two Contact parameters:
The Contact
interface extends Comparable
so that a list of Contact
s
can easily be sorted using the sorting algorithms of
java.util.Collections
.
Implementations of Comparable.compareTo(java.lang.Object)
are required to return values
consistent with getQ()
, that is
x.getQ() < y.getQ() <=> x.compareTo(y) < 0, and x.getQ() == y.getQ() <=> x.compareTo(y) == 0
SipServletMessage.getContacts()
Method Summary | |
int |
getExpires()
Returns the value of the "expires" parameter as delta-seconds. |
float |
getQ()
Returns the value of the "q" parameter of this Contact . |
boolean |
isWildcard()
Checks whether this Contact represents the "wildcard"
contact address. |
void |
setExpires(int seconds)
Sets the value of the "expires" parameter. |
void |
setQ(float q)
Sets this Contact s qvalue. |
java.lang.String |
toString()
Returns the value of this Contact as a
String . |
Methods inherited from interface javax.servlet.sip.SipAddress |
clone, getDisplayName, getParameter, getParameterNames, getURI, removeParameter, setDisplayName, setParameter, setURI |
Methods inherited from interface java.lang.Comparable |
compareTo |
Method Detail |
public boolean isWildcard()
Contact
represents the "wildcard"
contact address. This is the case if it represents a Contact header
whose value was "*". Likewise,
SipFactory.createContact("*")
always returns a wildcard Contact
instance.Contact
represents the "wildcard"
contact address, and false otherwisepublic float getQ()
Contact
.
The "qvalue" indicates the relative preference amongst a set of
locations. "qvalue" values are decimal numbers from 0 to 1, with
higher values indicating higher preference.Contact
s qvalue or -1.0 if this is not setpublic void setQ(float q)
Contact
s qvalue.q
- new qvalue for this Contact
or -1 to remove
the qvaluejava.lang.IllegalArgumentException
- if the new qvalue isn't between
0.0 and 1.0 (inclusive) and isn't -1.0.public int getExpires()
public void setExpires(int seconds)
seconds
- new relative value of the "expires" parameterpublic java.lang.String toString()
Contact
as a
String
. This must be a valid value of a SIP Contact
header.toString
in interface SipAddress
toString
in class java.lang.Object
String
representation of this
Contact
header
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |