NIST SIP Parser and Stack (v1.2) API

javax.sip.address
Interface AddressFactory

All Known Implementing Classes:
AddressFactoryImpl

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().

Version:
1.1
Author:
Sun Microsystems

Method Summary
 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 user, String host)
          Creates a SipURI based on the given user and host components.
 TelURL createTelURL(String phoneNumber)
          Creates a TelURL based on given URI string.
 URI createURI(String uri)
          Creates a URI based on given URI string.
 

Method Detail

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.

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

createSipURI

public SipURI createSipURI(String user,
                           String host)
                    throws 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:
ParseException - if the URI string is malformed.

createTelURL

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

Throws:
ParseException - if the URI string is malformed.

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() == *;.

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.

createAddress

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

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

createAddress

public Address createAddress(String displayName,
                             URI uri)
                      throws 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:
ParseException - which signals that an error has been reached unexpectedly while parsing the displayName value.

NIST SIP Parser and Stack (v1.2) API

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