JSIP API v1.2
November 2006

javax.sip.address
Interface AddressFactory


public interface AddressFactory

This interface provides factory methods that allow an application to create Address objects, URI's, SipURI's and TelURL's from a particular implementation of this specification. This class is a singleton and can be retrieved from the SipFactory.createAddressFactory().

Author:
BEA Systems, NIST

Method Summary
 Address createAddress(java.lang.String address)
          Creates an Address with the new address string value.
 Address createAddress(java.lang.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(java.lang.String user, java.lang.String host)
          Creates a SipURI based on the given user and host components.
 TelURL createTelURL(java.lang.String phoneNumber)
          Creates a TelURL based on given URI string.
 URI createURI(java.lang.String uri)
          Creates a URI based on given URI string.
 

Method Detail

createURI

URI createURI(java.lang.String uri)
              throws java.text.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.

Parameters:
uri - - the new string value of the URI.
Throws:
java.text.ParseException - if the URI string is malformed.

createSipURI

SipURI createSipURI(java.lang.String user,
                    java.lang.String host)
                    throws java.text.ParseException
Creates a SipURI based on the given user and host components. The user component may be null.

This create method first builds a URI in string form using the given components as follows:


The resulting URI string is then parsed in order to create the new SipURI instance as if by invoking the createURI(String) constructor; this may cause a URISyntaxException to be thrown.

An application that wishes to create a 'sips' URI should call the SipURI.setSecure(boolean) with an argument of 'true' on the returned SipURI.

Parameters:
user - - the new string value of the user, this value may be null.
host - - the new string value of the host.
Throws:
java.text.ParseException - if the URI string is malformed.

createTelURL

TelURL createTelURL(java.lang.String phoneNumber)
                    throws java.text.ParseException
Creates a TelURL based on given URI string. The scheme should not be included in the phoneNumber string argument.

Parameters:
phoneNumber - the new string value of the phoneNumber.
Throws:
java.text.ParseException - if the URI string is malformed.

createAddress

Address createAddress(java.lang.String address)
                      throws java.text.ParseException
Creates an Address with the new address string value. The address string is parsed in order to create the new Address instance. Valid arguments obey the syntax for name-addr tokens in RFC3261, for example "Bob ". It is recommended to use the to use the name-addr form containing '<' '>' to avoid confusion of URI parameters. As a special case, the string argument "*" creates a wildcard Address object with the property that ((SipURI)Address.getURI()).getUser() returns a String contain one character "*".

Parameters:
address - - the new string value of the address.
Throws:
java.text.ParseException - which signals that an error has been reached unexpectedly while parsing the address value.

createAddress

Address createAddress(URI uri)
Creates an Address with the new URI attribute value.

Parameters:
uri - - the URI value of the address.

createAddress

Address createAddress(java.lang.String displayName,
                      URI uri)
                      throws java.text.ParseException
Creates an Address with the new display name and URI attribute values.

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:
java.text.ParseException - which signals that an error has been reached unexpectedly while parsing the displayName value.

JSIP API v1.2
November 2006

If you have any comments, please mail them to JAIN-SIP-INTEREST@java.sun.com after subscribing at http://archives.java.sun.com
Copyright - 2006 BEA Systems and Sun Microsystems