Torc  0.1
Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
TorcHTTPHandler Class Referenceabstract

Base HTTP response handler class. More...

#include <torchttphandler.h>

Inheritance diagram for TorcHTTPHandler:
[legend]

Public Member Functions

 TorcHTTPHandler (const QString &Signature, const QString &Name)
 
virtual ~TorcHTTPHandler ()
 
QString Signature (void) const
 
bool GetRecursive (void) const
 
QString Name (void) const
 
virtual void ProcessHTTPRequest (const QString &PeerAddress, int PeerPort, const QString &LocalAddress, int LocalPort, TorcHTTPRequest &Request)=0
 
virtual QVariantMap ProcessRequest (const QString &Method, const QVariant &Parameters, QObject *Connection, bool Authenticated)
 

Static Protected Member Functions

static bool MethodIsAuthorised (TorcHTTPRequest &Request, int Allowed)
 Check the current request is authorised and set the authentication header if not. More...
 
static void HandleOptions (TorcHTTPRequest &Request, int Allowed)
 
static void HandleFile (TorcHTTPRequest &Request, const QString &Filename, int Cache)
 

Protected Attributes

QString m_signature
 
bool m_recursive
 
QString m_name
 

Detailed Description

Base HTTP response handler class.

A TorcHTTPHandler object will be passed TorcHTTPRequest objects to process. Handlers are registered with the HTTP server using TorcHTTPServer::RegisterHandler and are removed with TorcHTTPServer::DeregisterHandler. The handler's signature tells the server which URL the handler is expecting to process (e.g. /events).

Concrete subclasses must implement ProcessRequest.

See also
TorcHTTPServer
TorcHTTPRequest

Definition at line 13 of file torchttphandler.h.

Constructor & Destructor Documentation

TorcHTTPHandler::TorcHTTPHandler ( const QString &  Signature,
const QString &  Name 
)

Definition at line 46 of file torchttphandler.cpp.

TorcHTTPHandler::~TorcHTTPHandler ( )
virtual

Definition at line 60 of file torchttphandler.cpp.

Member Function Documentation

bool TorcHTTPHandler::GetRecursive ( void  ) const

Definition at line 70 of file torchttphandler.cpp.

void TorcHTTPHandler::HandleFile ( TorcHTTPRequest Request,
const QString &  Filename,
int  Cache 
)
staticprotected

Definition at line 111 of file torchttphandler.cpp.

void TorcHTTPHandler::HandleOptions ( TorcHTTPRequest Request,
int  Allowed 
)
staticprotected

Definition at line 102 of file torchttphandler.cpp.

bool TorcHTTPHandler::MethodIsAuthorised ( TorcHTTPRequest Request,
int  Allowed 
)
staticprotected

Check the current request is authorised and set the authentication header if not.

Definition at line 92 of file torchttphandler.cpp.

QString TorcHTTPHandler::Name ( void  ) const

Definition at line 75 of file torchttphandler.cpp.

virtual void TorcHTTPHandler::ProcessHTTPRequest ( const QString &  PeerAddress,
int  PeerPort,
const QString &  LocalAddress,
int  LocalPort,
TorcHTTPRequest Request 
)
pure virtual
QVariantMap TorcHTTPHandler::ProcessRequest ( const QString &  Method,
const QVariant &  Parameters,
QObject *  Connection,
bool  Authenticated 
)
virtual

Reimplemented in TorcHTTPServices, and TorcHTTPService.

Definition at line 80 of file torchttphandler.cpp.

QString TorcHTTPHandler::Signature ( void  ) const

Definition at line 65 of file torchttphandler.cpp.

Member Data Documentation

QString TorcHTTPHandler::m_name
protected

Definition at line 33 of file torchttphandler.h.

bool TorcHTTPHandler::m_recursive
protected

Definition at line 32 of file torchttphandler.h.

QString TorcHTTPHandler::m_signature
protected

Definition at line 31 of file torchttphandler.h.


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