public interface SipURI extends URI
Modifier and Type | Interface and Description |
---|---|
static class |
SipURI.Builder |
Modifier and Type | Method and Description |
---|---|
static SipURI.Builder |
builder() |
SipURI |
clone() |
SipURI.Builder |
copy()
All URIs are immutable so if you wish to change it you need to
obtain a copy of it which will return a new builder that allows
you to change and build a new URI.
|
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:
|
static SipURI |
frame(String 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
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.
|
Buffer |
toBuffer()
|
default SipURI |
toSipURI() |
static SipURI.Builder |
with() |
static SipURI.Builder |
withHost(Buffer host) |
static SipURI.Builder |
withHost(String host) |
static SipURI.Builder |
withParameters(Buffer params) |
static SipURI.Builder |
withTemplate(SipURI uri)
Create a new
SipURI.Builder based on the SipURI . |
static SipURI.Builder |
withUser(Buffer user) |
static SipURI.Builder |
withUser(String user)
Create a new builder based where the user portion has been specified.
|
Buffer getUser()
Buffer getHost()
int getPort()
boolean isSecure()
Buffer getTransportParam() throws SipParseException
#getParameter("transport")
SipParseException
Buffer getUserParam() throws SipParseException
#getParameter("user")
SipParseException
int getTTLParam() throws SipParseException
#getParameter("ttl")
SipParseException
Buffer getMAddrParam() throws SipParseException
#getParameter("maddr")
SipParseException
Buffer getMethodParam() throws SipParseException
#getParameter("method")
SipParseException
Buffer 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.boolean equals(Object o)
Buffer toBuffer()
SipURI.Builder copy()
URI
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 URI
buffer
- SipParseException
IOException
IndexOutOfBoundsException
static SipURI frame(String buffer) throws SipParseException, IndexOutOfBoundsException, IOException
static SipURI.Builder with()
static SipURI.Builder builder()
static SipURI.Builder withUser(String user)
user
- static SipURI.Builder withUser(Buffer user)
static SipURI.Builder withHost(String host)
static SipURI.Builder withParameters(Buffer params)
static SipURI.Builder withHost(Buffer host)
static SipURI.Builder withTemplate(SipURI uri)
SipURI.Builder
based on the SipURI
.
uri
- Copyright © 2015. All Rights Reserved.