QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsRequestHandler Class Referenceabstract

This class is an interface hiding the details of reading input and writing output from/to a wms request mechanism. More...

#include <qgsrequesthandler.h>

Public Member Functions

 QgsRequestHandler ()
 
virtual ~QgsRequestHandler ()
 
virtual void appendBody (const QByteArray &body)=0
 Append the bytestream to response body. More...
 
virtual QByteArray body ()
 Return the response body. More...
 
virtual void clearBody ()=0
 Clears the response body. More...
 
virtual void clearHeaders ()=0
 Delete all HTTP headers. More...
 
virtual void endGetFeatureResponse (QByteArray *ba)=0
 
virtual bool exceptionRaised () const =0
 Pointer to last raised exception. More...
 
QString format () const
 Return the requested format string. More...
 
virtual QPair< QByteArray, QByteArraygetResponse ()=0
 
bool headersSent ()
 Return true if the HTTP headers were already sent to the client. More...
 
QString infoFormat () const
 Return the mime type for the response. More...
 
virtual QString parameter (const QString &key) const =0
 Return a request parameter. More...
 
QMap< QString, QStringparameterMap ()
 Return a copy of the parsed parameters as a key-value pair, to modify a parameter setParameter( const QString &key, const QString &value) and removeParameter(const QString &key) must be used. More...
 
virtual void parseInput ()=0
 Parses the input and creates a request neutral Parameter/Value map. More...
 
virtual int removeHeader (const QString &name)=0
 Remove an HTTP header. More...
 
virtual int removeParameter (const QString &key)=0
 Remove a request parameter. More...
 
virtual bool responseReady () const =0
 Check whether there is any header set or the body is not empty. More...
 
virtual void sendResponse ()=0
 Send out HTTP headers and flush output buffer. More...
 
virtual void setDefaultHeaders ()
 
virtual void setGetCapabilitiesResponse (const QDomDocument &doc)=0
 
virtual void setGetCoverageResponse (QByteArray *ba)=0
 
virtual void setGetFeatureInfoResponse (const QDomDocument &infoDoc, const QString &infoFormat)=0
 
virtual void setGetFeatureResponse (QByteArray *ba)=0
 
virtual void setGetMapResponse (const QString &service, QImage *img, int imageQuality)=0
 Sends the map image back to the client. More...
 
virtual void setGetPrintResponse (QByteArray *b)=0
 
virtual void setHeader (const QString &name, const QString &value)=0
 Set an HTTP header. More...
 
virtual void setInfoFormat (const QString &format)=0
 Set the info format string such as "text/xml". More...
 
virtual void setParameter (const QString &key, const QString &value)=0
 Set a request parameter. More...
 
virtual void setServiceException (QgsMapServiceException ex)=0
 Allow plugins to return a QgsMapServiceException. More...
 
virtual void setXmlResponse (const QDomDocument &doc)=0
 
virtual void setXmlResponse (const QDomDocument &doc, const QString &mimeType)=0
 
virtual bool startGetFeatureResponse (QByteArray *ba, const QString &infoFormat)=0
 

Protected Member Functions

virtual void sendBody ()=0
 
virtual void sendHeaders ()=0
 

Protected Attributes

QByteArray mBody
 
QgsMapServiceExceptionmException
 
