Class: QgsServerFilter

Defines I/O filters for QGIS Server and implemented in plugins.

Methods

serverInterface

Returns the QgsServerInterface instance

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsServerFilter. See the FAQ for more details.

onProjectReady

Method called when the QgsProject instance is ready to be used to perform the request, just before entering the main switch for core services.

onRequestReady

Method called when the QgsRequestHandler is ready and populated with parameters, just before entering the main switch for core services.

onResponseComplete

Method called when the QgsRequestHandler processing has done and the response is ready, just after the main switch for core services and before final sending response to FCGI stdout.

onSendResponse

Method called when the QgsRequestHandler sends its data to FCGI stdout.

requestReady

Method called when the QgsRequestHandler is ready and populated with parameters, just before entering the main switch for core services.

responseComplete

Method called when the QgsRequestHandler processing has done and the response is ready, just after the main switch for core services and before final sending response.

sendResponse

Method called when the QgsRequestHandler sends its data to FCGI stdout.

class qgis.server.QgsServerFilter[source]

Bases: object

__init__(serverInterface: QgsServerInterface | None)

Constructor QgsServerInterface passed to plugins constructors and must be passed to QgsServerFilter instances.

Parameters:

serverInterface (Optional[QgsServerInterface])

__init__(a0: QgsServerFilter)
Parameters:

a0 (QgsServerFilter)

virtual onProjectReady(self) bool[source]

Method called when the QgsProject instance is ready to be used to perform the request, just before entering the main switch for core services.

Return type:

bool

Returns:

true if the call must propagate to the subsequent filters, false otherwise

Added in version 3.36.

virtual onRequestReady(self) bool[source]

Method called when the QgsRequestHandler is ready and populated with parameters, just before entering the main switch for core services.

Return type:

bool

Returns:

true if the call must propagate to the subsequent filters, false otherwise

Added in version 3.24.

virtual onResponseComplete(self) bool[source]

Method called when the QgsRequestHandler processing has done and the response is ready, just after the main switch for core services and before final sending response to FCGI stdout.

Return type:

bool

Returns:

true if the call must propagate to the subsequent filters, false otherwise

Added in version 3.24.

virtual onSendResponse(self) bool[source]

Method called when the QgsRequestHandler sends its data to FCGI stdout. This normally occurs at the end of core services processing just after the responseComplete() plugin hook. For streaming services (like WFS on getFeature requests, sendResponse() might have been called several times before the response is complete: in this particular case, sendResponse() is called once for each feature before hitting responseComplete()

Return type:

bool

Returns:

true if the call must propagate to the subsequent filters, false otherwise

Added in version 3.22.

virtual requestReady(self)[source]

Method called when the QgsRequestHandler is ready and populated with parameters, just before entering the main switch for core services.

This method is considered as deprecated and onRequestReady() should be used instead.

Deprecated since version 3.40: Will be removed in QGIS 4.0.

virtual responseComplete(self)[source]

Method called when the QgsRequestHandler processing has done and the response is ready, just after the main switch for core services and before final sending response.

This method is considered as deprecated and onResponseComplete() should be used instead.

Deprecated since version 3.40: Will be removed in QGIS 4.0.

virtual sendResponse(self)[source]

Method called when the QgsRequestHandler sends its data to FCGI stdout. This normally occurs at the end of core services processing just after the responseComplete() plugin hook. For streaming services (like WFS on getFeature requests, sendResponse() might have been called several times before the response is complete: in this particular case, sendResponse() is called once for each feature before hitting responseComplete()

This method is considered as deprecated and onSendResponse() should be used instead.

Deprecated since version 3.40: Will be removed in QGIS 4.0.

serverInterface(self) QgsServerInterface | None[source]

Returns the QgsServerInterface instance

Return type:

Optional[QgsServerInterface]