SipURI.Builder| Constructor and Description |
|---|
SipURIImpl(boolean isSips,
Buffer userInfo,
Buffer host,
Buffer port,
Buffer paramsHeaders,
Buffer original) |
| Modifier and Type | Method and Description |
|---|---|
SipURI |
clone() |
boolean |
equals(Object other)
Comparing two
SipURIs aren't trivial and the full set of rules are described in
RFC3261 section 19.1.4
See rules for comparing URI's in RFC3261 section 19.1.4. |
void |
getBytes(Buffer dst)
Write the bytes of this URI into the destination buffer
|
Buffer |
getHost()
Get the host portion of this URI.
|
Buffer |
getMAddrParam()
Get the maddr parameter.
|
Buffer |
getMethodParam()
Get the method parameter.
|
Buffer |
getParameter(Buffer name)
Get the value of the named parameter.
|
Buffer |
getParameter(String name)
Same as
SipURI.getParameter(Buffer). |
int |
getPort()
Get the port.
|
Buffer |
getTransportParam()
Same as
#getParameter("transport") |
int |
getTTLParam()
Get the ttl parameter.
|
Buffer |
getUser()
Get the user portion of this URI.
|
Buffer |
getUserParam()
Get the user parameter.
|
int |
hashCode()
Now, the hash-code doesn't actually have to be unique for every little parameter and detail
as the
equals(Object) method is checking, we just need to take enough stuff into
account to have a good enough spread and then the equals-method would be used to sort out any
ties. |
boolean |
isSecure()
Check whether this is a sips URI.
|
boolean |
isSipURI()
Check whether this
URI is a "sip" or "sips" URI. |
void |
setParameter(Buffer name,
Buffer value)
Sets the value of the specified parameter.
|
void |
setParameter(Buffer name,
int value) |
void |
setParameter(String name,
int value) |
void |
setParameter(String name,
String value) |
void |
setPort(int port)
Set the port.
|
Buffer |
toBuffer()
|
String |
toString() |
public SipURIImpl(boolean isSips,
Buffer userInfo,
Buffer host,
Buffer port,
Buffer paramsHeaders,
Buffer original)
isSips - whether this is a sip or sips URLuserInfo - contains the so-called "userinfo" portion. Typically this is
just the user but can optionally contain a password as well.
See SipParser.consumeUserInfoHostPort(Buffer) for more
information.hostPort - contains the so-called "hostport", which is the domain +
optional port.paramsHeaders - any uri-parameters or headers that were on the SIP uri will be
in this buffer. If empty or null then there were none.original - the original buffer just because as long as no one is changing
the content we can just return this buffer fast and easy.public boolean isSipURI()
URI is a "sip" or "sips" URI.public boolean isSecure()
public void getBytes(Buffer dst)
URIpublic SipURI clone()
public Buffer getUser()
public Buffer getHost()
public int getPort()
public void setPort(int port)
SipURIpublic Buffer getTransportParam() throws SipParseException
SipURI#getParameter("transport")getTransportParam in interface SipURISipParseExceptionpublic Buffer getUserParam() throws SipParseException
SipURI#getParameter("user")getUserParam in interface SipURISipParseExceptionpublic int getTTLParam()
throws SipParseException
SipURI#getParameter("ttl")getTTLParam in interface SipURISipParseExceptionpublic Buffer getMAddrParam() throws SipParseException
SipURI#getParameter("maddr")getMAddrParam in interface SipURISipParseExceptionpublic Buffer getMethodParam() throws SipParseException
SipURI#getParameter("method")getMethodParam in interface SipURISipParseExceptionpublic boolean equals(Object other)
SipURIs aren't trivial and the full set of rules are described in
RFC3261 section 19.1.4
See rules for comparing URI's in RFC3261 section 19.1.4.public int hashCode()
equals(Object) method is checking, we just need to take enough stuff into
account to have a good enough spread and then the equals-method would be used to sort out any
ties.
public Buffer getParameter(Buffer name) throws SipParseException, IllegalArgumentException
SipURIBuffer, which can be checked with
Buffer.isEmpty() or Buffer.capacity(), which will return zero. As with any
empty Buffer, if you do Buffer.toString() you will be getting an empty
String back, which would be yet another way to check for a flag parameter.getParameter in interface SipURIname - the name of the parameter we are looking for.SipParseException - in case anything goes wrong while extracting the parameter.IllegalArgumentException - in case the name is null.public Buffer getParameter(String name) throws SipParseException, IllegalArgumentException
SipURISipURI.getParameter(Buffer).getParameter in interface SipURISipParseException - in case anything goes wrong while extracting the parameter.IllegalArgumentException - in case the name is null.public void setParameter(Buffer name, Buffer value) throws SipParseException, IllegalArgumentException
SipURIsetParameter in interface SipURIname - the name of the parametervalue - the value of the parameter or null if you just want to set a flag parameterSipParseException - in case anything goes wrong when setting the parameter.IllegalArgumentException - in case the name is null or empty.public void setParameter(String name, String value) throws SipParseException, IllegalArgumentException
setParameter in interface SipURISipParseExceptionIllegalArgumentExceptionpublic void setParameter(Buffer name, int value) throws SipParseException, IllegalArgumentException
setParameter in interface SipURISipParseExceptionIllegalArgumentExceptionpublic void setParameter(String name, int value) throws SipParseException, IllegalArgumentException
setParameter in interface SipURISipParseExceptionIllegalArgumentExceptionCopyright © 2017. All Rights Reserved.