QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
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
23#include "qgsaccesscontrol.h"
24#include "qgsserverrequest.h"
25
26#include <QDomDocument>
27#include "qgis_server.h"
28#include "qgis_sip.h"
29#include "qgsserversettings.h"
30
31class QgsProject;
32
33SIP_IF_MODULE( HAVE_SERVER_PYTHON_PLUGINS )
34
35
41class SERVER_EXPORT QgsServerCacheManager
42{
43#ifdef SIP_RUN
45#endif
46
47 public:
50
52 QgsServerCacheManager &operator=( const QgsServerCacheManager &copy );
54
63 bool getCachedDocument( QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const;
64
73 bool setCachedDocument( const QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const;
74
82 bool deleteCachedDocument( const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const;
83
89 bool deleteCachedDocuments( const QgsProject *project ) const;
90
98 QByteArray getCachedImage( const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const;
99
108 bool setCachedImage( const QByteArray *img, const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const;
109
117 bool deleteCachedImage( const QgsProject *project, const QgsServerRequest &request, QgsAccessControl *accessControl ) const;
118
124 bool deleteCachedImages( const QgsProject *project ) const;
125
131 void registerServerCache( QgsServerCacheFilter *serverCache, int priority = 0 );
132
133 private:
134 QString getCacheKey( bool &cache, QgsAccessControl *accessControl, const QgsServerRequest &request ) const;
136 std::unique_ptr<QgsServerCacheFilterMap> mPluginsServerCaches = nullptr;
137 const QgsServerSettings &mSettings;
138};
139
140#endif
A helper class that centralizes restrictions given by all the access control filter plugins.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:107
Class defining cache interface for QGIS Server plugins.
A helper class that centralizes caches accesses given by all the server cache filter plugins.
QgsServerRequest Class defining request interface passed to services QgsService::executeRequest() met...
Provides a way to retrieve settings by prioritizing according to environment variables,...
#define SIP_IF_MODULE(condition)
Definition qgis_sip.h:28