QGIS API Documentation  3.6.0-Noosa (5873452)
qgsservercachefilter.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsservercachefilter.h
3  ------------------------
4  Cache interface for Qgis Server plugins
5 
6  begin : 2018-07-05
7  copyright : (C) 2018 by RenĂ©-Luc D'Hont
8  email : rldhont at 3liz dot com
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  ***************************************************************************/
19 
20 #ifndef QGSSERVERCACHEFILTER_H
21 #define QGSSERVERCACHEFILTER_H
22 
23 #include <QMultiMap>
24 #include <QDomDocument>
25 #include "qgsserverrequest.h"
26 #include "qgis_server.h"
27 #include "qgis_sip.h"
28 
29 class QgsProject;
30 
31 SIP_IF_MODULE( HAVE_SERVER_PYTHON_PLUGINS )
32 
33 class QgsServerInterface;
34 
35 
42 class SERVER_EXPORT QgsServerCacheFilter
43 {
44 
45  public:
46 
52  QgsServerCacheFilter( const QgsServerInterface *serverInterface );
53 
54  virtual ~QgsServerCacheFilter() = default;
55 
63  virtual QByteArray getCachedDocument( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
64 
73  virtual bool setCachedDocument( const QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
74 
82  virtual bool deleteCachedDocument( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
83 
89  virtual bool deleteCachedDocuments( const QgsProject *project ) const;
90 
98  virtual QByteArray getCachedImage( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
99 
108  virtual bool setCachedImage( const QByteArray *img, const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
109 
117  virtual bool deleteCachedImage( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
118 
124  virtual bool deleteCachedImages( const QgsProject *project ) const;
125 
126 };
127 
129 typedef QMultiMap<int, QgsServerCacheFilter *> QgsServerCacheFilterMap;
130 
131 #endif // QGSSERVERCACHEFILTER_H
#define SIP_IF_MODULE(condition)
Definition: qgis_sip.h:28
Reads and writes project states.
Definition: qgsproject.h:89
Class defining cache interface for QGIS Server plugins.
QgsServerRequest Class defining request interface passed to services QgsService::executeRequest() met...
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins...
QMultiMap< int, QgsServerCacheFilter * > QgsServerCacheFilterMap
The registry definition.