Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unpublished - rights reserved under the Copyright Laws of the United States. Copyright � 2003 Sun Microsystems, Inc. All rights reserved. Copyright � 2005 BEA Systems, Inc. All rights reserved. Use is subject to license terms. This distribution may include materials developed by third parties. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Module Name : JSIP Specification File Name : AddressFactory.java Author : Phelim O'Doherty HISTORY Version Date Author Comments 1.1 08/10/2002 Phelim O'Doherty Initial version ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 package javax.sip.address;
 
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 javax.sip.SipFactory.createAddressFactory().

Author(s):
BEA Systems, NIST
Version:
1.2
 
 public interface AddressFactory {

    
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.
 
     public URI createURI(String urithrows 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:

  • Initially, the result string is empty.
  • The scheme followed by a colon character ('sip:') is appended to the result.
  • The user and host are then appended. Any character that is not a legal URI character is quoted.

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.
 
     public SipURI createSipURI(String userString host
                                 throws 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.
 
     public TelURL createTelURL(String phoneNumberthrows 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 <sip:bob@biloxi.com>". 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.
 
    public Address createAddress(String addressthrows ParseException;

    
Creates an Address with the new URI attribute value.

Parameters:
uri - the URI value of the address.
    public Address createAddress(URI uri);
    
    
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.
    public Address createAddress(String displayNameURI urithrows ParseException;
    
    
New to GrepCode? Check out our FAQ X