|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.microedition.sip.SipAddress
SipAddress provides a generic SIP address parser. This class can be used to parse either full SIP name addresses like: BigGuy <sip:[email protected]> or SIP/SIPS URIs like: sip:[email protected];user=phone or sips:[email protected];transport=tcp.
Correspondingly, valid SIP addresses can be constructed with this class.
SipAddress has following functional requirements:
- SipAddress does not escape address strings.
- SipAddress ignores headers part of SIP URI.
- SipAddress valid scheme format is the same as defined in SIP BNF
for absolute URI.
- The valid Contact address "*"
is accepted in SipAddress.
In this case all properties will be null and port number is 0.
Yet toString()
method will return the value "*"
.
Reference, SIP 3261 [1] p.153 Example SIP and SIPS URIs and p.228 name-addr in SIP BNF specification.
Constructor Summary | |
SipAddress(java.lang.String address)
Construct a new SipAddress from string. |
|
SipAddress(java.lang.String displayName,
java.lang.String URI)
Construct a new SipAddress from display name and URI. |
Method Summary | |
java.lang.String |
getDisplayName()
Returns the display name of SIP address. |
java.lang.String |
getHost()
Returns the host part of the SIP address. |
java.lang.String |
getParameter(java.lang.String name)
Returns the value associated with the named URI parameter. |
java.lang.String[] |
getParameterNames()
Returns a String array of all parameter names. |
int |
getPort()
Returns the port number of the SIP address. |
java.lang.String |
getScheme()
Returns the scheme of SIP address. |
java.lang.String |
getURI()
Returns the URI part of the address (without parameters) i.e. |
java.lang.String |
getUser()
Returns the user part of SIP address. |
void |
removeParameter(java.lang.String name)
Removes the named URI parameter. |
void |
setDisplayName(java.lang.String name)
Sets the display name. |
void |
setHost(java.lang.String host)
Sets the host part of the SIP address. |
void |
setParameter(java.lang.String name,
java.lang.String value)
Sets the named URI parameter to the specified value. |
void |
setPort(int port)
Sets the port number of the SIP address. |
void |
setScheme(java.lang.String scheme)
Sets the scheme of SIP address. |
void |
setURI(java.lang.String URI)
Sets the URI part of the SIP address (without parameters) i.e. |
void |
setUser(java.lang.String user)
Sets the user part of SIP address. |
java.lang.String |
toString()
Returns a fully qualified SIP address, with display name, URI and URI parameters. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public SipAddress(java.lang.String address) throws java.lang.IllegalArgumentException
Display Name <sip:user:password@host:port;uri-parameters>
or plain SIP URI:
sip:user:password@host:port;uri-parameters
address
- SIP address as String
java.lang.IllegalArgumentException
- if there
was an error in parsing the address.public SipAddress(java.lang.String displayName, java.lang.String URI) throws java.lang.IllegalArgumentException
displayName
- user display nameURI
- SIP URI
java.lang.IllegalArgumentException
- if there was an error in parsing the arguments.Method Detail |
public java.lang.String getDisplayName()
public void setDisplayName(java.lang.String name) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the display name is invalidpublic java.lang.String getScheme()
public void setScheme(java.lang.String scheme) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the scheme is invalidpublic java.lang.String getUser()
public void setUser(java.lang.String user) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the user part is invalidpublic java.lang.String getURI()
public void setURI(java.lang.String URI) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the URI is invalidpublic java.lang.String getHost()
public void setHost(java.lang.String host) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the host is invalidpublic int getPort()
public void setPort(int port) throws java.lang.IllegalArgumentException
port
- port number, valid range 0-65535, 0 means that port number is removed from the address URI
java.lang.IllegalArgumentException
- if the port number is invalidpublic java.lang.String getParameter(java.lang.String name)
name
- the name of the parameter
public void setParameter(java.lang.String name, java.lang.String value) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if the parameter is invalid RFC 3261, chapter 19.1.1 SIP and SIPS URI Components "URI parameters" p.149public void removeParameter(java.lang.String name)
public java.lang.String[] getParameterNames()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |