NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

gov.nist.javax.sip.address
Class TelURLImpl

java.lang.Object
  extended by gov.nist.core.GenericObject
      extended by gov.nist.javax.sip.address.NetObject
          extended by gov.nist.javax.sip.address.GenericURI
              extended by gov.nist.javax.sip.address.TelURLImpl
All Implemented Interfaces:
Serializable, Cloneable, TelURL, URI, Parameters

public class TelURLImpl
extends GenericURI
implements TelURL

Implementation of the TelURL interface.

Version:
1.2 $Revision: 1.9 $ $Date: 2009/07/17 18:57:23 $
Author:
M. Ranganathan
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.nist.javax.sip.address.GenericURI
ISUB, PHONE_CONTEXT_TAG, POSTDIAL, PROVIDER_TAG, SIP, SIPS, TEL
 
Constructor Summary
TelURLImpl()
          Creates a new instance of TelURLImpl
 
Method Summary
 Object clone()
          Deep copy clone operation.
 String encode()
          Encode the URI.
 StringBuffer encode(StringBuffer buffer)
          Put the encoded version of this object in the given StringBuffer.
 String getIsdnSubAddress()
          Returns the value of the isdnSubAddress parameter, or null if it is not set.
 String getParameter(String parameterName)
          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.
 gov.nist.core.NameValueList getParameters()
           
 String getPhoneContext()
          Returns the value of the phoneContext parameter, or null if it is not set.
 String getPhoneNumber()
          Get the telephone number.
 String getPostDial()
          Returns the value of the postDial parameter, or null if it is not set.
 String getScheme()
          Returns the value of the "scheme" of this URI, for example "sip", "sips" or "tel".
 boolean isGlobal()
          Returns true if this TelURL is global i.e. if the TelURI has a global phone user.
 boolean isSipURI()
          This method determines if this is a URI with a scheme of "sip" or "sips".
 void removeParameter(String name)
          Removes the specified parameter from Parameters of this ParametersHeader.
 void setGlobal(boolean global)
          Sets phone user of this TelURL to be either global or local.
 void setIsdnSubAddress(String isdnSubAddress)
          Sets ISDN subaddress of this TelURL.
 void setParameter(String name, String value)
          Sets the value of the specified parameter.
 void setPhoneContext(String phoneContext)
          Sets the phone context of this TelURL.
 void setPhoneNumber(String telephoneNumber)
          Set the telephone number.
 void setPostDial(String postDial)
          Sets post dial of this TelURL.
 void setTelephoneNumber(TelephoneNumber telephoneNumber)
          Set the telephone number.
 String toString()
          Return the string encoding.
 
Methods inherited from class gov.nist.javax.sip.address.GenericURI
equals, 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

TelURLImpl

public TelURLImpl()
Creates a new instance of TelURLImpl

Method Detail

setTelephoneNumber

public void setTelephoneNumber(TelephoneNumber telephoneNumber)
Set the telephone number.

Parameters:
telephoneNumber - -- telephone number to set.

getIsdnSubAddress

public String getIsdnSubAddress()
Returns the value of the isdnSubAddress parameter, or null if it is not set.

Specified by:
getIsdnSubAddress in interface TelURL
Returns:
the value of the isdnSubAddress parameter

getPostDial

public String getPostDial()
Returns the value of the postDial parameter, or null if it is not set.

Specified by:
getPostDial in interface TelURL
Returns:
the value of the postDial parameter

getScheme

public String getScheme()
Returns the value of the "scheme" of this URI, for example "sip", "sips" or "tel".

Specified by:
getScheme in interface URI
Overrides:
getScheme in class GenericURI
Returns:
the scheme paramter of the URI

isGlobal

public boolean isGlobal()
Returns true if this TelURL is global i.e. if the TelURI has a global phone user.

Specified by:
isGlobal in interface TelURL
Returns:
true if this TelURL represents a global phone user, and false otherwise.

