org.apache.activemq.util
Class URISupport

Utility class that provides methods for parsing URI's
This class can be used to split composite URI's into their component parts and is used to extract any
URI options from each URI in order to set specific properties on Beans.

Nested Class Summary

static class

URISupport.CompositeData
A composite URI can be split into one or more CompositeData object which each represent the
individual URIs that comprise the composite one.

applyParameters(URI uri,
Map<String,String> queryParameters)
Given a Key / Value mapping create and append a URI query value that represents the mapped entries, return the
newly updated URI that contains the value of the given URI and the appended query value.

applyParameters(URI uri,
Map<String,String> queryParameters,
String optionPrefix)
Given a Key / Value mapping create and append a URI query value that represents the mapped entries, return the
newly updated URI that contains the value of the given URI and the appended query value.

parseParameters

Given a URI parse and extract any URI query options and return them as a Key / Value mapping.
This method differs from the parseQuery method in that it handles composite URI types and
will extract the URI options from the outermost composite URI.

applyParameters

Given a Key / Value mapping create and append a URI query value that represents the mapped entries, return the
newly updated URI that contains the value of the given URI and the appended query value. Each entry in the query
string is prefixed by the supplied optionPrefix string.

Parameters:

uri - The source URI that will have the Map entries appended as a URI query value.

queryParameters - The Key / Value mapping that will be transformed into a URI query string.

optionPrefix - A string value that when not null or empty is used to prefix each query option key.

Returns:

A new URI value that combines the given URI and the constructed query string.

createRemainingURI

Creates a URI from the original URI and the remaining parameters.
When the query options of a URI are applied to certain objects the used portion of the query options needs
to be removed and replaced with those that remain so that other parts of the code can attempt to apply the
remainder or give an error is unknown values were given. This method is used to update a URI with those
remainder values.

Parameters:

originalURI - The URI whose current parameters are remove and replaced with the given remainder value.

params - The URI params that should be used to replace the current ones in the target.

Returns:

a new URI that matches the original one but has its query options replaced with the given ones.