activemq-cpp-3.9.0
activemq::util::URISupport Class Reference

#include <src/main/activemq/util/URISupport.h>

Static Public Member Functions

static bool isCompositeURI (const decaf::net::URI &uri)
 Examine a URI and determine if it is a Composite type or not. More...
 
static void parseURL (const std::string &URI, decaf::util::Properties &properties)
 Parses the properties out of the provided Broker URI and sets them in the passed Properties Object. More...
 
static CompositeData parseComposite (const URI &uri)
 Parses a Composite URI into a Composite Data instance, the Composite URI takes the for scheme://(uri1,uri2,...uriN)?param1=value1, each of the composite URIs is stored in the CompositeData's internal list. More...
 
static decaf::util::Properties parseQuery (std::string query)
 Parse the Query portion of a URI String and return a Simple Properties object containing the parameter names as keys, and the parameter values and values of the Properties. More...
 
static void parseQuery (std::string query, decaf::util::Properties *properties)
 Parse the Query portion of a URI String and return a Simple Properties object containing the parameter names as keys, and the parameter values and values of the Properties. More...
 
static std::string createQueryString (const Properties &options)
 Given a properties object create a string that can be appended to a URI as a valid Query string. More...
 
static decaf::util::Properties parseParameters (const decaf::net::URI &uri)
 Given a URI parse and extract any URI query options and return them as a Key / Value mapping. More...
 