QString mFormat
 This is set by the parseInput methods of the subclasses (parameter FORMAT, e.g. More...
 
QString mFormatString
 
QMap< QString, QStringmHeaders
 Response headers. More...
 
bool mHeadersSent
 
QString mInfoFormat
 
QMap< QString, QStringmParameterMap
 
QString mService
 

Detailed Description

This class is an interface hiding the details of reading input and writing output from/to a wms request mechanism.

Examples of possible mechanisms are cgi Get, cgi Post, SOAP or the usage as a standalone command line executable

Definition at line 48 of file qgsrequesthandler.h.

Constructor & Destructor Documentation

◆ QgsRequestHandler()

QgsRequestHandler::QgsRequestHandler ( )
inline

Definition at line 53 of file qgsrequesthandler.h.

◆ ~QgsRequestHandler()

virtual QgsRequestHandler::~QgsRequestHandler ( )
inlinevirtual

Definition at line 57 of file qgsrequesthandler.h.

Member Function Documentation

◆ appendBody()

virtual void QgsRequestHandler::appendBody ( const QByteArray body)
pure virtual

Append the bytestream to response body.

◆ body()

virtual QByteArray QgsRequestHandler::body ( )
inlinevirtual

Return the response body.

Definition at line 99 of file qgsrequesthandler.h.

◆ clearBody()

virtual void QgsRequestHandler::clearBody ( )
pure virtual

Clears the response body.

◆ clearHeaders()

virtual void QgsRequestHandler::clearHeaders ( )
pure virtual

Delete all HTTP headers.

◆ endGetFeatureResponse()

virtual void QgsRequestHandler::endGetFeatureResponse ( QByteArray ba)
pure virtual
Note
not available in Python bindings

◆ exceptionRaised()

virtual bool QgsRequestHandler::exceptionRaised ( ) const
pure virtual

Pointer to last raised exception.

◆ format()

QString QgsRequestHandler::format ( ) const
inline

Return the requested format string.

Definition at line 120 of file qgsrequesthandler.h.

◆ getResponse()

virtual QPair<QByteArray, QByteArray> QgsRequestHandler::getResponse ( )
pure virtual
Note
not availabe in Python bindings

◆ headersSent()

bool QgsRequestHandler::headersSent ( )
inline

Return true if the HTTP headers were already sent to the client.

Definition at line 124 of file qgsrequesthandler.h.

◆ infoFormat()

QString QgsRequestHandler::infoFormat ( ) const
inline

Return the mime type for the response.

Definition at line 122 of file qgsrequesthandler.h.

◆ parameter()

virtual QString QgsRequestHandler::parameter ( const QString key) const
pure virtual

Return a request parameter.

◆ parameterMap()

QMap<QString, QString> QgsRequestHandler::parameterMap ( )
inline

Return a copy of the parsed parameters as a key-value pair, to modify a parameter setParameter( const QString &key, const QString &value) and removeParameter(const QString &key) must be used.

Definition at line 112 of file qgsrequesthandler.h.

◆ parseInput()

virtual void QgsRequestHandler::parseInput ( )
pure virtual

Parses the input and creates a request neutral Parameter/Value map.

Note
not available in Python bindings

◆ removeHeader()

virtual int QgsRequestHandler::removeHeader ( const QString name)
pure virtual

Remove an HTTP header.

◆ removeParameter()

virtual int QgsRequestHandler::removeParameter ( const QString key)
pure virtual

Remove a request parameter.

◆ responseReady()

virtual bool QgsRequestHandler::responseReady ( ) const
pure virtual

Check whether there is any header set or the body is not empty.

◆ sendBody()

virtual void QgsRequestHandler::sendBody ( )
protectedpure virtual
Note
not available in Python bindings

◆ sendHeaders()

virtual void QgsRequestHandler::sendHeaders ( )
protectedpure virtual
Note
not available in Python bindings

◆ sendResponse()

virtual void QgsRequestHandler::sendResponse ( )
pure virtual

Send out HTTP headers and flush output buffer.

◆ setDefaultHeaders()

virtual void QgsRequestHandler::setDefaultHeaders ( )
inlinevirtual

Definition at line 87 of file qgsrequesthandler.h.

◆ setGetCapabilitiesResponse()

virtual void QgsRequestHandler::setGetCapabilitiesResponse ( const QDomDocument doc)
pure virtual
Note
not available in Python bindings

◆ setGetCoverageResponse()

virtual void QgsRequestHandler::setGetCoverageResponse ( QByteArray ba)
pure virtual
Note
not available in Python bindings

◆ setGetFeatureInfoResponse()

virtual void QgsRequestHandler::setGetFeatureInfoResponse ( const QDomDocument infoDoc,
const QString infoFormat 
)
pure virtual
Note
not availabe in Python bindings

◆ setGetFeatureResponse()

virtual void QgsRequestHandler::setGetFeatureResponse ( QByteArray ba)
pure virtual
Note
not available in Python bindings

◆ setGetMapResponse()

virtual void QgsRequestHandler::setGetMapResponse ( const QString service,
QImage img,
int  imageQuality 
)
pure virtual

Sends the map image back to the client.

Note
not available in Python bindings

◆ setGetPrintResponse()

virtual void QgsRequestHandler::setGetPrintResponse ( QByteArray b)
pure virtual
Note
not available in Python bindings

◆ setHeader()

virtual void QgsRequestHandler::setHeader ( const QString name,
const QString value 
)
pure virtual

Set an HTTP header.

◆ setInfoFormat()

virtual void QgsRequestHandler::setInfoFormat ( const QString format)
pure virtual

Set the info format string such as "text/xml".

◆ setParameter()

virtual void QgsRequestHandler::setParameter ( const QString key,
const QString value 
)
pure virtual

Set a request parameter.

◆ setServiceException()

virtual void QgsRequestHandler::setServiceException ( QgsMapServiceException  ex)
pure virtual

Allow plugins to return a QgsMapServiceException.

◆ setXmlResponse() [1/2]

virtual void QgsRequestHandler::setXmlResponse ( const QDomDocument doc)
pure virtual
Note
not available in Python bindings

◆ setXmlResponse() [2/2]

virtual void QgsRequestHandler::setXmlResponse ( const QDomDocument doc,
const QString mimeType 
)
pure virtual
Note
not available in Python bindings

◆ startGetFeatureResponse()

virtual bool QgsRequestHandler::startGetFeatureResponse ( QByteArray ba,
const QString infoFormat 
)
pure virtual
Note
not available in Python bindings

Member Data Documentation

◆ mBody

QByteArray QgsRequestHandler::mBody
protected

Definition at line 144 of file qgsrequesthandler.h.

◆ mException

QgsMapServiceException* QgsRequestHandler::mException
protected

Definition at line 151 of file qgsrequesthandler.h.

◆ mFormat

QString QgsRequestHandler::mFormat
protected

This is set by the parseInput methods of the subclasses (parameter FORMAT, e.g.

'FORMAT=PNG')

Definition at line 146 of file qgsrequesthandler.h.

◆ mFormatString

QString QgsRequestHandler::mFormatString
protected

Definition at line 147 of file qgsrequesthandler.h.

◆ mHeaders

QMap<QString, QString> QgsRequestHandler::mHeaders
protected

Response headers.

They can be empty, in this case headers are automatically generated from the content mFormat

Definition at line 155 of file qgsrequesthandler.h.

◆ mHeadersSent

bool QgsRequestHandler::mHeadersSent
protected

Definition at line 148 of file qgsrequesthandler.h.

◆ mInfoFormat

QString QgsRequestHandler::mInfoFormat
protected

Definition at line 150 of file qgsrequesthandler.h.

◆ mParameterMap

QMap<QString, QString> QgsRequestHandler::mParameterMap
protected

Definition at line 152 of file qgsrequesthandler.h.

◆ mService

QString QgsRequestHandler::mService
protected

Definition at line 149 of file qgsrequesthandler.h.


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