public class SipUri extends GenericURI implements SipURI, SipURIExt
Modifier and Type | Field and Description |
---|---|
protected Authority |
authority
Authority for the uri.
|
protected NameValueList |
qheaders
qheaders list
|
protected TelephoneNumber |
telephoneSubscriber
telephoneSubscriber field
|
protected NameValueList |
uriParms
uriParms list
|
ISUB, PHONE_CONTEXT_TAG, POSTDIAL, PROVIDER_TAG, scheme, SIP, SIPS, TEL, uriString
CORE_PACKAGE, GRUU, LR, MADDR, METHOD, NET_PACKAGE, PARSER_PACKAGE, PHONE, TCP, TLS, TRANSPORT, TTL, UDP, USER
AND, AT, COLON, COMMA, DOT, DOUBLE_QUOTE, EQUALS, GREATER_THAN, HT, immutableClasses, indentation, LESS_THAN, LPAREN, matchExpression, NEWLINE, PERCENT, POUND, QUESTION, QUOTE, RETURN, RPAREN, SEMICOLON, SLASH, SP, STAR, stringRepresentation
Constructor and Description |
---|
SipUri() |
Modifier and Type | Method and Description |
---|---|
void |
clearPassword()
Clear the password from the user part if it exists.
|
void |
clearQheaders()
Clear all Qheaders.
|
void |
clearUriParms()
clear all URI Parameters.
|
Object |
clone()
clone this.
|
String |
encode()
Construct a URL from the parsed structure.
|
StringBuilder |
encode(StringBuilder buffer)
Put the encoded version of this object in the given StringBuilder.
|
boolean |
equals(Object that)
Compare two URIs and return true if they are equal.
|
Authority |
getAuthority()
Get the authority.
|
String |
getGrParam()
Sets the
gr parameter. |
String |
getHeader(String name)
Returns the value of the named header, or null if it is not set.
|
Iterator<String> |
getHeaderNames()
Returns an Iterator over the names (Strings) of all headers present
in this SipURI.
|
String |
getHost()
Get the host protion of the URI.
|
HostPort |
getHostPort()
Get the host and port of the server.
|
String |
getLrParam()
Returns the value of the
lr parameter, or null if this
is not set. |
String |
getMAddrParam()
Returns the value of the
maddr parameter, or null if this
is not set. |
String |
getMethod()
Get the method parameter.
|
String |
getMethodParam()
Returns the value of the
method parameter, or null if this
is not set. |
String |
getParameter(String name)
Returns the value of the named parameter, or null if it is not set.
|
Iterator<String> |
getParameterNames()
Returns an Iterator over the names (Strings) of all parameters present
in this ParametersHeader.
|
NameValueList |
getParameters()
Accessor for URI parameters
|
Object |
getParm(String parmname)
get the parameter (do a name lookup) and return null if none exists.
|
int |
getPort()
Get the port from the authority field.
|
NameValueList |
getQheaders()
Accessor forSIPObjects
|
String |
getScheme()
Get the scheme.
|
TelephoneNumber |
getTelephoneSubscriber()
Returns the stucture corresponding to the telephone number
provided that the user is a telephone subscriber.
|
String |
getTransportParam()
Returns the value of the "transport" parameter, or null if this is not
set.
|
int |
getTTLParam()
Returns the value of the "ttl" parameter, or -1 if this is not set.
|
String |
getUser()
Returns the value of the
userParam ,
or null if this is not set. |
String |
getUserAtHost()
getUser@host
|
String |
getUserAtHostPort()
getUser@host
|
String |
getUserParam()
Returns the user part of this SipURI, or null if it is not set.
|
String |
getUserPassword()
Get the password of the user.
|
String |
getUserType()
Get the urse parameter.
|
boolean |
hasGrParam()
Returns whether the
gr parameter is set. |
boolean |
hasLrParam()
Returns whether the the
lr parameter is set. |
boolean |
hasParameter(String name)
Boolean to check if a parameter of a given name exists.
|
boolean |
hasTransport()
Return true if the transport parameter is defined.
|
boolean |
isSecure()
Returns true if this SipURI is secure i.e.
|
boolean |
isSipURI()
This method determines if this is a URI with a scheme of "sip" or "sips".
|
boolean |
isUserTelephoneSubscriber()
returns true if the user is a telephone subscriber.
|
void |
removeHeader(String name)
Remove a header given its name (provided it exists).
|
void |
removeHeaders()
Remove all headers.
|
void |
removeMAddr()
Remove the maddr param if it exists.
|
void |
removeMethod()
remove the Method.
|
void |
removeParameter(String name)
Remove a parameter given its name
|
void |
removeParameters()
Remove the URI parameters.
|
void |
removePort()
remove the port setting.
|
void |
removeTransport()
Delete the transport string.
|
void |
removeTTL()
remove the ttl value from the parameter list if it exists.
|
void |
removeUser()
Remove the user.
|
void |
removeUserType()
Set the user type.
|
void |
setAuthority(Authority authority)
Set the authority member
|
void |
setDefaultParm(String name,
Object value)
Set the default parameters for this URI.
|
void |
setGrParam(String value)
Sets the
gr parameter. |
void |
setHeader(String name,
String value)
Sets the value of the specified header fields to be included in a
request constructed from the URI.
|
void |
setHost(Host h)
Set the host for this URI.
|
void |
setHost(String host)
Set the host portion of the SipURI
|
void |
setHostPort(HostPort hostPort)
Set the hostPort field of the imbedded authority field.
|
void |
setIsdnSubAddress(String isdnSubAddress)
Sets ISDN subaddress of SipURL
|
void |
setLrParam()
Sets the value of the
lr parameter of this SipURI. |
void |
setMAddr(String mAddr)
Set the MADDR parameter .
|
void |
setMAddrParam(String maddr)
Sets the value of the
maddr parameter of this SipURI. |
void |
setMethod(String method)
Set the Method
|
void |
setMethodParam(String method)
Sets the value of the
method parameter. |
void |
setParameter(String name,
String value)
Sets the value of the specified parameter.
|
void |
setPort(int p)
set the port to a given value.
|
void |
setQHeader(NameValue nameValue)
Set the query header when provided as a name-value pair.
|
void |
setQheaders(NameValueList parms)
Set the qheaders member
|
void |
setScheme(String scheme)
Constructor given the scheme.
|
void |
setSecure(boolean secure)
Sets the scheme of this URI to sip or sips depending on whether the
argument is true or false.
|
void |
setTelephoneSubscriber(TelephoneNumber tel)
Set the telephone subscriber field.
|
void |
setTransportParam(String transport)
Sets the value of the "transport" parameter.
|
void |
setTTLParam(int ttl)
Sets the value of the
ttl parameter. |
void |
setUriParameter(NameValue nameValue)
Set the parameter as given.
|
void |
setUriParm(String name,
Object value)
Set a given URI parameter.
|
void |
setUriParms(NameValueList parms)
Set the uriParms member
|
void |
setUser(String uname)
Sets the user of SipURI.
|
void |
setUserParam(String usertype)
Sets the value of the user parameter.
|
void |
setUserPassword(String password)
Set the user password.
|
String |
toString()
Return a string representation.
|
hashCode
dbgPrint, dbgPrint, getClassFromName, getIndentation, getMatcher, isMySubclass, makeClone, merge, setMatcher, sprint, sprint, sprint, sprint, sprint, sprint, sprint, sprint, sprint
protected Authority authority
protected NameValueList uriParms
protected NameValueList qheaders
protected TelephoneNumber telephoneSubscriber
public void setScheme(String scheme)
public String getScheme()
getScheme
in interface URI
getScheme
in class GenericURI
public void clearUriParms()
public void clearPassword()
public Authority getAuthority()
public void clearQheaders()
public boolean equals(Object that)
equals
in class GenericURI
that
- the object to compare to.public String encode()
encode
in class GenericURI
public StringBuilder encode(StringBuilder buffer)
GenericObject
encode
in class GenericURI
public String toString()
public String getUserAtHost()
public String getUserAtHostPort()
public Object getParm(String parmname)
parmname
- Name of the parameter to get.public String getMethod()
public NameValueList getParameters()
public void removeParameters()
public NameValueList getQheaders()
public String getUserType()
public String getUserPassword()
getUserPassword
in interface SipURI
public void setUserPassword(String password)
setUserPassword
in interface SipURI
password
- - password to set.public TelephoneNumber getTelephoneSubscriber()
public HostPort getHostPort()
public int getPort()
public String getHost()
public boolean isUserTelephoneSubscriber()
public void removeTTL()
public void removeMAddr()
public void removeTransport()
public void removeHeader(String name)
removeHeader
in interface SipURIExt
name
- name of the header to remove.public void removeHeaders()
removeHeaders
in interface SipURIExt
public void removeUserType()
public void removePort()
removePort
in interface SipURI
public void removeMethod()
public void setUser(String uname)
setUser
in interface SipURI
uname
- The new String value of the user.ParseException
- which signals that an error has been reached
unexpectedly while parsing the user value.public void removeUser()
public void setDefaultParm(String name, Object value)
name
- Name of the parameter to set.value
- value of the parameter to set.public void setAuthority(Authority authority)
authority
- Authority to set.public void setHost(Host h)
h
- host to set.public void setUriParms(NameValueList parms)
parms
- URI parameters to set.public void setUriParm(String name, Object value)
name
- Name of the parameter to set.value
- value of the parameter to set.public void setQheaders(NameValueList parms)
parms
- query headers to set.public void setMAddr(String mAddr)
mAddr
- Host Name to setpublic void setUserParam(String usertype)
setUserParam
in interface SipURI
usertype
- New value String value of the method parameterpublic void setMethod(String method)
method
- method parameterpublic void setIsdnSubAddress(String isdnSubAddress)
isdnSubAddress
- ISDN subaddresspublic void setTelephoneSubscriber(TelephoneNumber tel)
tel
- Telephone subscriber field to set.public void setPort(int p)
public boolean hasParameter(String name)
name
- Name of the parameter to check on.public void setQHeader(NameValue nameValue)
nameValue
- qeuery header provided as a name,value pair.public void setUriParameter(NameValue nameValue)
nameValue
- - parameter to set.public boolean hasTransport()
public void removeParameter(String name)
removeParameter
in interface Parameters
name
- -- name of the parameter to remove.public void setHostPort(HostPort hostPort)
hostPort
- is the hostPort to set.public Object clone()
clone
in interface URI
clone
in class GenericObject
public String getHeader(String name)
public Iterator<String> getHeaderNames()
getHeaderNames
in interface SipURI
public String getLrParam()
lr
parameter, or null if this
is not set. This is equivalent to getParameter("lr").lr
parameterpublic String getMAddrParam()
maddr
parameter, or null if this
is not set. This is equivalent to getParameter("maddr").getMAddrParam
in interface SipURI
maddr
parameterpublic String getMethodParam()
method
parameter, or null if this
is not set. This is equivalent to getParameter("method").getMethodParam
in interface SipURI
method
parameterpublic String getParameter(String name)
getParameter
in interface Parameters
name
- name of parameter to retrievepublic Iterator<String> getParameterNames()
getParameterNames
in interface Parameters
public int getTTLParam()
getTTLParam
in interface SipURI
ttl
parameterpublic String getTransportParam()
getTransportParam
in interface SipURI
public String getUser()
userParam
,
or null if this is not set.
This is equivalent to getParameter("user").
public boolean isSecure()
public boolean isSipURI()
isSipURI
in interface URI
isSipURI
in class GenericURI
public void setHeader(String name, String value)
public void setHost(String host) throws ParseException
setHost
in interface SipURI
host
- host to set.ParseException
- which signals that an error has been reached
unexpectedly while parsing the host value.public void setLrParam()
lr
parameter of this SipURI. The lr
parameter, when present, indicates that the element responsible for
this resource implements the routing mechanisms specified in RFC 3261.
This parameter will be used in the URIs proxies place in the
Record-Route header field values, and may appear in the URIs in a
pre-existing route set.setLrParam
in interface SipURIExt
setLrParam
in interface SipURI
public void setMAddrParam(String maddr) throws ParseException
maddr
parameter of this SipURI. The
maddr parameter indicates the server address to be contacted for this
user, overriding any address derived from the host field. This is
equivalent to setParameter("maddr", maddr).setMAddrParam
in interface SipURI
maddr
- New value of the maddr
parameterParseException
- which signals that an error has been reached
unexpectedly while parsing the mAddr value.public void setMethodParam(String method) throws ParseException
method
parameter. This specifies
which SIP method to use in requests directed at this URI. This is
equivalent to setParameter("method", method).setMethodParam
in interface SipURI
method
- - new value String value of the method parameterParseException
- which signals that an error has been reached
unexpectedly while parsing the method value.public void setParameter(String name, String value) throws ParseException
setParameter
in interface Parameters
name
- - a String specifying the parameter namevalue
- - a String specifying the parameter valueParseException
- which signals that an error has been reached
unexpectedly while parsing the parameter name or value.public void setSecure(boolean secure)
public void setTTLParam(int ttl)
ttl
parameter. The ttl parameter
specifies the time-to-live value when packets are sent using UDP
multicast. This is equivalent to setParameter("ttl", ttl).setTTLParam
in interface SipURI
ttl
- - new value of the ttl
parameterpublic void setTransportParam(String transport) throws ParseException
ListeningPoint
.setTransportParam
in interface SipURI
transport
- - new value for the "transport" parameterParseException
- which signals that an error has been reached
unexpectedly while parsing the transport value.ListeningPoint
public String getUserParam()
getUserParam
in interface SipURI
public boolean hasLrParam()
lr
parameter is set. This is
equivalent to hasParameter("lr"). This interface has no getLrParam as
RFC3261 does not specify any values for the "lr" paramater.hasLrParam
in interface SipURIExt
hasLrParam
in interface SipURI
public boolean hasGrParam()
gr
parameter is set.
Not part on the interface since gruu is not part of the base RFC3261.hasGrParam
in interface SipURIExt
public void setGrParam(String value)
gr
parameter.
Not part on the interface since gruu is not part of the base RFC3261.setGrParam
in interface SipURIExt
value
- -- the GRUU param value.public String getGrParam()
gr
parameter.
Not part on the interface since gruu is not part of the base RFC3261.Copyright © 2015. All Rights Reserved.