|
NIST-SIP: The Reference Implementation for JAIN-SIP 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nist.core.GenericObject
gov.nist.javax.sip.address.NetObject
gov.nist.javax.sip.address.GenericURI
gov.nist.javax.sip.address.SipUri
public class SipUri
Implementation of the SipURI interface.
Field Summary |
---|
Fields inherited from class gov.nist.javax.sip.address.GenericURI |
---|
ISUB, PHONE_CONTEXT_TAG, POSTDIAL, PROVIDER_TAG, SIP, SIPS, TEL |
Constructor Summary | |
---|---|
SipUri()
|
Method Summary | |
---|---|
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. |
StringBuffer |
encode(StringBuffer buffer)
Put the encoded version of this object in the given StringBuffer. |
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 |
getHeaderNames()
Returns an Iterator over the names (Strings) of all headers present in this SipURI. |
String |
getHost()
Get the host protion of the URI. |
gov.nist.core.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 |
getParameterNames()
Returns an Iterator over the names (Strings) of all parameters present in this ParametersHeader. |
gov.nist.core.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. |
gov.nist.core.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. if this SipURI represents a sips URI. |
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(gov.nist.core.Host h)
Set the host for this URI. |
void |
setHost(String host)
Set the host portion of the SipURI |
void |
setHostPort(gov.nist.core.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(gov.nist.core.NameValue nameValue)
Set the query header when provided as a name-value pair. |
void |
setQheaders(gov.nist.core.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(gov.nist.core.NameValue nameValue)
Set the parameter as given. |
void |
setUriParm(String name,
Object value)
Set a given URI parameter. |
void |
setUriParms(gov.nist.core.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. |
Methods inherited from class gov.nist.javax.sip.address.GenericURI |
---|
hashCode |
Methods inherited from class gov.nist.javax.sip.address.NetObject |
---|
debugDump, debugDump, match |
Methods inherited from class gov.nist.core.GenericObject |
---|
getClassFromName, getMatcher, isMySubclass, makeClone, merge, setMatcher |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SipUri()
Method Detail |
---|
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 StringBuffer encode(StringBuffer buffer)
gov.nist.core.GenericObject
encode
in class GenericURI
public String toString()
toString
in interface SipURI
toString
in interface URI
toString
in class GenericURI
public String getUserAtHost()
public String getUserAtHostPort()
public Object getParm(String parmname)
parmname
- Name of the parameter to get.
public String getMethod()
public gov.nist.core.NameValueList getParameters()
public void removeParameters()
public gov.nist.core.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 gov.nist.core.HostPort getHostPort()
public int getPort()
getPort
in interface SipURI
public String getHost()
getHost
in interface SipURI
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(gov.nist.core.Host h)
h
- host to set.public void setUriParms(gov.nist.core.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(gov.nist.core.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)
setPort
in interface SipURI
p
- Port to set.public boolean hasParameter(String name)
name
- Name of the parameter to check on.
public void setQHeader(gov.nist.core.NameValue nameValue)
nameValue
- qeuery header provided as a name,value pair.public void setUriParameter(gov.nist.core.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(gov.nist.core.HostPort hostPort)
hostPort
- is the hostPort to set.public Object clone()
clone
in interface URI
clone
in class gov.nist.core.GenericObject
public String getHeader(String name)
getHeader
in interface SipURI
name
- name of header to retrieve
public Iterator 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 retrieve
public Iterator 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").
getUser
in interface SipURI
userParam
of the SipURIpublic boolean isSecure()
isSecure
in interface SipURI
true
if this SipURI represents a sips URI, and
false
if it represents a sip URI.public boolean isSipURI()
isSipURI
in interface URI
isSipURI
in class GenericURI
public void setHeader(String name, String value)
setHeader
in interface SipURI
name
- - a String specifying the header namevalue
- - a String specifying the header valuepublic 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 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
parameter
ParseException
- 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 parameter
ParseException
- 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 value
ParseException
- which signals that an error has been reached
unexpectedly while parsing the parameter name or value.public void setSecure(boolean secure)
setSecure
in interface SipURI
secure
- - the boolean value indicating if the SipURI is 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" parameter
ParseException
- 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 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.
|
NIST-SIP: The Reference Implementation for JAIN-SIP 1.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |