public interface SipURI extends URI
| Modifier and Type | Interface and Description |
|---|---|
static class |
SipURI.Builder |
| Modifier and Type | Method and Description |
|---|---|
SipURI |
clone() |
boolean |
equals(Object o)
See rules for comparing URI's in RFC3261 section 19.1.4.
|
static SipURI |
frame(Buffer buffer)
Frame a sip or sips-uri, which according to RFC3261 is:
|
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
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.
|
boolean |
isSecure()
Check whether this is a 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()
|
static SipURI.Builder |
with() |
static SipURI.Builder |
with(SipURI uri)
Create a new
SipURI.Builder based on the SipURI. |
Buffer getUser()
Buffer getHost()
int getPort()
void setPort(int port)
port - boolean isSecure()
Buffer getTransportParam() throws SipParseException
#getParameter("transport")SipParseExceptionBuffer getUserParam() throws SipParseException
#getParameter("user")SipParseExceptionint getTTLParam()
throws SipParseException
#getParameter("ttl")SipParseExceptionBuffer getMAddrParam() throws SipParseException
#getParameter("maddr")SipParseExceptionBuffer getMethodParam() throws SipParseException
#getParameter("method")SipParseExceptionBuffer getParameter(Buffer name) throws SipParseException, IllegalArgumentException
Buffer, 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.name - 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.Buffer getParameter(String name) throws SipParseException, IllegalArgumentException
getParameter(Buffer).name - SipParseException - in case anything goes wrong while extracting the parameter.IllegalArgumentException - in case the name is null.void setParameter(Buffer name, Buffer value) throws SipParseException, IllegalArgumentException
name - 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.void setParameter(String name, String value) throws SipParseException, IllegalArgumentException
name - value - SipParseExceptionIllegalArgumentExceptionvoid setParameter(Buffer name, int value) throws SipParseException, IllegalArgumentException
name - value - SipParseExceptionIllegalArgumentExceptionvoid setParameter(String name, int value) throws SipParseException, IllegalArgumentException
name - value - SipParseExceptionIllegalArgumentExceptionboolean equals(Object o)
Buffer toBuffer()
static SipURI frame(Buffer buffer) throws SipParseException, IndexOutOfBoundsException, IOException
SIP-URI = "sip:" [ userinfo ] hostport
uri-parameters [ headers ]
SIPS-URI = "sips:" [ userinfo ] hostport
uri-parameters [ headers ]
Remember though that all these frame-functions will only do a basic
verification that all things are ok so just because this function return
without an exception doesn't mean that you actually framed a valid URI.
Everything is done lazily so things may blow up later.
Also note that this function assumes that someone else has already determined the boundaries for this
sip(s)-uri and as such, this function does not expect '<' etc.frame in interface URIbuffer - SipParseExceptionIOExceptionIndexOutOfBoundsExceptionstatic SipURI.Builder with()
static SipURI.Builder with(SipURI uri)
SipURI.Builder based on the SipURI.
uri - Copyright © 2017. All Rights Reserved.