org.mobicents.servlet.sip.address
Class AddressImpl

java.lang.Object
  extended by org.mobicents.servlet.sip.address.ParameterableImpl
      extended by org.mobicents.servlet.sip.address.AddressImpl
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Address, Parameterable

public class AddressImpl
extends ParameterableImpl
implements Address, java.io.Serializable

Implementation of Servlet Address specification.

Author:
mranga, bartek
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mobicents.servlet.sip.address.ParameterableImpl
header, isModifiable, parameters
 
Constructor Summary
AddressImpl()
           
AddressImpl(javax.sip.address.Address address, java.util.Map<java.lang.String,java.lang.String> parameters, boolean isModifiable)
           
AddressImpl(javax.sip.header.HeaderAddress header, boolean modifiable)
          Creates instance of Address object.
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
           
 javax.sip.address.Address getAddress()
           
 java.lang.String getDisplayName()
           
 int getExpires()
           
static java.util.Map<java.lang.String,java.lang.String> getParameters(javax.sip.header.Parameters headerParams)
           
 float getQ()
           
 URI getURI()
           
 java.lang.String getValue()
           
 int hashCode()
           
 boolean isWildcard()
           
 void setAddress(javax.sip.address.Address address)
           
 void setDisplayName(java.lang.String name)
           
 void setExpires(int seconds)
           
 void setParameter(java.lang.String name, java.lang.String value)
           
 void setQ(float q)
           
 void setURI(URI uri)
           
 void setValue(java.lang.String value)
           
 java.lang.String toString()
           
 
Methods inherited from class org.mobicents.servlet.sip.address.ParameterableImpl
getInternalParameters, getParameter, getParameterNames, getParameters, removeParameter, setParameters
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.servlet.sip.Parameterable
getParameter, getParameterNames, getParameters, removeParameter
 

Constructor Detail

AddressImpl

public AddressImpl()

AddressImpl

public AddressImpl(javax.sip.address.Address address,
                   java.util.Map<java.lang.String,java.lang.String> parameters,
                   boolean isModifiable)

AddressImpl

public AddressImpl(javax.sip.header.HeaderAddress header,
                   boolean modifiable)
            throws java.text.ParseException
Creates instance of Address object. This object is valid representation of SIP AddressHeader, like To, From, Contact. Input to create this object HAS to be string that conforms to sip(s) uri schema. Methods exposed by this object act on header part of address. Parameter methods modify header parameters, not uri parameters.

Parameters:
addressString - - string representing header, it has to conform to rfc 3261 sip(s) uri scheme, see chapter 19 and specification of To/From header.
Passed values must look like followin:
  • <sip:ala@ma.kota>
  • sip:ala@ma.kota
  • <sip:ala@ma.kota;somePName=somePValue;someP2Name=V2>headerParam1=Value1;headerParam2=V2
  • <sip:ala@ma.kota>headerParam1=Value1;headerParam2=V2
  • "Kazik Staszewski" <sip:ala@ma.kota;somePName=somePValue;someP2Name=V2>headerParam1=Value1;headerParam2=V2
  • "Kazik Staszewski" <sip:ala@ma.kota>headerParam1=Value1;headerParam2=V2
Throws:
java.text.ParseException
Method Detail

getAddress

public javax.sip.address.Address getAddress()

getDisplayName

public java.lang.String getDisplayName()
Specified by:
getDisplayName in interface Address

getExpires

public int getExpires()
Specified by:
getExpires in interface Address

getQ

public float getQ()
Specified by:
getQ in interface Address

getURI

public URI getURI()
Specified by:
getURI in interface Address

isWildcard

public boolean isWildcard()
Specified by:
isWildcard in interface Address

setDisplayName

public void setDisplayName(java.lang.String name)
Specified by:
setDisplayName in interface Address

setExpires

public void setExpires(int seconds)
                throws java.lang.IllegalArgumentException
Specified by:
setExpires in interface Address
Throws:
java.lang.IllegalArgumentException

setQ

public void setQ(float q)
Specified by:
setQ in interface Address

setURI

public void setURI(URI uri)
Specified by:
setURI in interface Address

clone

public java.lang.Object clone()
Specified by:
clone in interface Address
Specified by:
clone in interface Parameterable
Specified by:
clone in class ParameterableImpl

toString

public java.lang.String toString()
Specified by:
toString in interface Address
Overrides:
toString in class ParameterableImpl

getValue

public java.lang.String getValue()
Specified by:
getValue in interface Parameterable

setValue

public void setValue(java.lang.String value)
Specified by:
setValue in interface Parameterable

setAddress

public void setAddress(javax.sip.address.Address address)

setParameter

public void setParameter(java.lang.String name,
                         java.lang.String value)
Specified by:
setParameter in interface Parameterable
Overrides:
setParameter in class ParameterableImpl

hashCode

public int hashCode()
Overrides:
hashCode in class ParameterableImpl

equals

public boolean equals(java.lang.Object obj)
Specified by:
equals in interface Address
Specified by:
equals in interface Parameterable
Overrides:
equals in class ParameterableImpl

getParameters

public static final java.util.Map<java.lang.String,java.lang.String> getParameters(javax.sip.header.Parameters headerParams)


Copyright © 2009. All Rights Reserved.