javax.servlet.sip
Interface SipAddress

All Superinterfaces:
java.lang.Cloneable
All Known Subinterfaces:
Contact

public interface SipAddress
extends java.lang.Cloneable

Represents the value of SIP From and To headers. These headers consist of a URI along with an optional display name and set of parameters.


Method Summary
 java.lang.Object clone()
          Returns a clone of this SipAddress.
 java.lang.String getDisplayName()
          Returns the display name of this SipAddress.
 java.lang.String getParameter(java.lang.String name)
          Returns the value of the specified parameter.
 java.util.Iterator getParameterNames()
          Returns an Iterator over the set of all parameters of this address.
 URI getURI()
          Returns the URI component of this SipAddress.
 void removeParameter(java.lang.String name)
          Removes the parameter with the specified name.
 void setDisplayName(java.lang.String name)
          Sets the display name of this SipAddress.
 void setParameter(java.lang.String name, java.lang.String value)
          Sets the value of the specified parameter.
 void setURI(URI uri)
          Sets the URI of this SipAddress.
 java.lang.String toString()
          Returns the value of this address as a String.
 

Method Detail

getDisplayName

public java.lang.String getDisplayName()
Returns the display name of this SipAddress. This is typically a caller or callees real name and may be rendered by a user agent, for example when alerting.
Returns:
display name of this SipAddress, or null if one doesn't exist

setDisplayName

public void setDisplayName(java.lang.String name)
Sets the display name of this SipAddress.
Parameters:
name - display name
Throws:
java.lang.IllegalStateException - if this SipAddress is used in a context where it cannot be modified

getURI

public URI getURI()
Returns the URI component of this SipAddress. This will always be non-null.
Returns:
the URI of this SipAddress

setURI

public void setURI(URI uri)
Sets the URI of this SipAddress.
Parameters:
uri - new URI of this SipAddress
Throws:
java.lang.IllegalStateException - if this SipAddress is used in a context where it cannot be modified

getParameter

public java.lang.String getParameter(java.lang.String name)
Returns the value of the specified parameter. A zero-length String indicates flag parameter.
Parameters:
name - the name of the parameter
Returns:
the value of the specified parameter

setParameter

public void setParameter(java.lang.String name,
                         java.lang.String value)
Sets the value of the specified parameter. A zero-length String indicates flag parameter.
Parameters:
name - parameter name
value - parameter value
Throws:
java.lang.IllegalStateException - if this SipAddress is used in a context where it cannot be modified

removeParameter

public void removeParameter(java.lang.String name)
Removes the parameter with the specified name.
Parameters:
name - parameter name
Throws:
java.lang.IllegalStateException - if this SipAddress is used in a context where it cannot be modified

getParameterNames

public java.util.Iterator getParameterNames()
Returns an Iterator over the set of all parameters of this address.
Returns:
an Iterator over the set of String objects that are the names of parameters of this SipAddress

toString

public java.lang.String toString()
Returns the value of this address as a String. The resulting string must be a valid value of a SIP From or To header.
Overrides:
toString in class java.lang.Object
Returns:
value of this SipAddress as a String

clone

public java.lang.Object clone()
Returns a clone of this SipAddress. The cloned SipAddress has identical display name, URI, and parameters, except that it has no tag parameter. This means the cloned address can be used as an argument to SipFactory.createRequest.
Overrides:
clone in class java.lang.Object
Returns:
a clone of this SipAddress