RestLink 2.2.0
Powerfull Rest Client for Qt
Loading...
Searching...
No Matches
Public Types | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RestLink::Server Class Referenceabstract

#include <server.h>

Inherits QObject, and RestLink::AbstractRequestHandler.

Public Types

enum  ServerType { Synchronous , Asynchronous }
 
 Defines supported HTTP methods for handling outgoing requests. More...
 Describes the type of request handler being used. More...

Signals

void stateChanged (bool listening)
 
void errorOccured (int error)
 

Public Member Functions

 Server (QObject *parent=nullptr)
 
 Server (ServerType type, QObject *parent=nullptr)
 
virtual ~Server ()
 
bool isListening () const
 
void listen ()
 
void close ()
 
QJsonObject configuration () const
 
int error () const
 
QString errorString () const
 
void registerController (AbstractController *controller)
 
HandlerType handlerType () const override
 

Protected Member Functions

 Server (ServerPrivate *d, QObject *parent)
 
virtual bool init ()=0
 
virtual void cleanup ()=0
 
virtual bool maintain ()=0
 
ServerResponsesendRequest (Method method, const Request &request, const Body &body) override final
 
virtual void processInternalRequest (const ServerRequest &request, ServerResponse *response)
 
virtual void processStandardRequest (const ServerRequest &request, ServerResponse *response)
 
void processUnsupportedRequest (const ServerRequest &request, ServerResponse *response)
 
virtual AbstractControllerfindController (const ServerRequest &request) const
 
virtual void prepareController (AbstractController *controller, const ServerRequest &request, ServerResponse *response)
 
void setError (int code, const QString &str)
 

Protected Attributes

QScopedPointer< ServerPrivated_ptr
 

Member Enumeration Documentation

◆ ServerType

Enumerator
Synchronous 
Asynchronous 

Constructor & Destructor Documentation

◆ Server() [1/3]

RestLink::Server::Server ( QObject *  parent = nullptr)
explicit

◆ Server() [2/3]

RestLink::Server::Server ( ServerType  type,
QObject *  parent = nullptr 
)

◆ ~Server()

RestLink::Server::~Server ( )
virtual

◆ Server() [3/3]

RestLink::Server::Server ( ServerPrivate d,
QObject *  parent 
)
protected

Member Function Documentation

◆ isListening()

bool RestLink::Server::isListening ( ) const

◆ listen()

void RestLink::Server::listen ( )

◆ close()

void RestLink::Server::close ( )

◆ configuration()

QJsonObject RestLink::Server::configuration ( ) const

◆ error()

int RestLink::Server::error ( ) const

◆ errorString()

QString RestLink::Server::errorString ( ) const

◆ registerController()

void RestLink::Server::registerController ( AbstractController controller)

◆ handlerType()

AbstractRequestHandler::HandlerType RestLink::Server::handlerType ( ) const
overridevirtual

◆ stateChanged

void RestLink::Server::stateChanged ( bool  listening)
signal

◆ errorOccured

void RestLink::Server::errorOccured ( int  error)
signal

◆ init()

virtual bool RestLink::Server::init ( )
protectedpure virtual

◆ cleanup()

virtual void RestLink::Server::cleanup ( )
protectedpure virtual

◆ maintain()

virtual bool RestLink::Server::maintain ( )
protectedpure virtual

◆ sendRequest()

ServerResponse * RestLink::Server::sendRequest ( Method  method,
const Request request,
const Body body 
)
finaloverrideprotectedvirtual

◆ processInternalRequest()

void RestLink::Server::processInternalRequest ( const ServerRequest request,
ServerResponse response 
)
protectedvirtual

◆ processStandardRequest()

void RestLink::Server::processStandardRequest ( const ServerRequest request,
ServerResponse response 
)
protectedvirtual

◆ processUnsupportedRequest()

void RestLink::Server::processUnsupportedRequest ( const ServerRequest request,
ServerResponse response 
)
protected

◆ findController()

AbstractController * RestLink::Server::findController ( const ServerRequest request) const
protectedvirtual

◆ prepareController()

void RestLink::Server::prepareController ( AbstractController controller,
const ServerRequest request,
ServerResponse response 
)
protectedvirtual

◆ setError()

void RestLink::Server::setError ( int  code,
const QString &  str 
)
protected

Member Data Documentation

◆ d_ptr

QScopedPointer<ServerPrivate> RestLink::Server::d_ptr
protected