QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsservercachemanager.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsservercachemanager.h
3  -----------------------
4 
5  begin : 2018-07-05
6  copyright : (C) 2018 by RenĂ©-Luc D'Hont
7  email : rldhont at 3liz dot com
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 QGSSERVERCACHEMANAGER_H
20 #define QGSSERVERCACHEMANAGER_H
21 
22 #include "qgsservercachefilter.h"
23 #include "qgsaccesscontrol.h"
24 #include "qgsserverrequest.h"
25 
26 #include <QDomDocument>
27 #include "qgis_server.h"
28 #include "qgis_sip.h"
29 
30 class QgsProject;
31 
32 SIP_IF_MODULE( HAVE_SERVER_PYTHON_PLUGINS )
33 
34 
40 class SERVER_EXPORT QgsServerCacheManager
41 {
42 #ifdef SIP_RUN
43 #include "qgsservercachefilter.h"
44 #endif
45 
46  public:
49 
52 
54  QgsServerCacheManager &operator=( const QgsServerCacheManager &copy );
55 
58 
67  bool getCachedDocument( QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const;
68 
77  bool setCachedDocument( const QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const;
78 
86  bool deleteCachedDocument( const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const;
87 
93  bool deleteCachedDocuments( const QgsProject *project ) const;
94 
102  QByteArray getCachedImage( const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const;
103 
112  bool setCachedImage( const QByteArray *img, const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const;
113 
121  bool deleteCachedImage( const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const;
122 
128  bool deleteCachedImages( const QgsProject *project ) const;
129 
135  void registerServerCache( QgsServerCacheFilter *serverCache, int priority = 0 );
136 
137  private:
138  QString getCacheKey( bool &cache, QgsAccessControl *accessControl ) const;
140  std::unique_ptr<QgsServerCacheFilterMap> mPluginsServerCaches = nullptr;
141 };
142 
143 #endif
QgsServerCacheFilter
Class defining cache interface for QGIS Server plugins.
Definition: qgsservercachefilter.h:42
QgsServerRequest
Definition: qgsserverrequest.h:38
qgsservercachefilter.h
QgsProject
Definition: qgsproject.h:92
qgsserverrequest.h
QgsServerCacheManager
A helper class that centralizes caches accesses given by all the server cache filter plugins.
Definition: qgsservercachemanager.h:40
qgis_sip.h
QgsAccessControl
A helper class that centralizes restrictions given by all the access control filter plugins.
Definition: qgsaccesscontrol.h:36
SIP_IF_MODULE
#define SIP_IF_MODULE(condition)
Definition: qgis_sip.h:28
qgsaccesscontrol.h