|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Address
Represents SIP addresses as found, for example, in From, To, and Contact headers. Applications use addresses when sending requests as a user agent client (UAC) and when redirecting an incoming request.
Addresses appear in a number of SIP headers and generally adhere to the grammar (constituent non-terminals are defined in the SIP specification, RFC 3261):
(name-addr / addr-spec) *(SEMI generic-param)
that is to say, Addresses consist of a URI, an optional display name, and a set of name-value parameters.
The Address
interface is used to represent the value of all headers defined to contain one or more addresses as defined above. Apart from From, To, and Contact, this includes Route, Record-Route, Reply-To, Alert-Info, Call-Info, Error-Info, as well as extension headers like P-Asserted-Identity, P-Preferred-Identity, and Path.
Address
objects can be constructed using one of the SipFactory.createAddress
methods and can be obtained from messages using SipServletMessage.getAddressHeader(java.lang.String)
and SipServletMessage.getAddressHeaders(java.lang.String)
.
Method Summary | |
---|---|
java.lang.Object |
clone() Returns a clone of this Address . |
boolean |
equals(java.lang.Object o) Compares the given Address with this one. |
java.lang.String |
getDisplayName() Returns the display name of this Address . |
int |
getExpires() Returns the value of the "expires" parameter as delta-seconds. |
float |
getQ() Returns the value of the "q" parameter of this Address . |
URI |
getURI() Returns the URI component of this Address . |
boolean |
isWildcard() Returns true if this Address represents the "wildcard" contact address. |
void |
setDisplayName(java.lang.String name) Sets the display name of this Address . |
void |
setExpires(int seconds) Sets the value of the "expires" parameter. |
void |
setQ(float q) Sets this Address s qvalue. |
void |
setURI(URI uri) Sets the URI of this Address . |
java.lang.String |
toString() Returns the value of this address as a String . |
Methods inherited from interface javax.servlet.sip.Parameterable |
---|
getParameter, getParameterNames, getParameters, getValue, removeParameter, setParameter, setValue |
Method Detail |
---|
java.lang.String getDisplayName()
Address
. This is typically a caller or callees real name and may be rendered by a user agent, for example when alerting.Address
, or null if one doesn't existvoid setDisplayName(java.lang.String name)
Address
.name
- display namejava.lang.IllegalStateException
- if this Address
is used in a context where it cannot be modifiedURI getURI()
URI
component of this Address
. This method will return null
for wildcard addresses (see isWildcard()
. For non-wildcard addresses the result will always be non-null.URI
of this Address
void setURI(URI uri)
Address
.uri
- new URI
of this Address
java.lang.IllegalStateException
- if this Address
is used in a context where it cannot be modifiedjava.lang.NullPointerException
- on null uri
.boolean isWildcard()
Address
represents the "wildcard" contact address. This is the case if it represents a Contact header whose string value is "*". Likewise, SipFactory.createAddress("*")
always returns a wildcard Address
instance.Address
represents the "wildcard" contact address, and false otherwisefloat getQ()
Address
. 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.Address
' qvalue or -1.0 if this is not setvoid setQ(float q)
Address
s qvalue.q
- new qvalue for this Address
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.int getExpires()
void setExpires(int seconds)
seconds
- new relative value of the "expires" parameter. A negative value causes the "expires" parameter to be removed.java.lang.String toString()
String
. The resulting string must be a valid value of a SIP From or To header.toString
in class java.lang.Object
Address
as a String
java.lang.Object clone()
Address
. The cloned Address
has identical display name, URI, and parameters, except that it has no tag parameter. This means the cloned address can be used as an argument to SipFactory.createRequest
.clone
in interface Parameterable
Address
boolean equals(java.lang.Object o)
As Addresses consist of a URI, an optional display name, and an optional set of name-value parameters, the following rules should be used for comparing them:
equals
in interface Parameterable
equals
in class java.lang.Object
o
- given Parameterable to be compared with this.true
if the two Addresses are equal.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1996, 2010, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Java SIP Servlet API 1.1 Reference
Part Number E17883-01