gov.nist.javax.sip.address
クラス SipUri

java.lang.Object
  上位を拡張 gov.nist.core.GenericObject
      上位を拡張 gov.nist.javax.sip.address.NetObject
          上位を拡張 gov.nist.javax.sip.address.GenericURI
              上位を拡張 gov.nist.javax.sip.address.SipUri
すべての実装されたインタフェース:
java.io.Serializable, java.lang.Cloneable, javax.sip.address.SipURI, javax.sip.address.URI, javax.sip.header.Parameters

public class SipUri
extends GenericURI
implements javax.sip.address.SipURI

The SipUri structure.

バージョン:
JAIN-SIP-1.1 $Revision: 1.4 $ $Date: 2004/09/26 14:48:03 $ This code is in the public domain.
作成者:
M. Ranganathan
Includes a bug fix by Stefan Marx.
関連項目:
直列化された形式

フィールドの概要
 
クラス gov.nist.javax.sip.address.GenericURI から継承されたフィールド
ISUB, PHONE_CONTEXT_TAG, POSTDIAL, PROVIDER_TAG, SIP, SIPS, TEL
 
コンストラクタの概要
SipUri()
           
 
メソッドの概要
 void clearPassword()
          Clear the password from the user part if it exists.
 void clearQheaders()
          Clear all Qheaders.
 void clearUriParms()
          clear all URI Parameters.
 java.lang.Object clone()
          clone this.
 java.lang.String encode()
          Construct a URL from the parsed structure.
 boolean equals(java.lang.Object that)
          Compare two URIs and return true if they are equal.
 Authority getAuthority()
          Get the authority.
 java.lang.String getHeader(java.lang.String name)
          Returns the value of the named header, or null if it is not set.
 java.util.Iterator getHeaderNames()
          Returns an Iterator over the names (Strings) of all headers present in this SipURI.
 java.lang.String getHost()
          Get the host protion of the URI.
 HostPort getHostPort()
          Get the host and port of the server.
 java.lang.String getLrParam()
          Returns the value of the lr parameter, or null if this is not set.
 java.lang.String getMAddrParam()
          Returns the value of the maddr parameter, or null if this is not set.
 java.lang.String getMethod()
          Get the method parameter.
 java.lang.String getMethodParam()
          Returns the value of the method parameter, or null if this is not set.
 java.lang.String getParameter(java.lang.String name)
          Returns the value of the named parameter, or null if it is not set.
 java.util.Iterator getParameterNames()
          Returns an Iterator over the names (Strings) of all parameters present in this ParametersHeader.
 java.lang.Object getParm(java.lang.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
 java.lang.String getScheme()
          Get the scheme.
 TelephoneNumber getTelephoneSubscriber()
          Returns the stucture corresponding to the telephone number provided that the user is a telephone subscriber.
 java.lang.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.
 NameValueList getUriParms()
          Accessor for URI parameters
 java.lang.String getUser()
          Returns the value of the userParam, or null if this is not set.
 java.lang.String getUserAtHost()
          getUser@host
 java.lang.String getUserAtHostPort()
          getUser@host
 java.lang.String getUserParam()
          Returns the user part of this SipURI, or null if it is not set.
 java.lang.String getUserPassword()
          Get the password of the user.
 java.lang.String getUserType()
          Get the urse parameter.
 boolean hasLrParam()
          Returns whether the the lr parameter is set.
 boolean hasParameter(java.lang.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(java.lang.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(java.lang.String name)
          Remove a parameter given its name
 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 removeUriParms()
          Remove the URI parameters.
 void removeUser()
          Remove the user.
 void removeUserType()
          Set the user type.
 void setAuthority(Authority authority)
          Set the authority member
 void setDefaultParm(java.lang.String name, java.lang.Object value)
          Set the default parameters for this URI.
 void setHeader(java.lang.String name, java.lang.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(java.lang.String host)
          Returns the host part of this SipURI.
 void setHostPort(HostPort hostPort)
          Set the hostPort field of the imbedded authority field.
 void setIsdnSubAddress(java.lang.String isdnSubAddress)
          Sets ISDN subaddress of SipURL
 void setLrParam()
          Sets the value of the lr parameter of this SipURI.
 void setMAddr(java.lang.String mAddr)
          Set the MADDR parameter .
 void setMAddrParam(java.lang.String maddr)
          Sets the value of the maddr parameter of this SipURI.
 void setMethod(java.lang.String method)
          Set the Method
 void setMethodParam(java.lang.String method)
          Sets the value of the method parameter.
 void setParameter(java.lang.String name, java.lang.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(java.lang.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(java.lang.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(java.lang.String name, java.lang.Object value)
          Set a given URI parameter.
 void setUriParms(NameValueList parms)
          Set the uriParms member
 void setUser(java.lang.String uname)
          Sets the user of SipURI.
 void setUserParam(java.lang.String usertype)
          Sets the value of the user parameter.
 void setUserPassword(java.lang.String password)
          Set the user password.
 java.lang.String toString()
          Return a string representation.
 
クラス gov.nist.javax.sip.address.NetObject から継承されたメソッド
debugDump, debugDump, match, merge, replace, replace, replace, replace
 
クラス gov.nist.core.GenericObject から継承されたメソッド
getClassFromName, getMatcher, isMySubclass, setMatcher
 
クラス java.lang.Object から継承されたメソッド
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

SipUri

public SipUri()
メソッドの詳細

setScheme

public void setScheme(java.lang.String scheme)
Constructor given the scheme. The scheme must be either Sip or Sips


getScheme

public java.lang.String getScheme()
Get the scheme.

定義:
インタフェース javax.sip.address.URI 内の getScheme
オーバーライド:
クラス GenericURI 内の getScheme
戻り値:
the scheme paramter of the URI

clearUriParms

public void clearUriParms()
clear all URI Parameters.

導入されたバージョン:
v1.0

clearPassword

public void clearPassword()
Clear the password from the user part if it exists.


getAuthority

public Authority getAuthority()
Get the authority.


clearQheaders

public void clearQheaders()
Clear all Qheaders.


equals

public boolean equals(java.lang.Object that)
Compare two URIs and return true if they are equal.

オーバーライド:
クラス NetObject 内の equals
パラメータ:
that - the object to compare to.
戻り値:
true if the object is equal to this object.

encode

public java.lang.String encode()
Construct a URL from the parsed structure.

オーバーライド:
クラス GenericURI 内の encode
戻り値:
String

toString

public java.lang.String toString()
Return a string representation.

定義:
インタフェース javax.sip.address.SipURI 内の toString
定義:
インタフェース javax.sip.address.URI 内の toString
オーバーライド:
クラス GenericURI 内の toString
戻り値:
the String representation of this URI.

getUserAtHost

public java.lang.String getUserAtHost()
getUser@host

戻り値:
user@host portion of the uri (null if none exists).

getUserAtHostPort

public java.lang.String getUserAtHostPort()
getUser@host

戻り値:
user@host portion of the uri (null if none exists).

getParm

public java.lang.Object getParm(java.lang.String parmname)
get the parameter (do a name lookup) and return null if none exists.

パラメータ:
parmname - Name of the parameter to get.
戻り値:
Parameter of the given name (null if none exists).

getMethod

public java.lang.String getMethod()
Get the method parameter.

戻り値:
Method parameter.

getUriParms

public NameValueList getUriParms()
Accessor for URI parameters

戻り値:
A name-value list containing the parameters.

removeUriParms

public void removeUriParms()
Remove the URI parameters.


getQheaders

public NameValueList getQheaders()
Accessor forSIPObjects

戻り値:
Get the query headers (that appear after the ? in the URL)

getUserType

public java.lang.String getUserType()
Get the urse parameter.

戻り値:
User parameter (user= phone or user=ip).

getUserPassword

public java.lang.String getUserPassword()
Get the password of the user.

定義:
インタフェース javax.sip.address.SipURI 内の getUserPassword
戻り値:
User password when it embedded as part of the uri ( a very bad idea).

setUserPassword

public void setUserPassword(java.lang.String password)
Set the user password.

定義:
インタフェース javax.sip.address.SipURI 内の setUserPassword
パラメータ:
password - - password to set.

getTelephoneSubscriber

public TelephoneNumber getTelephoneSubscriber()
Returns the stucture corresponding to the telephone number provided that the user is a telephone subscriber.

戻り値:
TelephoneNumber part of the url (only makes sense when user = phone is specified)

getHostPort

public HostPort getHostPort()
Get the host and port of the server.

戻り値:
get the host:port part of the url parsed into a structure.

getPort

public int getPort()
Get the port from the authority field.

定義:
インタフェース javax.sip.address.SipURI 内の getPort
戻り値:
the port from the authority field.

getHost

public java.lang.String getHost()
Get the host protion of the URI.

定義:
インタフェース javax.sip.address.SipURI 内の getHost
戻り値:
the host portion of the url.

isUserTelephoneSubscriber

public boolean isUserTelephoneSubscriber()
returns true if the user is a telephone subscriber. If the host is an Internet telephony gateway, a telephone-subscriber field MAY be used instead of a user field. The telephone-subscriber field uses the notation of RFC 2806 [19]. Any characters of the un-escaped "telephone-subscriber" that are not either in the set "unreserved" or "user-unreserved" MUST be escaped. The set of characters not reserved in the RFC 2806 description of telephone-subscriber contains a number of characters in various syntax elements that need to be escaped when used in SIP URLs, for example quotation marks (%22), hash (%23), colon (%3a), at-sign (%40) and the "unwise" characters, i.e., punctuation of %5b and above. The telephone number is a special case of a user name and cannot be distinguished by a BNF. Thus, a URL parameter, user, is added to distinguish telephone numbers from user names. The user parameter value "phone" indicates that the user part contains a telephone number. Even without this parameter, recipients of SIP URLs MAY interpret the pre-@ part as a telephone number if local restrictions on the

戻り値:
true if the user is a telephone subscriber.

removeTTL

public void removeTTL()
remove the ttl value from the parameter list if it exists.


removeMAddr

public void removeMAddr()
Remove the maddr param if it exists.


removeTransport

public void removeTransport()
Delete the transport string.


removeHeader

public void removeHeader(java.lang.String name)
Remove a header given its name (provided it exists).

パラメータ:
name - name of the header to remove.

removeHeaders

public void removeHeaders()
Remove all headers.


removeUserType

public void removeUserType()
Set the user type.


removePort

public void removePort()
remove the port setting.

定義:
インタフェース javax.sip.address.SipURI 内の removePort

removeMethod

public void removeMethod()
remove the Method.


setUser

public void setUser(java.lang.String uname)
Sets the user of SipURI. The identifier of a particular resource at the host being addressed. The user and the user password including the "at" sign make up the user-info.

定義:
インタフェース javax.sip.address.SipURI 内の setUser
パラメータ:
uname - The new String value of the user.
例外:
java.text.ParseException - which signals that an error has been reached unexpectedly while parsing the user value.

removeUser

public void removeUser()
Remove the user.


setDefaultParm

public void setDefaultParm(java.lang.String name,
                           java.lang.Object value)
Set the default parameters for this URI. Do nothing if the parameter is already set to some value. Otherwise set it to the given value.

パラメータ:
name - Name of the parameter to set.
value - value of the parameter to set.

setAuthority

public void setAuthority(Authority authority)
Set the authority member

パラメータ:
authority - Authority to set.

setHost

public void setHost(Host h)
Set the host for this URI.

パラメータ:
h - host to set.

setUriParms

public void setUriParms(NameValueList parms)
Set the uriParms member

パラメータ:
parms - URI parameters to set.

setUriParm

public void setUriParm(java.lang.String name,
                       java.lang.Object value)
Set a given URI parameter. Note - parameter must be properly encoded before the function is called.

パラメータ:
name - Name of the parameter to set.
value - value of the parameter to set.

setQheaders

public void setQheaders(NameValueList parms)
Set the qheaders member

パラメータ:
parms - query headers to set.

setMAddr

public void setMAddr(java.lang.String mAddr)
Set the MADDR parameter .

パラメータ:
mAddr - Host Name to set

setUserParam

public void setUserParam(java.lang.String usertype)
Sets the value of the user parameter. The user URI parameter exists to distinguish telephone numbers from user names that happen to look like telephone numbers. This is equivalent to setParameter("user", user).

定義:
インタフェース javax.sip.address.SipURI 内の setUserParam
パラメータ:
usertype - New value String value of the method parameter

setMethod

public void setMethod(java.lang.String method)
Set the Method

パラメータ:
method - method parameter

setIsdnSubAddress

public void setIsdnSubAddress(java.lang.String isdnSubAddress)
Sets ISDN subaddress of SipURL

パラメータ:
isdnSubAddress - ISDN subaddress

setTelephoneSubscriber

public void setTelephoneSubscriber(TelephoneNumber tel)
Set the telephone subscriber field.

パラメータ:
tel - Telephone subscriber field to set.

setPort

public void setPort(int p)
set the port to a given value.

定義:
インタフェース javax.sip.address.SipURI 内の setPort
パラメータ:
p - Port to set.

hasParameter

public boolean hasParameter(java.lang.String name)
Boolean to check if a parameter of a given name exists.

パラメータ:
name - Name of the parameter to check on.
戻り値:
a boolean indicating whether the parameter exists.

setQHeader

public void setQHeader(NameValue nameValue)
Set the query header when provided as a name-value pair.

パラメータ:
nameValue - qeuery header provided as a name,value pair.

setUriParameter

public void setUriParameter(NameValue nameValue)
Set the parameter as given.

パラメータ:
nameValue - - parameter to set.

hasTransport

public boolean hasTransport()
Return true if the transport parameter is defined.

戻り値:
true if transport appears as a parameter and false otherwise.

removeParameter

public void removeParameter(java.lang.String name)
Remove a parameter given its name

定義:
インタフェース javax.sip.header.Parameters 内の removeParameter
パラメータ:
name - -- name of the parameter to remove.

setHostPort

public void setHostPort(HostPort hostPort)
Set the hostPort field of the imbedded authority field.

パラメータ:
hostPort - is the hostPort to set.

clone

public java.lang.Object clone()
clone this.

定義:
インタフェース javax.sip.address.URI 内の clone
オーバーライド:
クラス GenericURI 内の clone
戻り値:
The Cloned strucutre,

getHeader

public java.lang.String getHeader(java.lang.String name)
Returns the value of the named header, or null if it is not set. SIP/SIPS URIs may specify headers. As an example, the URI sip:joe@jcp.org?priority=urgent has a header "priority" whose value is "urgent".

定義:
インタフェース javax.sip.address.SipURI 内の getHeader
パラメータ:
name - name of header to retrieve
戻り値:
the value of specified header

getHeaderNames

public java.util.Iterator getHeaderNames()
Returns an Iterator over the names (Strings) of all headers present in this SipURI.

定義:
インタフェース javax.sip.address.SipURI 内の getHeaderNames
戻り値:
an Iterator over all the header names

getLrParam

public java.lang.String getLrParam()
Returns the value of the lr parameter, or null if this is not set. This is equivalent to getParameter("lr").

戻り値:
the value of the lr parameter

getMAddrParam

public java.lang.String getMAddrParam()
Returns the value of the maddr parameter, or null if this is not set. This is equivalent to getParameter("maddr").

定義:
インタフェース javax.sip.address.SipURI 内の getMAddrParam
戻り値:
the value of the maddr parameter

getMethodParam

public java.lang.String getMethodParam()
Returns the value of the method parameter, or null if this is not set. This is equivalent to getParameter("method").

定義:
インタフェース javax.sip.address.SipURI 内の getMethodParam
戻り値:
the value of the method parameter

getParameter

public java.lang.String getParameter(java.lang.String name)
Returns the value of the named parameter, or null if it is not set. A zero-length String indicates flag parameter.

定義:
インタフェース javax.sip.header.Parameters 内の getParameter
パラメータ:
name - name of parameter to retrieve
戻り値:
the value of specified parameter

getParameterNames

public java.util.Iterator getParameterNames()
Returns an Iterator over the names (Strings) of all parameters present in this ParametersHeader.

定義:
インタフェース javax.sip.header.Parameters 内の getParameterNames
戻り値:
an Iterator over all the parameter names

getTTLParam

public int getTTLParam()
Returns the value of the "ttl" parameter, or -1 if this is not set. This method is equivalent to getParameter("ttl").

定義:
インタフェース javax.sip.address.SipURI 内の getTTLParam
戻り値:
the value of the ttl parameter

getTransportParam

public java.lang.String getTransportParam()
Returns the value of the "transport" parameter, or null if this is not set. This is equivalent to getParameter("transport").

定義:
インタフェース javax.sip.address.SipURI 内の getTransportParam
戻り値:
the transport paramter of the SipURI

getUser

public java.lang.String getUser()
Returns the value of the userParam, or null if this is not set.

This is equivalent to getParameter("user").

定義:
インタフェース javax.sip.address.SipURI 内の getUser
戻り値:
the value of the userParam of the SipURI

isSecure

public boolean isSecure()
Returns true if this SipURI is secure i.e. if this SipURI represents a sips URI. A sip URI returns false.

定義:
インタフェース javax.sip.address.SipURI 内の isSecure
戻り値:
true if this SipURI represents a sips URI, and false if it represents a sip URI.

isSipURI

public boolean isSipURI()
This method determines if this is a URI with a scheme of "sip" or "sips".

定義:
インタフェース javax.sip.address.URI 内の isSipURI
オーバーライド:
クラス GenericURI 内の isSipURI
戻り値:
true if the scheme is "sip" or "sips", false otherwise.

setHeader

public void setHeader(java.lang.String name,
                      java.lang.String value)
Sets the value of the specified header fields to be included in a request constructed from the URI. If the header already had a value it will be overwritten.

定義:
インタフェース javax.sip.address.SipURI 内の setHeader
パラメータ:
name - - a String specifying the header name
value - - a String specifying the header value

setHost

public void setHost(java.lang.String host)
             throws java.text.ParseException
Returns the host part of this SipURI.

定義:
インタフェース javax.sip.address.SipURI 内の setHost
例外:
java.text.ParseException

setLrParam

public void setLrParam()
Sets the value of the 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.

定義:
インタフェース javax.sip.address.SipURI 内の setLrParam

setMAddrParam

public void setMAddrParam(java.lang.String maddr)
                   throws java.text.ParseException
Sets the value of the 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).

定義:
インタフェース javax.sip.address.SipURI 内の setMAddrParam
パラメータ:
maddr - New value of the maddr parameter
例外:
java.text.ParseException

setMethodParam

public void setMethodParam(java.lang.String method)
                    throws java.text.ParseException
Sets the value of the method parameter. This specifies which SIP method to use in requests directed at this URI. This is equivalent to setParameter("method", method).

定義:
インタフェース javax.sip.address.SipURI 内の setMethodParam
パラメータ:
method - - new value String value of the method parameter
例外:
java.text.ParseException

setParameter

public void setParameter(java.lang.String name,
                         java.lang.String value)
                  throws java.text.ParseException
Sets the value of the specified parameter. If the parameter already had a value it will be overwritten. A zero-length String indicates flag parameter.

定義:
インタフェース javax.sip.header.Parameters 内の setParameter
パラメータ:
name - - a String specifying the parameter name
value - - a String specifying the parameter value
例外:
java.text.ParseException - which signals that an error has been reached unexpectedly while parsing the parameter name or value.

setSecure

public void setSecure(boolean secure)
Sets the scheme of this URI to sip or sips depending on whether the argument is true or false. The default value is false.

定義:
インタフェース javax.sip.address.SipURI 内の setSecure
パラメータ:
secure - - the boolean value indicating if the SipURI is secure.

setTTLParam

public void setTTLParam(int ttl)
Sets the value of the 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).

定義:
インタフェース javax.sip.address.SipURI 内の setTTLParam
パラメータ:
ttl - - new value of the ttl parameter

setTransportParam

public void setTransportParam(java.lang.String transport)
                       throws java.text.ParseException
Sets the value of the "transport" parameter. This parameter specifies which transport protocol to use for sending requests and responses to this entity. The following values are defined: "udp", "tcp", "sctp", "tls", but other values may be used also. This method is equivalent to setParameter("transport", transport). Transport parameter constants are defined in the ListeningPoint.

定義:
インタフェース javax.sip.address.SipURI 内の setTransportParam
パラメータ:
transport - - new value for the "transport" parameter
例外:
java.text.ParseException
関連項目:
ListeningPoint

getUserParam

public java.lang.String getUserParam()
Returns the user part of this SipURI, or null if it is not set.

定義:
インタフェース javax.sip.address.SipURI 内の getUserParam
戻り値:
the user part of this SipURI

hasLrParam

public boolean hasLrParam()
Returns whether the the 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.

定義:
インタフェース javax.sip.address.SipURI 内の hasLrParam
戻り値:
true if the "lr" parameter is set, false otherwise.