Kanzi Connect  3.9.9
Kanzi Connect C++ API
kanzi::connect::VirtualFileRequestHandler Class Reference

VirtualFileRequestHandler implements the CivetHandler for defined local URI. More...

#include <virtualfilerequesthandler.hpp>

Inheritance diagram for kanzi::connect::VirtualFileRequestHandler:

Classes

class  ServiceInterface
 Inner class to define a callback interface from this Civet specific handler class. More...
 

Public Member Functions

VirtualFileProvidergetProvider () const
 retrieve configured provider More...
 
shared_ptr< VirtualfileServiceConcept::Session > getSession () const
 retrieve configured session More...
 
virtual bool handleGet (CivetServer *server, struct mg_connection *conn)
 Handles GET requests for the specified local URI. More...
 
virtual bool handlePost (CivetServer *server, struct mg_connection *conn)
 Handles POST requests for the specified local URI. More...
 
const string & localUri ()
 Local URI that is handled by this instance. More...
 
 VirtualFileRequestHandler (const string &path, ServiceInterface &sif, shared_ptr< VirtualfileServiceConcept::Session > session)
 Constructs an object from a Session. More...
 
 VirtualFileRequestHandler (const string &path, ServiceInterface &sif, VirtualFileProvider *provider)
 Construct an object and binds it to a local file provider. More...
 
virtual ~VirtualFileRequestHandler ()
 Virtual desctructor for object cleanup. More...
 

Detailed Description

VirtualFileRequestHandler implements the CivetHandler for defined local URI.

Constructor & Destructor Documentation

◆ VirtualFileRequestHandler() [1/2]

kanzi::connect::VirtualFileRequestHandler::VirtualFileRequestHandler ( const string &  path,
ServiceInterface sif,
shared_ptr< VirtualfileServiceConcept::Session >  session 
)

Constructs an object from a Session.

Effectively this type of object is created for remotely connecting clients

Parameters
paththe path
sifservice interface where to requests are routed
sessionservice session.

◆ VirtualFileRequestHandler() [2/2]

kanzi::connect::VirtualFileRequestHandler::VirtualFileRequestHandler ( const string &  path,
ServiceInterface sif,
VirtualFileProvider provider 
)

Construct an object and binds it to a local file provider.

Parameters
paththe path
sifservice interface where to requests are routed.
providerpointer that effectively can handle the requests.

◆ ~VirtualFileRequestHandler()

virtual kanzi::connect::VirtualFileRequestHandler::~VirtualFileRequestHandler ( )
virtual

Virtual desctructor for object cleanup.

Member Function Documentation

◆ getProvider()

VirtualFileProvider* kanzi::connect::VirtualFileRequestHandler::getProvider ( ) const

retrieve configured provider

Returns
pointer to provider. can be nullptr. ownership not transfered.

◆ getSession()

shared_ptr<VirtualfileServiceConcept::Session> kanzi::connect::VirtualFileRequestHandler::getSession ( ) const

retrieve configured session

Returns
pointer to session. can be nullptr. ownership not transfered.

◆ handleGet()

virtual bool kanzi::connect::VirtualFileRequestHandler::handleGet ( CivetServer *  server,
struct mg_connection *  conn 
)
virtual

Handles GET requests for the specified local URI.

Parameters
serverServer to which the request is attached
connCivet connection entity that is attached to this particular request.
Returns
Boolean telling the Civet framework whether a message was handled, always true.

◆ handlePost()

virtual bool kanzi::connect::VirtualFileRequestHandler::handlePost ( CivetServer *  server,
struct mg_connection *  conn 
)
virtual

Handles POST requests for the specified local URI.

Parameters
serverServer to which the request is attached
connCivet connection entity that is attached to this particular request.
Returns
Boolean telling the Civet framework whether a message was handled, always true.

◆ localUri()

const string& kanzi::connect::VirtualFileRequestHandler::localUri ( )

Local URI that is handled by this instance.


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