public interface Address extends Parameterable
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 and
SipServletMessage.getAddressHeaders(java.lang.String)}.
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Returns a clone of this Address.
|
boolean |
equals(Object o)
Compares the given Address with this one.
|
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(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 Addresss qvalue.
|
void |
setURI(URI uri)
Sets the URI of this Address.
|
String |
toString()
Returns the value of this address as a String.
|
getParameter, getParameterNames, getParameters, getValue, removeParameter, setParameter, setValueObject clone()
clone in interface Parameterableboolean equals(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 Parameterableequals in class Objecto - given Parameterable to be compared with this.String getDisplayName()
int getExpires()
float getQ()
URI getURI()
boolean isWildcard()
void setDisplayName(String name)
name - display nameIllegalStateException - if this Address is used in a context where it cannot be modifiedvoid setExpires(int seconds)
seconds - new relative value of the "expires" parameter. A negative value causes the "expires" parameter to be removed.void setQ(float q)
q - new qvalue for this Address or -1 to remove the qvalueIllegalArgumentException - if the new qvalue isn't between 0.0 and 1.0 (inclusive) and isn't -1.0.void setURI(URI uri)
uri - new URI of this AddressIllegalStateException - if this Address is used in a context where it cannot be modifiedNullPointerException - on null uri.Copyright © 2016. All rights reserved.