isSipURI

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

Specified by:
isSipURI in interface URI
Overrides:
isSipURI in class GenericURI
Returns:
true if the scheme is "sip" or "sips", false otherwise.

setGlobal

public void setGlobal(boolean global)
Sets phone user of this TelURL to be either global or local. The default value is false, hence the TelURL is defaulted to local.

Specified by:
setGlobal in interface TelURL
Parameters:
global - - the boolean value indicating if the TelURL has a global phone user.

setIsdnSubAddress

public void setIsdnSubAddress(String isdnSubAddress)
Sets ISDN subaddress of this TelURL. If a subaddress is present, it is appended to the phone number after ";isub=".

Specified by:
setIsdnSubAddress in interface TelURL
Parameters:
isdnSubAddress - - new value of the isdnSubAddress parameter

setPostDial

public void setPostDial(String postDial)
Sets post dial of this TelURL. The post-dial sequence describes what and when the local entity should send to the phone line.

Specified by:
setPostDial in interface TelURL
Parameters:
postDial - - new value of the postDial parameter

setPhoneNumber

public void setPhoneNumber(String telephoneNumber)
Set the telephone number.

Specified by:
setPhoneNumber in interface TelURL
Parameters:
telephoneNumber - long phone number to set.

getPhoneNumber

public String getPhoneNumber()
Get the telephone number.

Specified by:
getPhoneNumber in interface TelURL
Returns:
-- the telephone number.

toString

public String toString()
Return the string encoding.

Specified by:
toString in interface TelURL
Specified by:
toString in interface URI
Overrides:
toString in class GenericURI
Returns:
-- the string encoding.

encode

public String encode()
Description copied from class: GenericURI
Encode the URI.

Overrides:
encode in class GenericURI
Returns:
The encoded URI

encode

public StringBuffer encode(StringBuffer buffer)
Description copied from class: gov.nist.core.GenericObject
Put the encoded version of this object in the given StringBuffer.

Overrides:
encode in class GenericURI

clone

public Object clone()
Deep copy clone operation.

Specified by:
clone in interface URI
Overrides:
clone in class gov.nist.core.GenericObject
Returns:
-- a cloned version of this telephone number.

getParameter

public String getParameter(String parameterName)
Description copied from interface: Parameters
Returns the value of the named parameter, or null if it is not set. A zero-length String indicates flag parameter.

Specified by:
getParameter in interface Parameters
Parameters:
parameterName - name of parameter to retrieve
Returns:
the value of specified parameter

setParameter

public void setParameter(String name,
                         String value)
Description copied from interface: Parameters
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.

Specified by:
setParameter in interface Parameters
Parameters:
name - - a String specifying the parameter name
value - - a String specifying the parameter value

getParameterNames

public Iterator<String> getParameterNames()
Description copied from interface: Parameters
Returns an Iterator over the names (Strings) of all parameters present in this ParametersHeader.

Specified by:
getParameterNames in interface Parameters
Returns:
an Iterator over all the parameter names

getParameters

public gov.nist.core.NameValueList getParameters()

removeParameter

public void removeParameter(String name)
Description copied from interface: Parameters
Removes the specified parameter from Parameters of this ParametersHeader. This method returns silently if the parameter is not part of the ParametersHeader.

Specified by:
removeParameter in interface Parameters
Parameters:
name - - a String specifying the parameter name

setPhoneContext

public void setPhoneContext(String phoneContext)
                     throws ParseException
Description copied from interface: TelURL
Sets the phone context of this TelURL.

Specified by:
setPhoneContext in interface TelURL
Parameters:
phoneContext - - new value of the phoneContext parameter
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the phoneContext value.

getPhoneContext

public String getPhoneContext()
Description copied from interface: TelURL
Returns the value of the phoneContext parameter, or null if it is not set.

Specified by:
getPhoneContext in interface TelURL
Returns:
the value of the phoneContext parameter

NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Submit a bug report or feature request.