xmltooling::GenericRequest Class Referenceabstract

Interface to generic protocol requests that transport XML messages. More...

`#include <xmltooling/io/GenericRequest.h>`

Inheritance diagram for xmltooling::GenericRequest:

## Public Member Functions

virtual const char * | getScheme () const =0
| Returns the URL scheme of the request (http, https, ftp, ldap, etc.)
virtual bool | isSecure () const =0
| Returns true iff the request is over a confidential channel.
virtual const char * | getHostname () const =0
| Returns hostname of service that received request.
virtual int | getPort () const =0
| Returns incoming port.
virtual bool | isDefaultPort () const
| Returns true iff the request port is the default port for the request protocol.
virtual std::string | getContentType () const =0
| Returns the MIME type of the request, if known.
virtual long | getContentLength () const =0
| Returns the length of the request body, if known.
virtual const char * | getRequestBody () const =0
| Returns the raw request body.
virtual const char * | getParameter (const char *name) const =0
| Returns a decoded named parameter value from the request.
virtual std::vector< constchar * >::size_type | getParameters (const char *name, std::vector< const char * > &values) const =0
| Returns all of the decoded values of a named parameter from the request.
virtual std::string | getRemoteUser () const =0
| Returns the transport-authenticated identity associated with the request, if authentication is solely handled by the transport.
virtual std::string | getAuthType () const
| Gets the authentication type associated with the request.
virtual std::string | getRemoteAddr () const =0
| Returns the IP address of the client.
virtual const std::vector< XSECCryptoX509 * > & | getClientCertificates () const =0
| Returns the chain of certificates sent by the client.
virtual void | absolutize (std::string &url) const
| Converts a relative URL into an absolute one based on the properties of the request.
virtual std::string | getLanguageRange () const
| Returns a language range to use in selecting language-specific content for this request.
bool | startLangMatching () const
| Initializes the language matching process; call this method to begin the matching process by calling the matchLang method.
bool | continueLangMatching () const
| Continues the language matching process; additional calls to matchLang can be done as long as this method returns true.
bool | matchLang (const XMLCh *tag) const
| Matches a language tag against the currently active range.

## Static Public Member Functions

static void | setLangDefaults (bool langFromClient, const XMLCh *defaultRange)
| Establish default handling of language ranges.

## Detailed Description

Interface to generic protocol requests that transport XML messages.

This interface need not be threadsafe.

## Member Function Documentation

## absolutize()

virtual void xmltooling::GenericRequest::absolutize | ( | std::string & | url | ) | const

virtual

Converts a relative URL into an absolute one based on the properties of the request.

Parameters

  url | input URL to convert, will be modified in place

## continueLangMatching()

bool xmltooling::GenericRequest::continueLangMatching | ( |  | ) | const

Continues the language matching process; additional calls to matchLang can be done as long as this method returns true.

The language matching process is not thread-safe and must be externally syncronized.

Returns
  true iff more ranges are available to match against

## getAuthType()

virtual std::string xmltooling::GenericRequest::getAuthType | ( |  | ) | const

inline virtual

Gets the authentication type associated with the request.

Returns
  the authentication type or nullptr

## getClientCertificates()

virtual const std::vector< XSECCryptoX509 * > & xmltooling::GenericRequest::getClientCertificates | ( |  | ) | const

pure virtual

Returns the chain of certificates sent by the client.

They are not guaranteed to be valid according to any particular definition.

Returns
  the client's certificate chain

## getContentLength()

virtual long xmltooling::GenericRequest::getContentLength | ( |  | ) | const

pure virtual

Returns the length of the request body, if known.

Returns
  the content length, or -1 if unknown

## getContentType()

virtual std::string xmltooling::GenericRequest::getContentType | ( |  | ) | const

pure virtual

Returns the MIME type of the request, if known.

Returns
  the MIME type, or an empty string

## getHostname()

virtual const char * xmltooling::GenericRequest::getHostname | ( |  | ) | const

pure virtual

Returns hostname of service that received request.

Returns
  hostname of service

## getLanguageRange()

virtual std::string xmltooling::GenericRequest::getLanguageRange | ( |  | ) | const

inline virtual

Returns a language range to use in selecting language-specific content for this request.

The syntax is that of the HTTP 1.1 Accept-Language header, even if the underlying request is not HTTP.

Returns
  an HTTP 1.1 syntax language range specifier

Reimplemented in xmltooling::HTTPRequest.

## getParameter()

virtual const char * xmltooling::GenericRequest::getParameter | ( | const char * | name | ) | const

pure virtual

Returns a decoded named parameter value from the request.

If a parameter has multiple values, only one will be returned.

Parameters

  name | the name of the parameter to return

Returns
  a single parameter value or nullptr

## getParameters()

virtual std::vector< constchar * >::size_type xmltooling::GenericRequest::getParameters | ( | const char * | name,
|  | std::vector< const char * > & | values ) const

pure virtual

Returns all of the decoded values of a named parameter from the request.

All values found will be returned.

Parameters

  name | the name of the parameter to return
  values | a vector in which to return pointers to the decoded values

Returns
  the number of values returned

## getPort()

virtual int xmltooling::GenericRequest::getPort | ( |  | ) | const

pure virtual

Returns incoming port.

Returns
  incoming port

## getRemoteAddr()

virtual std::string xmltooling::GenericRequest::getRemoteAddr | ( |  | ) | const

pure virtual

Returns the IP address of the client.

Returns
  the client's IP address

## getRemoteUser()

virtual std::string xmltooling::GenericRequest::getRemoteUser | ( |  | ) | const

pure virtual

Returns the transport-authenticated identity associated with the request, if authentication is solely handled by the transport.

Returns
  the authenticated username or an empty string

## getRequestBody()

virtual const char * xmltooling::GenericRequest::getRequestBody | ( |  | ) | const

pure virtual

Returns the raw request body.

Returns
  the request body, or nullptr

## getScheme()

virtual const char * xmltooling::GenericRequest::getScheme | ( |  | ) | const

pure virtual

Returns the URL scheme of the request (http, https, ftp, ldap, etc.)

Returns
  the URL scheme

## isDefaultPort()

virtual bool xmltooling::GenericRequest::isDefaultPort | ( |  | ) | const

virtual

Returns true iff the request port is the default port for the request protocol.

Returns
  default port indicator

Reimplemented in xmltooling::HTTPRequest.

## isSecure()

virtual bool xmltooling::GenericRequest::isSecure | ( |  | ) | const

pure virtual

Returns true iff the request is over a confidential channel.

Returns
  confidential channel indicator

Implemented in xmltooling::HTTPRequest.

## matchLang()

bool xmltooling::GenericRequest::matchLang | ( | const XMLCh * | tag | ) | const

Matches a language tag against the currently active range.

The language matching process is not thread-safe and must be externally syncronized.

Parameters

  tag | a language tag (e.g., an xml:lang value)

Returns
  true iff the tag matches the active range

## setLangDefaults()

static void xmltooling::GenericRequest::setLangDefaults | ( | bool | langFromClient,
|  | const XMLCh * | defaultRange )

static

Establish default handling of language ranges.

Parameters

  langFromClient | honor client's language preferences if any
  defaultRange | priority list of space-delimited language tags to use by default

## startLangMatching()

bool xmltooling::GenericRequest::startLangMatching | ( |  | ) | const

Initializes the language matching process; call this method to begin the matching process by calling the matchLang method.

The language matching process is not thread-safe and must be externally syncronized.

Returns
  true iff language matching is possible

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

- xmltooling/io/GenericRequest.h