com.novell.sentinel.uri
Interface UriConstructor

All Known Implementing Classes:
GenericURI

public interface UriConstructor

Interface to allow REST services to construct URIs on behalf of DataObject serialization for REST.


Method Summary
 UriConstructor appendPath(Collection<String> components)
          Append a path to any existing path.
 UriConstructor appendPath(String path)
          Append a path to any existing path.
 UriConstructor appendPathComponent(String pathComponent)
          Append a single component of the path to any existing path.
 UriConstructor setFragment(String fragment)
          Set the fragment portion of the URI.
 UriConstructor setHost(String host)
          Set the host part of the URI authority (e.g., www.novell.com).
 UriConstructor setPort(int port)
          Set the port part of the URI authority (e.g., 8443).
 UriConstructor setQueryItem(String key, Iterable<String> values)
          Set a query item and optional values.
 UriConstructor setQueryItem(String key, String... values)
          Set a query item and optional values.
 UriConstructor setScheme(String scheme)
          Set the URI scheme (e.g., "https").
 UriConstructor setUserInfo(String userInfo)
          Set any user information for the URI.
 String toString()
          Return the string representation of the constructed URI.
 

Method Detail

setScheme

UriConstructor setScheme(String scheme)
Set the URI scheme (e.g., "https").

Parameters:
scheme - The scheme name
Returns:
This instance.

setUserInfo

UriConstructor setUserInfo(String userInfo)
Set any user information for the URI.

Parameters:
userInfo - The user information string.
Returns:
This instance.

setHost

UriConstructor setHost(String host)
Set the host part of the URI authority (e.g., www.novell.com).

Parameters:
host - The host string.
Returns:
This instance.

setPort

UriConstructor setPort(int port)
Set the port part of the URI authority (e.g., 8443).

Parameters:
port - The port value.
Returns:
This instance.

appendPath

UriConstructor appendPath(String path)
Append a path to any existing path. Any components are separated by '/'. This means that path components with embedded '/' characters cannot be property appended with this method (@see appendPathComponent(String)appendPathComponent).

Parameters:
path - The path string.
Returns:
This instance.

appendPath

UriConstructor appendPath(Collection<String> components)
Append a path to any existing path.

Parameters:
components - A collection of components. The components will be appended in the order returned by the Iterator returned by components.iterator().
Returns:
This instance.

appendPathComponent

UriConstructor appendPathComponent(String pathComponent)
Append a single component of the path to any existing path. This method handles path components with embedded '/' characters in the component value.

Parameters:
pathComponent - The component value.
Returns:
This instance.

setQueryItem

UriConstructor setQueryItem(String key,
                            String... values)
Set a query item and optional values.

Parameters:
key - The name of the query item (e.g., "field" or "query").
values - The value(s) for the query item.
Returns:
This instance.

setQueryItem

UriConstructor setQueryItem(String key,
                            Iterable<String> values)
Set a query item and optional values.

Parameters:
key - The name of the query item (e.g., "field" or "query").
values - The value(s) for the query item.
Returns:
This instance.

setFragment

UriConstructor setFragment(String fragment)
Set the fragment portion of the URI.

Parameters:
fragment - The fragment string (not including the '#').
Returns:
This instance.

toString

String toString()
Return the string representation of the constructed URI.

Overrides:
toString in class Object
Returns:
The URI string.