Torc  0.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TorcHTTPService Class Reference

#include <torchttpservice.h>

Inheritance diagram for TorcHTTPService:
[legend]

Public Member Functions

 TorcHTTPService (QObject *Parent, const QString &Signature, const QString &Name, const QMetaObject &MetaObject, const QString &Blacklist=QStringLiteral(""))
 
virtual ~TorcHTTPService ()
 
void ProcessHTTPRequest (const QString &PeerAddress, int PeerPort, const QString &LocalAddress, int LocalPort, TorcHTTPRequest &Request) override
 
QVariantMap ProcessRequest (const QString &Method, const QVariant &Parameters, QObject *Connection, bool Authenticated) override
 
QString GetMethod (int Index)
 
QVariant GetProperty (int Index)
 Get the value of a given property. More...
 
QVariantMap GetServiceDetails (void)
 Return a QVariantMap describing the services methods and properties. More...
 
virtual QString GetUIName (void)
 
virtual QString GetPresentationURL (void)
 
- Public Member Functions inherited from TorcHTTPHandler
 TorcHTTPHandler (const QString &Signature, const QString &Name)
 
virtual ~TorcHTTPHandler ()
 
QString Signature (void) const
 
bool GetRecursive (void) const
 
QString Name (void) const
 

Protected Member Functions

void HandleSubscriberDeleted (QObject *Subscriber)
 

Protected Attributes

QReadWriteLock m_httpServiceLock
 
- Protected Attributes inherited from TorcHTTPHandler
QString m_signature
 
bool m_recursive
 
QString m_name
 

Additional Inherited Members

- Static Protected Member Functions inherited from TorcHTTPHandler
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)
 

Detailed Description

Todo:

Support for complex parameter types via RPC (e.g. array etc).

ProcessRequest implicitly assumes JSON-RPC (though applies to much of the RPC code).

Definition at line 20 of file torchttpservice.h.

Constructor & Destructor Documentation

TorcHTTPService::TorcHTTPService ( QObject *  Parent,
const QString &  Signature,
const QString &  Name,
const QMetaObject &  MetaObject,
const QString &  Blacklist = QStringLiteral("") 
)

Definition at line 262 of file torchttpservice.cpp.

TorcHTTPService::~TorcHTTPService ( )
virtual

Definition at line 431 of file torchttpservice.cpp.

Member Function Documentation

QString TorcHTTPService::GetMethod ( int  Index)

Definition at line 823 of file torchttpservice.cpp.

QString TorcHTTPService::GetPresentationURL ( void  )
virtual

Reimplemented in TorcCameraVideoOutput.

Definition at line 441 of file torchttpservice.cpp.

QVariant TorcHTTPService::GetProperty ( int  Index)

Get the value of a given property.

Note
Index is the method index for the property's getter - not the property itself.

Definition at line 835 of file torchttpservice.cpp.

QVariantMap TorcHTTPService::GetServiceDetails ( void  )

Return a QVariantMap describing the services methods and properties.

This is sent to new subscribers immediately after a successful subscription to provide them with the full 'API' and current state.

It is also used by the TorcHTMLServicesHelp object to retrieve a service description (as used by the API helper screen on the web frontend).

Definition at line 729 of file torchttpservice.cpp.

QString TorcHTTPService::GetUIName ( void  )
virtual
void TorcHTTPService::HandleSubscriberDeleted ( QObject *  Subscriber)
protected

Definition at line 847 of file torchttpservice.cpp.

void TorcHTTPService::ProcessHTTPRequest ( const QString &  PeerAddress,
int  PeerPort,
const QString &  LocalAddress,
int  LocalPort,
TorcHTTPRequest Request 
)
overridevirtual

Implements TorcHTTPHandler.

Reimplemented in TorcHTTPServices.

Definition at line 446 of file torchttpservice.cpp.

QVariantMap TorcHTTPService::ProcessRequest ( const QString &  Method,
const QVariant &  Parameters,
QObject *  Connection,
bool  Authenticated 
)
overridevirtual

Reimplemented from TorcHTTPHandler.

Reimplemented in TorcHTTPServices.

Definition at line 529 of file torchttpservice.cpp.

Member Data Documentation

QReadWriteLock TorcHTTPService::m_httpServiceLock
protected

Definition at line 42 of file torchttpservice.h.


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