javax.servlet.sip
Interface URI

All Superinterfaces:
Cloneable
All Known Subinterfaces:
SipURI, TelURL

public interface URI
extends Cloneable

Base interface for any type of URI. These are used in the request line of SIP requests to identify the callee and also in Contact, From, and To headers. The only feature common to all URIs is that they can be represented as strings beginning with a token identifying the scheme of the URI followed by a colon followed by a scheme-specific part. The generic syntax of URIs is defined in RFC 2396.


Method Summary
 URI clone()
          Returns a clone of this URI.
 boolean equals(Object o)
          Compares the given URI with this URI.
 String getParameter(String key)
          Returns the value of the named parameter, or null if it is not set.
 Iterator<String> getParameterNames()
          Returns an Iterator over the names of all parameters present in this URI.
 String getScheme()
          Returns the scheme of this URI, for example "sip", "sips" or "tel".
 boolean isSipURI()
          Returns true if the scheme is "sip" or "sips", false otherwise.
 void removeParameter(String name)
          Removes the named parameter from this URL.
 void setParameter(String name, String value)
          Sets the value of the named parameter.
 String toString()
          Returns the value of this URI as a String.
 

Method Detail

clone

URI clone()
Returns a clone of this URI.

Returns:
URI a clone of this URI object

equals

boolean equals(Object o)
Compares the given URI with this URI. The comparison rules to be followed shall depend upon the underlying URI scheme being used. For general purpose URIs RFC 2396 should be consulted for equality. If the URIs are of scheme for which comparison rules are further specified in their specications, then they must be used for any comparison.

Overrides:
equals in class Object

getParameter

String getParameter(String key)
Returns the value of the named parameter, or null if it is not set. A zero-length String indicates flag parameter.


getParameterNames

Iterator<String> getParameterNames()
Returns an Iterator over the names of all parameters present in this URI.


getScheme

String getScheme()
Returns the scheme of this URI, for example "sip", "sips" or "tel".


isSipURI

boolean isSipURI()
Returns true if the scheme is "sip" or "sips", false otherwise.


removeParameter

void removeParameter(String name)
Removes the named parameter from this URL. Nothing is done if the URL did not already contain the specific parameter.


setParameter

void setParameter(String name,
                  String value)
Sets the value of the named parameter. If this URL previously contained a value for the given parameter name, then the old value is replaced by the specified value. The setting of a flag parameter is indicated by specifying a zero-length String for the parameter value.


toString

String toString()
Returns the value of this URI as a String. The result must be appropriately URL escaped.

Overrides:
toString in class Object


Copyright © 2012. All Rights Reserved.