org.lastbamboo.common.sip.stack.util
Interface UriUtils

All Known Implementing Classes:
UriUtilsImpl

public interface UriUtils

Some utilities for working with URIs and SIP URIs.


Method Summary
 String getHostInSipUri(URI sipUri)
          Returns the host portion of a SIP URI (in the form of an opaque java.net.URI).
 int getPersonIdInSipUri(URI sipUri)
          Returns the user portion of a SIP URI (in the form of an opaque java.net.URI) as a Little Shoot person identifier.
 int getPortInSipUri(URI uri)
          Extracts the port from a SIP URI.
 URI getSipUri(String host)
          Returns a SIP URI for a given host of the form "sip:host".
 URI getSipUri(String host, int port)
          Returns a SIP URI for a given host and port of the form "sip:host:port".
 URI getSipUri(String host, int port, String transport)
          Returns a SIP URI for a given host and port of the form "sip:host:port".
 URI getUri(String uriString)
          Returns a URI from a string.
 URI getUriForHost(String host)
          Returns a URI from a host.
 URI getUriWithPort(URI uri, int port)
          Returns a URI with a modified port.
 String getUserInSipUri(URI sipUri)
          Returns the user portion of a SIP URI (in the form of an opaque java.net.URI).
 

Method Detail

getUri

URI getUri(String uriString)
Returns a URI from a string.

Parameters:
uriString - The string containing a URI-formatting string.
Returns:
The URI represented by the passed string.

getUriForHost

URI getUriForHost(String host)
Returns a URI from a host.

Parameters:
host - The host.
Returns:
The URI representing the given host.

getSipUri

URI getSipUri(String host)
Returns a SIP URI for a given host of the form "sip:host".

Parameters:
host - The host.
Returns:
A URI for the given scheme, host, and port.

getSipUri

URI getSipUri(String host,
              int port)
Returns a SIP URI for a given host and port of the form "sip:host:port".

Parameters:
host - The host.
port - The port.
Returns:
A URI for the given scheme, host, and port.

getSipUri

URI getSipUri(String host,
              int port,
              String transport)
Returns a SIP URI for a given host and port of the form "sip:host:port".

Parameters:
host - The host.
port - The port.
transport - The transport to be used to connect.
Returns:
A URI for the given scheme, host, and port.

getUriWithPort

URI getUriWithPort(URI uri,
                   int port)
Returns a URI with a modified port.

Parameters:
uri - The original URI.
port - The new port.
Returns:
The URI with the new port.

getUserInSipUri

String getUserInSipUri(URI sipUri)
Returns the user portion of a SIP URI (in the form of an opaque java.net.URI).

Parameters:
sipUri - The URI.
Returns:
The user portion of the SIP URI.

getHostInSipUri

String getHostInSipUri(URI sipUri)
Returns the host portion of a SIP URI (in the form of an opaque java.net.URI).

Parameters:
sipUri - The URI.
Returns:
The host portion of the SIP URI.

getPersonIdInSipUri

int getPersonIdInSipUri(URI sipUri)
Returns the user portion of a SIP URI (in the form of an opaque java.net.URI) as a Little Shoot person identifier.

Parameters:
sipUri - The URI.
Returns:
The user portion of the SIP URI as a Little Shoot person identifier..

getPortInSipUri

int getPortInSipUri(URI uri)
Extracts the port from a SIP URI. If the URI does not specify a port, this returns the default port, such as 5060 for sip: URIs and 5061 for sips: URIs.

Parameters:
uri - The URI to extract the port from.
Returns:
The port in the SIP URI, or the default port if it is not specified.


Copyright © 2013 LittleShoot. All Rights Reserved.