shibsp::RemotedHandler Class Reference

Base class for handlers that need HTTP request/response layer to be remoted. More...

`#include <shibsp/handler/RemotedHandler.h>`

Inheritance diagram for shibsp::RemotedHandler:
[legend]
Collaboration diagram for shibsp::RemotedHandler:
[legend]

## Static Public Member Functions

static void | addRemotedHeader (const char *header)
| Ensures that a request header will be remoted.

## Protected Member Functions

void | setAddress (const char *address)
| Establishes message remoting using the supplied address.
virtual DDF | send (const SPRequest &request, DDF &in) const
| Send a remoted message and return the response.
DDF | wrap (const SPRequest &request, const std::vector< std::string > *headers=nullptr, bool certs=false) const
| Wraps a request by creating an outgoing data flow with the data needed to remote the request information.
virtual std::pair< bool, long > | unwrap (SPRequest &request, DDF &out) const
| Unwraps a response by examining an incoming data flow to determine whether a response was produced by the remoted handler.
xmltooling::HTTPRequest * | getRequest (const Application &app, DDF &in) const
| Builds a new request instance around a remoted data object.
xmltooling::HTTPResponse * | getResponse (const Application &app, DDF &out) const
| Builds a new response instance around an outgoing data object.
xmltooling::HTTPRequest * | getRequest (DDF &in) const
| @Deprecated
xmltooling::HTTPResponse * | getResponse (DDF &out) const
| @Deprecated
Protected Member Functions inherited from shibsp::Handler
virtual void | log (SPRequest::SPLogLevel level, const std::string &msg) const
| Log using handler's specific logging object.
virtual void | cleanRelayState (const Application &application, const xmltooling::HTTPRequest &request, xmltooling::HTTPResponse &response) const
| Prevents unused relay state from building up by cleaning old state from the client.
virtual void | preserveRelayState (const Application &application, xmltooling::HTTPResponse &response, std::string &relayState) const
| Implements various mechanisms to preserve RelayState, such as cookies or StorageService-backed keys.
virtual void | recoverRelayState (const Application &application, const xmltooling::HTTPRequest &request, xmltooling::HTTPResponse &response, std::string &relayState, bool clear=true) const
| Implements various mechanisms to recover RelayState, such as cookies or StorageService-backed keys.

## Protected Attributes

std::string | m_address
| Message address for remote half.

## Additional Inherited Members

Public Member Functions inherited from shibsp::Handler
virtual const XMLCh * | getProtocolFamily () const
| Returns an identifier for the protocol family associated with the handler, if any.
virtual std::pair< bool, long > | run (SPRequest &request, bool isHandler=true) const =0
| Executes handler functionality as an incoming request.
virtual void | generateMetadata (opensaml::saml2md::SPSSODescriptor &role, const char *handlerURL) const
| Generates and/or modifies metadata reflecting the Handler.
virtual const char * | getType () const
| Returns the "type" of the Handler plugin.
virtual const char * | getEventType () const
| Get the type of event, as input to error handling in response to errors raised by this handler.
Public Member Functions inherited from shibsp::PropertySet
virtual const PropertySet * | getParent () const =0
| Returns parent of this PropertySet, if any.
virtual void | setParent (const PropertySet *parent)=0
| Establishes a "parent" PropertySet to supply inherited settings.
virtual std::pair< bool, bool > | getBool (const char *name, const char *ns=nullptr) const =0
| Returns a boolean-valued property.
virtual std::pair< bool, const char * > | getString (const char *name, const char *ns=nullptr) const =0
| Returns a string-valued property.
virtual std::pair< bool, const XMLCh * > | getXMLString (const char *name, const char *ns=nullptr) const =0
| Returns a Unicode string-valued property.
virtual std::pair< bool, unsigned int > | getUnsignedInt (const char *name, const char *ns=nullptr) const =0
| Returns an unsigned integer-valued property.
virtual std::pair< bool, int > | getInt (const char *name, const char *ns=nullptr) const =0
| Returns an integer-valued property.
virtual const PropertySet * | getPropertySet (const char *name, const char *ns=shibspconstants::ASCII_SHIBSPCONFIG_NS) const =0
| Returns a nested property set.
virtual const xercesc::DOMElement * | getElement () const =0
| Returns a DOM element representing the property container, if any.
Public Member Functions inherited from shibsp::Remoted
virtual void | receive (DDF &in, std::ostream &out)=0
| Remoted classes implement this method to process incoming messages.

## Detailed Description

Base class for handlers that need HTTP request/response layer to be remoted.

## Member Function Documentation

## addRemotedHeader()

static void shibsp::RemotedHandler::addRemotedHeader | ( | const char * | header | ) |

static

Ensures that a request header will be remoted.

Parameters

  header | name of request header to remote

## getRequest() [1/2]

xmltooling::HTTPRequest * shibsp::RemotedHandler::getRequest | ( | const Application & | app,
|  | DDF & | in
| ) |  | const

protected

Builds a new request instance around a remoted data object.

Parameters

  app | the application
  in | the dataflow object containing the remoted request

Returns
  a call-specific request object based on the input, to be freed by the caller

## getRequest() [2/2]

xmltooling::HTTPRequest * shibsp::RemotedHandler::getRequest | ( | DDF & | in | ) | const

protected

@Deprecated

Builds a new request instance around a remoted data object.

Parameters

  app | the application
  in | the dataflow object containing the remoted request

Returns
  a call-specific request object based on the input, to be freed by the caller

## getResponse() [1/2]

xmltooling::HTTPResponse * shibsp::RemotedHandler::getResponse | ( | const Application & | app,
|  | DDF & | out
| ) |  | const

protected

Builds a new response instance around an outgoing data object.

Parameters

  app | the application
  out | the dataflow object to be returned by the caller

Returns
  a call-specific response object, to be freed by the caller

## getResponse() [2/2]

xmltooling::HTTPResponse * shibsp::RemotedHandler::getResponse | ( | DDF & | out | ) | const

protected

@Deprecated

Builds a new response instance around an outgoing data object.

Parameters

  app | the application
  out | the dataflow object to be returned by the caller

Returns
  a call-specific response object, to be freed by the caller

## send()

virtual DDF shibsp::RemotedHandler::send | ( | const SPRequest & | request,
|  | DDF & | in
| ) |  | const

protected virtual

Send a remoted message and return the response.

Parameters

  in | input message to send

Returns
  response from remote service

## setAddress()

void shibsp::RemotedHandler::setAddress | ( | const char * | address | ) |

protected

Establishes message remoting using the supplied address.

Parameters

  address | a unique "address" for remote message handling

## unwrap()

virtual std::pair< bool, long > shibsp::RemotedHandler::unwrap | ( | SPRequest & | request,
|  | DDF & | out
| ) |  | const

protected virtual

Unwraps a response by examining an incoming data flow to determine whether a response was produced by the remoted handler.

Parameters

  request | SP request context
  out | the dataflow object to unpack

Returns
  a pair containing a "request completed" indicator and a server-specific response code

## wrap()

DDF shibsp::RemotedHandler::wrap | ( | const SPRequest & | request,
|  | const std::vector< std::string > * | headers = `nullptr`,
|  | bool | certs = `false`
| ) |  | const

protected

Wraps a request by creating an outgoing data flow with the data needed to remote the request information.

Parameters

  request | an SPRequest to remote
  headers | array of additional request headers to copy to remote request
  certs | true iff client certificates should be available for the remote request

Returns
  the input dataflow object

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

- shibsp/handler/RemotedHandler.h