Version

URI Interface

The URI interface serves as the foundational type for all URI representations used in SIP Servlet applications. These URIs are appearing in the request line to identify the callee and in headers such as Contact, From, and To. A URI begins with a scheme identifier, such as sip, sips, or tel, followed by a colon and a scheme-specific part, adhering to the syntax defined in RFC 2396. The interface provides the base functionality for handling and manipulating URIs in SIP messages, ensuring compatibility with various schemes while maintaining a consistent format. Specific implementations, like SipURI and TelURL, extend the URI interface to provide more specialized behaviors for different schemes.

Methods:

getScheme

java.lang.String getScheme()

The getScheme method retrieves the scheme component of this URI. The scheme indicates the type of URI, such as sip, sips, or tel, which determines how the URI is interpreted and used within SIP communication.
Returns: A String representing the scheme of the URI. For example, "sip", "sips", or "tel".

toString

java.lang.String toString()

The toString method returns the full string representation of this URI. The resulting string is appropriately URL-escaped, ensuring that all reserved characters are correctly encoded for use.
Overrides:
toString in class java.lang.Object
Returns: A String containing the escaped value of this URI.

isSipURI

boolean isSipURI()

The isSipURI method checks whether the scheme of this URI is sip or sips, identifying it as a SIP-specific URI.
Returns: true if the scheme is "sip" or "sips", and false if the scheme is any other value.

getParameter

java.lang.String getParameter(java.lang.String key)

The getParameter method retrieves the value of a specified parameter associated with this URI. If the parameter is not set, the method returns null. A zero-length string as the value indicates that the parameter is a flag.
Parameters:
key: A String specifying the name of the parameter to retrieve.
Returns:
The value of the specified parameter as a String.
null if the parameter is not set.
A zero-length string if the parameter is a flag.
Throws:
java.lang.NullPointerException if the key is null.

setParameter

void setParameter(java.lang.String name,
                  java.lang.String value)

The setParameter method sets or updates the value of a specified parameter associated with this URI. If a parameter with the given name already exists, its value is replaced with the new one. To set a flag parameter, provide a zero-length string as the value.
Parameters:
name: A String specifying the name of the parameter to set.
value: A String specifying the new value for the parameter. A zero-length string indicates a flag parameter.
Throws:
java.lang.NullPointerException if either name or value is null.

removeParameter

void removeParameter(java.lang.String name)

The removeParameter method deletes the specified parameter from this URI. If the parameter does not exist, no changes are made.
Parameters:
name: A String specifying the name of the parameter to be removed.

getParameterNames

java.util.Iterator<java.lang.String> getParameterNames()

The getParameterNames method provides an iterator over all parameter names present in this URI. Each parameter name is returned as a String in the order they appear in the URI.
Returns: An Iterator of String objects representing the parameter names in this URI.

equals

boolean equals(java.lang.Object o)

The equals method compares the given URI object with this URI to determine if they are equal. The comparison follows the specific rules defined for the scheme of the URI. For generic URIs, the comparison adheres to the guidelines in RFC 2396. For URIs with schemes that have additional comparison rules specified in their respective standards, those rules are applied.
Overrides:
equals in class java.lang.Object
Parameters:
o - The URI object to compare with this URI.
Returns: true if the two URI objects are considered equal based on the rules of their respective specifications. false otherwise.

clone

URI clone()

The clone method creates and returns a duplicate of this URI object. The cloned URI will have the same scheme, parameters, and other components as the original.
Returns: A URI object that is a clone of this URI.

Start innovating with Mobius

What's next? Let's talk!

Mobius Software

As a company you'll get:

  • Get started quickly

  • Support any business model

  • Join millions of businesses

Questions? websupport@mobius.com