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

gov.nist.javax.sip.address
Class AddressFactoryImpl

java.lang.Object
  extended by gov.nist.javax.sip.address.AddressFactoryImpl
All Implemented Interfaces:
AddressFactory

public class AddressFactoryImpl
extends Object
implements AddressFactory

Implementation of the JAIN-SIP address factory.

Version:
1.2 $Revision: 1.8 $ $Date: 2009/07/17 18:57:21 $
Author:
M. Ranganathan
IPv6 Support added by Emil Ivov (emil_ivov@yahoo.com)
Network Research Team (http://www-r2.u-strasbg.fr))
Louis Pasteur University - Strasbourg - France

Constructor Summary
AddressFactoryImpl()
          Creates a new instance of AddressFactoryImpl
 
Method Summary
 Address createAddress()
          Create an empty address object.
 Address createAddress(String address)
          Creates an Address with the new address string value.
 Address createAddress(String displayName, URI uri)
          Creates an Address with the new display name and URI attribute values.
 Address createAddress(URI uri)
          Creates an Address with the new URI attribute value.
 SipURI createSipURI(String uri)
          create a sip uri.
 SipURI createSipURI(String user, String host)
          Create a SipURI
 TelURL createTelURL(String uri)
          Creates a TelURL based on given URI string.
 URI createURI(String uri)
          Creates a URI based on given URI string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddressFactoryImpl

public AddressFactoryImpl()
Creates a new instance of AddressFactoryImpl

Method Detail

createAddress

public Address createAddress()
Create an empty address object. SPEC_REVISION


createAddress

public Address createAddress(String displayName,
                             URI uri)
Creates an Address with the new display name and URI attribute values.

Specified by:
createAddress in interface AddressFactory
Parameters:
displayName - - the new string value of the display name of the address. A null value does not set the display name.
uri - - the new URI value of the address.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the displayName value.

createSipURI

public SipURI createSipURI(String uri)
                    throws ParseException
create a sip uri.

Parameters:
uri - -- the uri to parse.
Throws:
ParseException

createSipURI

public SipURI createSipURI(String user,
                           String host)
                    throws ParseException
Create a SipURI

Specified by:
createSipURI in interface AddressFactory
Parameters:
user - -- the user
host - -- the host.
Throws:
ParseException - if the URI string is malformed.

createTelURL

public TelURL createTelURL(String uri)
                    throws ParseException
Creates a TelURL based on given URI string. The scheme or '+' should not be included in the phoneNumber string argument.

Specified by:
createTelURL in interface AddressFactory
Parameters:
uri - - the new string value of the phoneNumber.
Throws:
URISyntaxException - if the URI string is malformed.
ParseException - if the URI string is malformed.

createAddress

public Address createAddress(URI uri)
Description copied from interface: AddressFactory
Creates an Address with the new URI attribute value.

Specified by:
createAddress in interface AddressFactory
Parameters:
uri - - the URI value of the address.

createAddress

public Address createAddress(String address)
                      throws ParseException
Creates an Address with the new address string value. The address string is parsed in order to create the new Address instance. Create with a String value of "*" creates a wildcard address. The wildcard can be determined if ((SipURI)Address.getURI).getUser() == *;.

Specified by:
createAddress in interface AddressFactory
Parameters:
address - - the new string value of the address.
Throws:
ParseException - which signals that an error has been reached unexpectedly while parsing the address value.

createURI

public URI createURI(String uri)
              throws ParseException
Creates a URI based on given URI string. The URI string is parsed in order to create the new URI instance. Depending on the scheme the returned may or may not be a SipURI or TelURL cast as a URI.

Specified by:
createURI in interface AddressFactory
Parameters:
uri - - the new string value of the URI.
Throws:
URISyntaxException - if the URI string is malformed.
ParseException - if the URI string is malformed.

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.