QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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 
36 {
37  public:
38 
40  explicit QgsServerInterfaceImpl( QgsCapabilitiesCache *capCache,
41  QgsServiceRegistry *srvRegistry,
43 
44 
45  ~QgsServerInterfaceImpl() override;
46 
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  std::unique_ptr<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
QgsServiceRegistry * serviceRegistry() override
Returns the service registry.
void setConfigFilePath(const QString &configFilePath) override
Set the configuration file path.
QString configFilePath() override
Returns the configuration file path.
QgsCapabilitiesCache * capabilitiesCache() override
Gets pointer to the capabiblities cache.
Provides a way to retrieve settings by prioritizing according to environment variables, ini file and default values.
void registerFilter(QgsServerFilter *filter, int priority=0) override
Register a QgsServerFilter.
Class defining I/O filters for QGIS Server and implemented in plugins.
QgsServerSettings * serverSettings() override
Returns the server settings.
Class defining access control interface for QGIS Server plugins.
Interfaces exposed by QGIS Server and made available to plugins.
QgsServerCacheManager * cacheManager() const override
Gets the helper over all the registered server cache filters.
QMultiMap< int, QgsServerFilter * > QgsServerFiltersMap
#define SIP_TRANSFER
Definition: qgis_sip.h:36
A helper class that centralizes caches accesses given by all the server cache filter plugins...
QgsServerFiltersMap filters() override
Returns the list of current QgsServerFilter.
void setFilters(QgsServerFiltersMap *filters) override
Set the filters map.
This class is an interface hiding the details of reading input and writing output from/to a wms reque...
Class defining cache interface for QGIS Server plugins.
QgsServerInterfaceImpl(QgsCapabilitiesCache *capCache, QgsServiceRegistry *srvRegistry, QgsServerSettings *serverSettings)
Constructor.
void registerAccessControl(QgsAccessControlFilter *accessControl, int priority=0) override
Register an access control filter.
void removeConfigCacheEntry(const QString &path) override
Remove entry from config cache.
A cache for capabilities xml documents (by configuration file path)
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins...
QgsServiceRegistry Class defining the registry manager for QGIS server services.
void registerServerCache(QgsServerCacheFilter *serverCache, int priority=0) override
Registers a server cache filter.
QgsAccessControl * accessControls() const override
Gets the helper over all the registered access control filters.
QString getEnv(const QString &name) const override
Returns an enrironment variable, used to pass environment variables to Python.
A helper class that centralizes restrictions given by all the access control filter plugins...
void clearRequestHandler() override
Clear the request handler.
void setRequestHandler(QgsRequestHandler *requestHandler) override
Set the request handler.
QgsRequestHandler * requestHandler() override
Returns the QgsRequestHandler, to be used only in server plugins.