Stroika Library 3.0d25
 
Loading...
Searching...
No Matches
Action.h File Reference
#include "Stroika/Frameworks/StroikaPreComp.h"
#include <functional>
#include <stdexcept>
#include "Stroika/Foundation/Characters/String.h"
#include "Stroika/Foundation/Common/KeyValuePair.h"
#include "Stroika/Foundation/Containers/Mapping.h"
#include "Stroika/Foundation/Containers/Sequence.h"
#include "Stroika/Foundation/Execution/Exceptions.h"
#include "Stroika/Foundation/IO/Network/URI.h"
#include "Stroika/Foundation/Memory/BLOB.h"
#include "Stroika/Frameworks/UPnP/DataTypes.h"
#include "Stroika/Frameworks/UPnP/ServiceDescription.h"
#include "Stroika/Frameworks/WebServer/Message.h"
#include "Stroika/Frameworks/WebService/SOAP.h"
#include "Action.inl"

Go to the source code of this file.

Classes

struct  Stroika::Frameworks::UPnP::SOAP::Argument
 One of an action's arguments: its name, and its value as text, as UPnP writes it (DataTypes::ToText) - made from a value of any of UPnP's data types, as its C++ type: {"ResultStatus"sv, true}. More...
 
struct  Stroika::Frameworks::UPnP::SOAP::ActionRequest
 A control point's request that a service do one of its actions. More...
 
struct  Stroika::Frameworks::UPnP::SOAP::ActionResponse
 A service's answer to an ActionRequest, it having done the action: the action's out arguments. More...
 
struct  Stroika::Frameworks::UPnP::SOAP::ActionError
 A service's answer to an ActionRequest, it having not done the action: why not (UPnP Device Architecture 1.1, section 3.2.2) - a UPnPError, in a SOAP fault's detail. More...
 
class  Stroika::Frameworks::UPnP::SOAP::ActionException
 An ActionError, thrown: Invoke throws the one a service answers with, and a HandleAction doAction throws one to answer with it. More...
 

Namespaces

namespace  Stroika::Frameworks::UPnP::SOAP
 

Typedefs

using Stroika::Frameworks::UPnP::SOAP::Arguments = Foundation::Containers::Sequence< Argument >
 
using Stroika::Frameworks::UPnP::SOAP::ActionHandler = function< Arguments(const ActionRequest &)>
 What a service does for a request for one of its actions: the action's out arguments - or, thrown (ActionException), why it was not done.
 
using Stroika::Frameworks::UPnP::SOAP::ActionHandlers = Foundation::Containers::Mapping< String, ActionHandler >
 A service's actions' handlers, each by its action's name - as its description names it.
 

Functions

Foundation::Memory::BLOB Stroika::Frameworks::UPnP::SOAP::Serialize (const ActionRequest &request, const WebService::SOAP::Options &options={})
 The SOAP message - its XML, UTF-8 - which sends it: a request, a response, or an error (a SOAP fault)
 
Foundation::Memory::BLOB Stroika::Frameworks::UPnP::SOAP::Serialize (const ActionResponse &response, const WebService::SOAP::Options &options={})
 The SOAP message - its XML, UTF-8 - which sends it.
 
Foundation::Memory::BLOB Stroika::Frameworks::UPnP::SOAP::Serialize (const ActionError &error, const WebService::SOAP::Options &options={})
 The SOAP message - its XML, UTF-8 - which sends it.
 
void Stroika::Frameworks::UPnP::SOAP::DeSerialize (const Foundation::Memory::BLOB &b, ActionRequest *request, const WebService::SOAP::Options &options={})
 The SOAP message read: what Serialize writes, and any other's. Throws DataExchange::BadFormatException if it is not one.
 
void Stroika::Frameworks::UPnP::SOAP::DeSerialize (const Foundation::Memory::BLOB &b, ActionResponse *response, const WebService::SOAP::Options &options={})
 The SOAP message read.
 
void Stroika::Frameworks::UPnP::SOAP::DeSerialize (const Foundation::Memory::BLOB &b, ActionError *error, const WebService::SOAP::Options &options={})
 The SOAP message read.
 
ActionResponse Stroika::Frameworks::UPnP::SOAP::Invoke (const URI &controlURL, const ActionRequest &request, const WebService::SOAP::Options &options={})
 Ask the service at controlURL to do request's action - and return its answer. Throws ActionException if the service answers with a UPnPError; otherwise as WebService::SOAP::Invoke.
 
ActionResponse Stroika::Frameworks::UPnP::SOAP::Invoke (Foundation::IO::Network::Transfer::Connection::Ptr connection, const URI &controlURL, const ActionRequest &request, const WebService::SOAP::Options &options={})
 Ask the service at controlURL to do request's action, over the caller's connection.
 
void Stroika::Frameworks::UPnP::SOAP::CheckRequest (const ActionRequest &request, const ServiceDescription &description)
 Throws the ActionException a service answers request with if its description - its actions, their arguments, and the state variables whose types they have - rules it out (UPnP Device Architecture 1.1, section 3.2.2):
 
void Stroika::Frameworks::UPnP::SOAP::HandleAction (WebServer::Message &m, const String &serviceType, const ActionHandler &doAction, const WebService::SOAP::Options &options={})
 Answer a control request, at the controlURL's route of the service of type serviceType: doAction's out arguments, or the ActionError it throws (as ActionException) - and 401 (Invalid Action) for another service type's request. Otherwise as WebService::SOAP::HandleRequest: 415 if not text/xml, and a Client fault if not a SOAP call (nor, with options.fValidateReadAgainst, a valid one).
 
void Stroika::Frameworks::UPnP::SOAP::HandleAction (WebServer::Message &m, const String &serviceType, const ServiceDescription &description, const ActionHandler &doAction, const WebService::SOAP::Options &options={})
 Answer a control request - having checked it against the service's description.
 
void Stroika::Frameworks::UPnP::SOAP::HandleAction (WebServer::Message &m, const String &serviceType, const ServiceDescription &description, const ActionHandlers &actions, const WebService::SOAP::Options &options={})
 Answer a control request - checked against the service's description, and done by its action's handler.
 

Detailed Description

Note
Code-Status: Alpha

Definition in file Action.h.