QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsserverinterfaceimpl.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsseerversinterface.h
3  Interface class for exposing functions in QGIS Server for use by plugins
4  -------------------
5  begin : 2014-09-10
6  copyright : (C) 2014 by Alessandro Pasotti
7  email : a dot pasotti at itopen dot it
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 
19 #ifndef QGSSERVERINTERFACEIMPL_H
20 #define QGSSERVERINTERFACEIMPL_H
21 
22 #define SIP_NO_FILE
23 
24 
25 #include "qgsserverinterface.h"
26 #include "qgscapabilitiescache.h"
27 #include "qgsservercachemanager.h"
28 
35 class SERVER_EXPORT QgsServerInterfaceImpl : public QgsServerInterface
36 {
37  public:
38 
40  explicit QgsServerInterfaceImpl( QgsCapabilitiesCache *capCache,
41  QgsServiceRegistry *srvRegistry,
42  QgsServerSettings *serverSettings );
43 
44 
45  ~QgsServerInterfaceImpl() override;
46 
47  void setRequestHandler( QgsRequestHandler *requestHandler ) override;
48  void clearRequestHandler() override;
49  QgsCapabilitiesCache *capabilitiesCache() override { return mCapabilitiesCache; }
51  QgsRequestHandler *requestHandler() override { return mRequestHandler; }
52  void registerFilter( QgsServerFilter *filter, int priority = 0 ) override;
53  QgsServerFiltersMap filters() override { return mFilters; }
54 
56  void registerAccessControl( QgsAccessControlFilter *accessControl, int priority = 0 ) override;
57 
62  QgsAccessControl *accessControls() const override { return mAccessControls; }
63 
64 
71  void registerServerCache( QgsServerCacheFilter *serverCache SIP_TRANSFER, int priority = 0 ) override;
72 
78  QgsServerCacheManager *cacheManager() const override;
79 
80  QString getEnv( const QString &name ) const override;
81  QString configFilePath() override { return mConfigFilePath; }
82  void setConfigFilePath( const QString &configFilePath ) override;
83  void setFilters( QgsServerFiltersMap *filters ) override;
84  void removeConfigCacheEntry( const QString &path ) override;
85 
87 
89 
90  private:
91 
92  QString mConfigFilePath;
93  QgsServerFiltersMap mFilters;
94  QgsAccessControl *mAccessControls = nullptr;
95  QgsServerCacheManager *mCacheManager = nullptr;
96  QgsCapabilitiesCache *mCapabilitiesCache = nullptr;
97  QgsRequestHandler *mRequestHandler = nullptr;
98  QgsServiceRegistry *mServiceRegistry = nullptr;
99  QgsServerSettings *mServerSettings = nullptr;
100 };
101 
102 #endif // QGSSERVERINTERFACEIMPL_H
QgsServerCacheFilter
Class defining cache interface for QGIS Server plugins.
Definition: qgsservercachefilter.h:43
QgsCapabilitiesCache
A cache for capabilities xml documents (by configuration file path)
Definition: qgscapabilitiescache.h:35
QgsServerInterfaceImpl::requestHandler
QgsRequestHandler * requestHandler() override
Returns the QgsRequestHandler, to be used only in server plugins.
Definition: qgsserverinterfaceimpl.h:51
QgsServerInterface::registerServerCache
virtual void registerServerCache(QgsServerCacheFilter *serverCache, int priority=0)=0
Register a server cache filter.
QgsServerInterface::getEnv
virtual QString getEnv(const QString &name) const =0
Returns an enrironment variable, used to pass environment variables to Python.
QgsServerInterface::setConfigFilePath
virtual void setConfigFilePath(const QString &configFilePath)=0
Set the configuration file path.
QgsServerInterfaceImpl::capabilitiesCache
QgsCapabilitiesCache * capabilitiesCache() override
Gets pointer to the capabiblities cache.
Definition: qgsserverinterfaceimpl.h:49
QgsServerInterfaceImpl::filters
QgsServerFiltersMap filters() override
Returns the list of current QgsServerFilter.
Definition: qgsserverinterfaceimpl.h:53
QgsServerInterfaceImpl
Interfaces exposed by QGIS Server and made available to plugins.
Definition: qgsserverinterfaceimpl.h:36
QgsServerInterface::registerFilter
virtual void registerFilter(QgsServerFilter *filter, int priority=0)=0
Register a QgsServerFilter.
QgsServerInterface::clearRequestHandler
virtual void clearRequestHandler()=0
Clear the request handler.
QgsServerSettings
Provides a way to retrieve settings by prioritizing according to environment variables,...
Definition: qgsserversettings.h:85
qgsservercachemanager.h
qgscapabilitiescache.h
QgsServerInterface::registerAccessControl
virtual void registerAccessControl(QgsAccessControlFilter *accessControl, int priority=0)=0
Register an access control filter.
QgsServerFilter
Class defining I/O filters for QGIS Server and implemented in plugins.
Definition: qgsserverfilter.h:44
QgsServerCacheManager
A helper class that centralizes caches accesses given by all the server cache filter plugins.
Definition: qgsservercachemanager.h:41
QgsAccessControlFilter
Class defining access control interface for QGIS Server plugins.
Definition: qgsaccesscontrolfilter.h:51
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsServerInterface::serverSettings
virtual QgsServerSettings * serverSettings()=0
Returns the server settings.
QgsServerInterface::setFilters
virtual void setFilters(QgsServerFiltersMap *filters)=0
Set the filters map.
QgsAccessControl
A helper class that centralizes restrictions given by all the access control filter plugins.
Definition: qgsaccesscontrol.h:37
QgsServerInterface::removeConfigCacheEntry
virtual void removeConfigCacheEntry(const QString &path)=0
Remove entry from config cache.
QgsServerInterfaceImpl::accessControls
QgsAccessControl * accessControls() const override
Gets the helper over all the registered access control filters.
Definition: qgsserverinterfaceimpl.h:62
QgsServerInterface::cacheManager
virtual QgsServerCacheManager * cacheManager() const =0
Gets the registered server cache filters.
QgsServerInterfaceImpl::configFilePath
QString configFilePath() override
Returns the configuration file path.
Definition: qgsserverinterfaceimpl.h:81
QgsServiceRegistry
QgsServiceRegistry Class defining the registry manager for QGIS server services.
Definition: qgsserviceregistry.h:50
QgsServerFiltersMap
QMultiMap< int, QgsServerFilter * > QgsServerFiltersMap
Definition: qgsserverfilter.h:89
QgsRequestHandler
This class is an interface hiding the details of reading input and writing output from/to a wms reque...
Definition: qgsrequesthandler.h:39
QgsServerInterface::serviceRegistry
virtual QgsServiceRegistry * serviceRegistry()=0
Returns the service registry.
QgsServerInterface
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins.
Definition: qgsserverinterface.h:61
QgsServerInterface::setRequestHandler
virtual void setRequestHandler(QgsRequestHandler *requestHandler)=0
Set the request handler.
qgsserverinterface.h