MIRA
Public Member Functions | Static Public Member Functions | List of all members
JSONRPCBackend::ServerRequest Class Reference

JSON server-side request. More...

#include <rpc/JSONRPCBackend.h>

Public Member Functions

 ServerRequest (const json::Value *value)
 
void getHeader (std::string &oCallId, std::string &oService)
 Read the request header including the call ID, the service name and the signature of the method. More...
 
bool checkSignature (const RPCSignature &signature)
 Check, if the passed signature is compatible with the signature that was read from the request header in the previous getHeader() call above. More...
 
const RPCSignaturegetSignature ()
 Return the signature, that was read from the request header in the previous getHeader() call above. More...
 
template<typename P >
void getParameter (P &oParam)
 Read and deserialize the next parameter from the request. More...
 

Static Public Member Functions

static std::string getCallId (const json::Value *request)
 Read call ID from the given request. More...
 
static void getServiceMethod (const json::Value *request, std::string &oService, std::string &oMethod)
 Read service name and the method name from the given request. More...
 

Detailed Description

JSON server-side request.

The request must have been created by the RPCClient and it must be contained in the buffer that is passed in the constructor.

See also
Backends

Constructor & Destructor Documentation

◆ ServerRequest()

ServerRequest ( const json::Value value)
inline

Member Function Documentation

◆ getCallId()

static std::string getCallId ( const json::Value request)
inlinestatic

Read call ID from the given request.

◆ getServiceMethod()

static void getServiceMethod ( const json::Value request,
std::string &  oService,
std::string &  oMethod 
)
inlinestatic

Read service name and the method name from the given request.

The service name and method name must be returned via the by-reference parameters.

◆ getHeader()

void getHeader ( std::string &  oCallId,
std::string &  oService 
)
inline

Read the request header including the call ID, the service name and the signature of the method.

The call ID and the service name must be returned via the by-reference parameters. The signature should be stored internally to be able to handle the methods below. This method is called first when a new request is handled by the RPCServer.

◆ checkSignature()

bool checkSignature ( const RPCSignature signature)
inline

Check, if the passed signature is compatible with the signature that was read from the request header in the previous getHeader() call above.

◆ getSignature()

const RPCSignature& getSignature ( )
inline

Return the signature, that was read from the request header in the previous getHeader() call above.

◆ getParameter()

void getParameter ( P &  oParam)
inline

Read and deserialize the next parameter from the request.

This method is called once for each parameter of the RPC method.


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