static decaf::net::URI applyParameters (const decaf::net::URI &uri, const decaf::util::Properties &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. More...
 
static decaf::net::URI applyParameters (const decaf::net::URI &uri, const decaf::util::Properties &queryParameters, const std::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. More...
 
static decaf::net::URI createURIWithQuery (const decaf::net::URI &uri, const std::string &query)
 Creates a URI with the given query, removing an previous query value from the given URI. More...
 
static void parseComposite (const URI &uri, CompositeData &rc, const std::string &ssp)
 Perform a parse on the given composite URI, placing the results in the passed CompositeData. More...
 
static decaf::util::LinkedList
< std::string > 
splitComponents (const std::string &str)
 Splits all the Component URIs in a Composite URI into individual strings which can then be parsed separately and stored in a Composite Data object. More...
 
static decaf::net::URI stripScheme (const decaf::net::URI &uri)
 Strip a URI of its scheme element. More...
 
static std::string stripPrefix (const std::string &value, const std::string &prefix)
 Given a string value and a prefix value, return a new string that has the prefix removed if it was part of the passed in string, otherwise just return the passed in string. More...
 
static bool checkParenthesis (const std::string &str)
 Matches all opening and closing parenthesis in a String. More...
 
static std::string replaceEnvValues (const std::string &value)
 Accepts a string value and checks to see if that value is of the form ${XXX} which is our accepted form for environment variables. More...
 

Member Function Documentation

static decaf::net::URI activemq::util::URISupport::applyParameters ( const decaf::net::URI uri,
const decaf::util::Properties queryParameters 
)
static

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.

Parameters
uriThe source URI that will have the Map entries appended as a URI query value.
queryParametersThe Key / Value mapping that will be transformed into a URI query string.
Returns
A new URI value that combines the given URI and the constructed query string.
Exceptions
URISyntaxExceptionif an invalid URI is created during this operation.
static decaf::net::URI activemq::util::URISupport::applyParameters ( const decaf::net::URI uri,
const decaf::util::Properties queryParameters,
const std::string &  optionPrefix 
)
static

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
uriThe source URI that will have the Map entries appended as a URI query value.
queryParametersThe Key / Value mapping that will be transformed into a URI query string.
optionPrefixA 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.
Exceptions
URISyntaxExceptionif an invalid URI is created during this operation.
static bool activemq::util::URISupport::checkParenthesis ( const std::string &  str)
static

Matches all opening and closing parenthesis in a String.

Parameters
str- The String to match parenthesis in.
Returns
true if all parenthesis have valid open and close values.
static std::string activemq::util::URISupport::createQueryString ( const Properties options)
static

Given a properties object create a string that can be appended to a URI as a valid Query string.

Parameters
optionsProperties object containing key / value query values.
Returns
a valid URI query string.
Exceptions
URISyntaxExceptionif the string in the Properties object can't be encoded into a valid URI Query string.
static decaf::net::URI activemq::util::URISupport::createURIWithQuery ( const decaf::net::URI uri,
const std::string &  query 
)
static

Creates a URI with the given query, removing an previous query value from the given URI.

Parameters
uriThe source URI whose existing query is replaced with the newly supplied one.
queryThe new URI query string that should be appended to the given URI.
Returns
a new URI that is a combination of the original URI and the given query string.
Exceptions
URISyntaxException
static bool activemq::util::URISupport::isCompositeURI ( const decaf::net::URI uri)
static

Examine a URI and determine if it is a Composite type or not.

Parameters
uriThe URI that is to be examined.
Returns
true if the given URI is a Composite type.
static CompositeData activemq::util::URISupport::parseComposite ( const URI uri)
static

Parses a Composite URI into a Composite Data instance, the Composite URI takes the for scheme://(uri1,uri2,...uriN)?param1=value1, each of the composite URIs is stored in the CompositeData's internal list.

Parameters
uri- The Composite URI to parse.
Returns
a new CompositeData object with the parsed data
Exceptions
URISyntaxExceptionif the URI is not well formed.
static void activemq::util::URISupport::parseComposite ( const URI uri,
CompositeData rc,
const std::string &  ssp 
)
static

Perform a parse on the given composite URI, placing the results in the passed CompositeData.

Parameters
uri- The URI to parse
rc- The CompositeData object to Populate
ssp- the Scheme Specific Part from the original URI.
Exceptions
URISyntaxExceptionif the URI is not well formed.
static decaf::util::Properties activemq::util::URISupport::parseParameters ( const decaf::net::URI uri)
static

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.

Parameters
uriThe URI whose query should be extracted and processed.
Returns
A Mapping of the URI options.
Exceptions
URISyntaxExceptionif the passed in URI contains invalid elements.
static decaf::util::Properties activemq::util::URISupport::parseQuery ( std::string  query)
static

Parse the Query portion of a URI String and return a Simple Properties object containing the parameter names as keys, and the parameter values and values of the Properties.

Parameters
queryThe query string to parse and extract the encoded properties.
Returns
Properties object with the parsed output.
Exceptions
IllegalArgumentExceptionif the Query string is not well formed.
static void activemq::util::URISupport::parseQuery ( std::string  query,
decaf::util::Properties properties 
)
static

Parse the Query portion of a URI String and return a Simple Properties object containing the parameter names as keys, and the parameter values and values of the Properties.

Parameters
query- the query string to parse.
properties- object pointer to get the parsed output.
Exceptions
IllegalArgumentExceptionif the Query string is not well formed.
static void activemq::util::URISupport::parseURL ( const std::string &  URI,
decaf::util::Properties properties 
)
static

Parses the properties out of the provided Broker URI and sets them in the passed Properties Object.

Parameters
URIa Broker URI to parse
propertiesa Properties object to set the parsed values in
Exceptions
IllegalArgumentExceptionif the passed URI is invalid
static std::string activemq::util::URISupport::replaceEnvValues ( const std::string &  value)
static

Accepts a string value and checks to see if that value is of the form ${XXX} which is our accepted form for environment variables.

If so the we attempt to replace the value with what is stored in that env var, if the var is not set then we throw an IllegalArgumentException.

Parameters
value- the value to check for env
Returns
the env var if value points to an env var else returns value
Exceptions
IllegalArgumentExceptionif the var is not set or has bad syntax
static decaf::util::LinkedList<std::string> activemq::util::URISupport::splitComponents ( const std::string &  str)
static

Splits all the Component URIs in a Composite URI into individual strings which can then be parsed separately and stored in a Composite Data object.

Parameters
str- the set of Composite URIs
static std::string activemq::util::URISupport::stripPrefix ( const std::string &  value,
const std::string &  prefix 
)
static

Given a string value and a prefix value, return a new string that has the prefix removed if it was part of the passed in string, otherwise just return the passed in string.

Parameters
value- String to strip
prefix- value to strip from the passed in string
Returns
the new string with prefix removed.
static decaf::net::URI activemq::util::URISupport::stripScheme ( const decaf::net::URI uri)
static

Strip a URI of its scheme element.

Parameters
uriThe URI whose scheme value should be stripped.
Returns
The stripped URI value.
Exceptions
URISyntaxException

The documentation for this class was generated from the following file: