EpcTools
An event based multi-threaded C++ development framework.
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
EManagementHandler Class Referenceabstract

Pure virtual base class for an administrative management interface handler. More...

#include <emgmt.h>

Public Types

enum  HttpMethod { HttpMethod::httpGet, HttpMethod::httpPost, HttpMethod::httpPut, HttpMethod::httpDelete }
 Represents the type of the handler. More...
 

Public Member Functions

 EManagementHandler (HttpMethod mthd, cpStr pth, ELogger &audit)
 Class constructor. More...
 
 EManagementHandler (HttpMethod mthd, const std::string &pth, ELogger &audit)
 Class constructor. More...
 
virtual Void process (const Pistache::Http::Request &request, Pistache::Http::ResponseWriter &response)=0
 Pure virtual method that will be called by handler() to perform the processing. More...
 
Void handler (const Pistache::Http::Request &request, Pistache::Http::ResponseWriter response)
 HTTP handler that will be called by the Pistache framework. More...
 
const EStringpath ()
 Returns the route path for this HTTP handler. More...
 
HttpMethod httpMethod ()
 Returns the HTTP method for this HTTP handler. More...
 

Protected Member Functions

Pistache::Rest::Route::Handler getHandler ()
 

Friends

class EManagementEndpoint
 

Detailed Description

Pure virtual base class for an administrative management interface handler.

Member Enumeration Documentation

◆ HttpMethod

Represents the type of the handler.

Enumerator
httpGet 

HTTP GET.

httpPost 

HTTP POST.

httpPut 

HTTP PUT.

httpDelete 

HTTP DELETE.

Constructor & Destructor Documentation

◆ EManagementHandler() [1/2]

EManagementHandler::EManagementHandler ( HttpMethod  mthd,
cpStr  pth,
ELogger audit 
)

Class constructor.

Parameters
mthdHTTP method associated with this handler.
pththe HTTP route for this handler.
audita reference to the ELogger object that will log all management operations.

◆ EManagementHandler() [2/2]

EManagementHandler::EManagementHandler ( HttpMethod  mthd,
const std::string &  pth,
ELogger audit 
)

Class constructor.

Parameters
mthdHTTP method associated with this handler.
pththe HTTP route for this handler.
audita reference to the ELogger object that will log all management operations.

Member Function Documentation

◆ getHandler()

Pistache::Rest::Route::Handler EManagementHandler::getHandler ( )
protected

◆ handler()

Void EManagementHandler::handler ( const Pistache::Http::Request &  request,
Pistache::Http::ResponseWriter  response 
)

HTTP handler that will be called by the Pistache framework.

Parameters
requestHTTP request object.
responseHTTP response object.

◆ httpMethod()

HttpMethod EManagementHandler::httpMethod ( )
inline

Returns the HTTP method for this HTTP handler.

◆ path()

const EString& EManagementHandler::path ( )
inline

Returns the route path for this HTTP handler.

◆ process()

virtual Void EManagementHandler::process ( const Pistache::Http::Request &  request,
Pistache::Http::ResponseWriter &  response 
)
pure virtual

Pure virtual method that will be called by handler() to perform the processing.

Parameters
requestHTTP request object.
responseHTTP response object.

Friends And Related Function Documentation

◆ EManagementEndpoint

friend class EManagementEndpoint
friend

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